Problems in main TOC while embedding markdown files #7657
pajaro1966
started this conversation in
General
Replies: 1 comment 6 replies
-
AFAIK, this is a general problem with Markdown. If you write the embedded files just for embedding then you can avoid a level 1 heading but if they also need to have their own existence then their level 1 headings get included in a document that already has one. How are you including the files? If you are using the Python Markdown Extensions and their snippets function, then you could try specifying the starting line for the included file. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I embed a markdown file in another markdown file, the TOC of the main file gets interrupted if the embedded file contains a first level heading (#), but not if it contains only second or further level headings (##, ###, etc.).
This is a screen shot of the main TOC in my MkDocs. It stops at the letter delta (Δ):
This is the content of the first embedded markdown file (it does not interrupt the TOC):
This is the content of the second embedded markdown file, the one interrupting the TOC:
The main markdown file contains many other first level headings that don't appear in the TOC (exactly after the point where the second embedded file is inserted):
The solution seems easy: to write my embedded .md files with no first level heading, but this is a bad practice and I should reformat all my files. Is this a bug or am I making some mistake?
Sorry if this issue has been already addressed. I couldn't find any reference.
Thanks in advance for your help.
Antonio
Beta Was this translation helpful? Give feedback.
All reactions