It would be be better if a local TOC is created when a class is added to the header (.local-top for example)
Ch.D

Le lundi 7 janvier 2019 05:10:33 UTC+1, Axel Rauschmayer a écrit :
I’m considering writing a filter that inserts chapter TOCs via \ChapterTOC:

INPUT (# is for parts, ## is for chapters, etc.):

## Chapter on animals {#animals}
### Section on dogs {#dogs}
#### Subsection on poodles
### Section on cats {#cats}

CHAPTER TOC (number of chapter is 12):

* 12.1. [Section on dogs](#dogs)
* 12.1.2. Subsection on poodles
* 12.2. [Section on cats](#cats)

Considerations:
  • Getting the numbering right is challenging – AFAICT, a filter does not have access to the numbers and numbering works differently for LaTeX and HTML. Thus, I’ll probably extend my filter that numbers text units for HTML, to additionally create TOCs (for LaTeX, it would only do the latter): https://groups.google.com/d/topic/pandoc-discuss/N4Qv0Bvgt_E/discussion
  • Alternatively, things would be easier if one omitted the chapter number. But then the numbers in the TOC are not as nice.
  • For another book, where I couldn’t change how Markdown was translated to HTML, PDF, etc., I wrote a shell script that inserted the chapter TOC into the text file. For pandoc, I’d prefer to use a filter. The output of the shell script looks as follows: http://exploringjs.com/es6/ch_symbols.html
  • The shell script complains if sections don’t have IDs. I’ll have to look into retrieving pandoc’s auto-generated IDs.
Is there something I’m overlooking? Any tips or suggestions?

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6fe9c4df-2625-4508-8608-da8499e81599%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.