Closed janilahti closed 1 year ago
The marker is replaced with exactly your table of contents: nothing.
mdbook-toc
collects all headers from the file after the marker to generate the table of contents. There's no header in your toc.md
and thus nothing is generated.
Adding ## Hello World
at the end of toc.md
correctly generates this in the HTML:
<ul>
<li><a href="#hello-world">Hello world</a></li>
</ul>
Thank you for clearing this out. So, I'm not able to get full TOC of the book, only per file.
But one more note: If it works only for headers after the marker, then this
It turns this:
<!-- toc -->
into a Table of Contents based on all top- and second-level headings of the chapter.
is not exactly correct description.
Thank you for clearing this out. So, I'm not able to get full TOC of the book, only per file.
But one more note: If it works only for headers after the marker, then this
It turns this:
<!-- toc -->
into a Table of Contents based on all top- and second-level headings of the chapter.is not exactly correct description.
I noticed that too. It started out with only top- and second-level headings, but later expanded to default 4 levels, but configurable. I'll update the docs.
My TOC doesn't seem to get generated for some reason. Running this in Github action, and everything seems to go fine with latest
mdbook
(v0.4.30),mdbook-toc
(v0.12.0) andmdbook-pdf
(v0.1.6):But resulting HTML from
toc.md
looks like this:NOTE: This was when I used alternative marker
[[_TOC_]]
(that gets stripped away) and left the default one just hanging there. If I go with default marker, the default string gets removed and[[_TOC_]]
gets rendered as<p>[[<em>TOC</em>]]</p>
(as it should). So it seems that marker is detected, but for some reasons nothing is filled in place.SUMMARY.md
contains pointer to file with toc marker along with some content I copied and pasted for reference:In
book.toml
I haveTurning on debug I get:
I won't paste it as it's just too much, but there's also trace available: https://github.com/janilahti/mdpdftst/actions/runs/5132890322/jobs/9234773868
What am I missing here?