Hi folks,
is there an _easy_ way to obtain the figures and tables indices? In asciidoctor, asciidoctor-pdf and asciidoctor-epub? -- Marco Ciampa I know a joke about UDP, but you might not get it. ------------------------ GNU/Linux User #78271 FSFE fellow #364 ------------------------ |
Administrator
|
Are you interested in the last used number, or do you want to get the number for a particular node in the tree? If the latter, you can load the document, find the block, and access the index from the node. doc = Asciidoctor.load 'doc.adoc' table0 = (doc.find_by context: :table)[0] table0.number -Dan On Fri, Jun 15, 2018 at 1:28 AM, ciampix [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi folks, Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
On Fri, Jun 15, 2018 at 12:59:19AM -0700, mojavelinux [via Asciidoctor :: Discussion] wrote:
> On Fri, Jun 15, 2018 at 1:28 AM, ciampix [via Asciidoctor :: Discussion] < > [hidden email]> wrote: > > > Hi folks, > > is there an _easy_ way to obtain the figures and tables indices? > > In asciidoctor, asciidoctor-pdf and asciidoctor-epub? > > > > Are you interested in the last used number, or do you want to get the > number for a particular node in the tree? > > If the latter, you can load the document, find the block, and access the > index from the node. > > doc = Asciidoctor.load 'doc.adoc' > table0 = (doc.find_by context: :table)[0] > table0.number Oh sorry for my really bad English, I meant I would like to have some pages with something like the list on contents but for images and the same for the tables. Something like: Title list of contents bla bla bla pag. 1 bla bla bla pag. 11 Sub title Contents Sub title Contents Contents List of images Image caption1 pag. 3 Image caption2 pag. 5 List of tables Table caption1 pag. 4 Table cationn2 pag. 9 Is this difficult to obtain? TIA Best regards, -- Marco Ciampa I know a joke about UDP, but you might not get it. ------------------------ GNU/Linux User #78271 FSFE fellow #364 ------------------------ |
Administrator
|
You might consider writing a treeprocessor that inserts additional nodes into the document model. Those would then get included in the generated PDF. A treeprocessor would have access to all block-level content in the document. I would start by testing it with HTML output. Once you get that working, then you could move on to the PDF output. Cheers, -Dan On Fri, Jun 15, 2018 at 2:28 AM ciampix [via Asciidoctor :: Discussion] <[hidden email]> wrote: On Fri, Jun 15, 2018 at 12:59:19AM -0700, mojavelinux [via Asciidoctor :: Discussion] wrote: -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |