Progressive callouts across multiple source blocks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Progressive callouts across multiple source blocks

ctargett
I have a series of examples in my documentation that is currently in a single source block (~30+ lines), and each example builds on the one before. What I'd like to do is break up the example into multiple source blocks so each one is easier to read. To preserve the progression, I'd like to number the callouts across all the source blocks in sequence. So the first source block might have 1 and 2, then the 2nd source block has 3 and 4, etc.

I tried this (with the jekyll-asciidoc gem) and the 2nd callout got the number "2" in the source block, but "1" in the corresponding annotation definition, and I got errors like:

"callout list item index: expected 1 got 2"
"no callouts refer to list item 1"

Am I missing a setting to allow me to control the start number in the 2nd (and 3rd, etc.) callout? I thought I remembered seeing this once, but can't find it - am I misremembering?

Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Progressive callouts across multiple source blocks

mojavelinux
Administrator
There is currently no way to change the start number for callouts in a verbatim block or the callout list.

Callouts are pretty tightly coupled with the parser, so if we were to support something like that, it would require a change to the parser.

The first step to considering such a feature would be a proposal about how this information would be expressed in the source document. Then we'd assess the impact and decide whether to proceed.

Cheers,

-Dan

On Fri, Apr 6, 2018 at 8:13 AM, ctargett [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have a series of examples in my documentation that is currently in a single source block (~30+ lines), and each example builds on the one before. What I'd like to do is break up the example into multiple source blocks so each one is easier to read. To preserve the progression, I'd like to number the callouts across all the source blocks in sequence. So the first source block might have 1 and 2, then the 2nd source block has 3 and 4, etc.

I tried this (with the jekyll-asciidoc gem) and the 2nd callout got the number "2" in the source block, but "1" in the corresponding annotation definition, and I got errors like:

"callout list item index: expected 1 got 2"
"no callouts refer to list item 1"

Am I missing a setting to allow me to control the start number in the 2nd (and 3rd, etc.) callout? I thought I remembered seeing this once, but can't find it - am I misremembering?

Thanks in advance!


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Progressive-callouts-across-multiple-source-blocks-tp6237.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Progressive callouts across multiple source blocks

TheElderCat
In reply to this post by ctargett
Not ideal, but as a kludged work-around:

[source, python]
----
code line 16 # <16>
code line 17 # <17>
----

image:16.png[] The comments on code line 16.

image:17.png[] The comments on code line 17.


[source, python]
----
code line 18 # <18>
code line 19 # <19>
code line 20 # <20>
code line 21 # <21>
----

image:18.png[] The comments on code line 18.

image:19.png[] The comments on code line 19.

image:20.png[] The comments on code line 20.

image:21.png[] The comments on code line 21.

Not an ideal solution, as the "png callouts" are not sized the same as the callouts AsciiDoctor generates, but it kind of works.