include block code and documentation

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

include block code and documentation

denis
Hi,

reading the asciidoctor guideline's code, I found this interesting option to document your code using specific syntax to reference your line code:

[source,ruby]
----
require 'sinatra' // <1>
----
<1> Library import


But, how can we deal with the include statements?  I want my included file to contain both the code and the documentation ! something like

// tag::example[]
require 'sinatra' // <1>
<1> Library import
// end::example[]

but the documentation line is is considered as code...

Any idea ?

Reply | Threaded
Open this post in threaded view
|

Re: include block code and documentation

mojavelinux
Administrator
You need to use two separate tags, one for the code and one for the callouts.

Though, you may also be interested in is something like https://github.com/asciidoctor/asciidoctor/issues/598

-Dan

On Mon, Aug 21, 2017 at 2:50 AM, denis [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

reading the asciidoctor guideline's code, I found this interesting option to document your code using specific syntax to reference your line code:

[source,ruby]
----
require 'sinatra' // <1>
----
<1> Library import


But, how can we deal with the include statements?  I want my included file to contain both the code and the documentation ! something like

// tag::example[]
require 'sinatra' // <1>
<1> Library import
// end::example[]

but the documentation line is is considered as code...

Any idea ?




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/include-block-code-and-documentation-tp5858.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