owenh000 / asciidoctor-multipage

A configurable multipage HTML converter for Asciidoctor
https://owenh.net/asciidoctor-multipage
MIT License
59 stars 23 forks source link

ToC generated inside block level (a) table cells with toc2 attr set on command line #32

Open pdabr1 opened 2 years ago

pdabr1 commented 2 years ago

If a document contains a table with a multi line cell (with prefix a), the table of contents is generated into this cell. Example document with html output attached.

tested with version 0.0.15

command used to create html output: docker run --rm --user $(id -u) -v $(pwd):/documents/ gbif/asciidoctor-toolkit asciidoctor -r asciidoctor-multipage -b multipage_html5 -D . -a toc2 -a toclevels=3 -a toc=left -a docinfo=shared testtable.adoc -o testtable.html

testtable.zip

owenh000 commented 2 years ago

@pdabr1, it works for me. There is already a test for this too at test/black-box-docs/table-block-operator/.

Are you sure you are using asciidoctor-multipage v0.0.15?

pdabr1 commented 2 years ago

@owenh000, thanks for the reply. I could get it to work. I converted the files into unix format and changed "-a toc2" of the build command into "-a toc".

owenh000 commented 2 years ago

@pdabr1, I'm glad you got it working. Thanks for the update.

It looks like the -a toc2 option on the command line is what breaks it; I missed that earlier. You should be able to work around this by setting the :toc2: document attribute inside the source file rather than with the -a option.

It appears that the document attribute specified on the command line is getting passed to the nested document when it shouldn't. I'll update the issue title and reopen this.


Test file test.adoc:

= Title
:toc2:

== Header1

|===
|Column1        |Column2
|Regular cell  a|ToC should not appear in this cell
|===

Test commands:

## This breaks
$ asciidoctor -r asciidoctor-multipage -b multipage_html5 -a toc2 -D test/out test.adoc

## This works
$ asciidoctor -r asciidoctor-multipage -b multipage_html5 -D test/out test.adoc
pdabr1 commented 2 years ago

@owenh000 thanks for looking into this in depth. I'm glad I didn't waste your time. Keep on the good work 👍

owenh000 commented 7 months ago

Completing issue #46 would probably fix this issue.