Say I have following asciidoc:
[source,ruby] ---- require 'asciidoctor' <1> puts Asciidoctor.render_file('sample.adoc', :header_footer => true) <2> ---- <1> Imports the library <2> Reads, parses and renders the file How can I now cross reference <1> here? Just typing <1> renders it literally. ![]() |
Not sure if this is what you are trying to do? If not, please ignore. It just shows how to create links which when clicked will make the browser show the line containing the specific callout at the top of the screen.
= Cross Referencing Callouts From A Code Listing :icons: font .Code Listing Number 1 [source, ruby] ---- require 'asciidoctor' <1> puts Asciidoctor.render_file('sample.adoc',:header_footer=>true) <2> ---- <1> Imports the library [[_1_1]] <2> Reads,parses and renders the file [[_1_2]] random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text ==== A random sidebar. ==== <<_1_1,1>> *_Listing 1, Callout 1._* random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text ==== A random sidebar. ==== <<_1_2,2>> *_Listing 1, Callout 2._* random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text .Code Listing Number 2 [source, ruby] ---- require 'asciidoctor' <1> puts Asciidoctor.render_file('sample.adoc',:header_footer=>true) <2> ---- <1> Imports the library [[_2_1]] <2> Reads,parses and renders the file [[_2_2]] ==== A random sidebar. ==== random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text <<_2_1,1>> *_Listing 2, Callout 1._* random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text ==== A random sidebar. ==== random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text <<_2_2,2>> *_Listing 2, Callout 2._* random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text random text |
Administrator
|
In reply to this post by siddjain
On Mon, Jun 22, 2020 at 3:25 PM siddjain [via Asciidoctor :: Discussion] <[hidden email]> wrote: Say I have following asciidoc: -- Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |