marksman icon indicating copy to clipboard operation
marksman copied to clipboard

Generate TOC improvements

Open keynmol opened this issue 2 years ago • 1 comments

Now that #17 is merged, here's how it can be improved:

  1. If the document has a *single level-1 heading (=title), the TOC should be inserted right under it

    This means that the entire TOC will have to be shifted one level down (heading 2 becomes heading 3, etc.) and the original heading-1 is not rendered at all

  2. If the document has a YAML frontmatter, the TOC should be inserted under it (unless rule 1 applies)

    This would require to

    • Enable YAML parsing on Markdig
    • Propagate the location of yaml block all the way to Document Index

keynmol avatar Jun 09 '22 13:06 keynmol

if the document has a *single level-1 heading (=title), the TOC should be inserted right under it

Yes! 🙌 Also, would be great to insert an extra newline between the title and the toc.

artempyanykh avatar Jun 09 '22 14:06 artempyanykh