timvink / mkdocs-print-site-plugin

MkDocs Plugin that adds an additional page that combines all pages, allowing easy exports to PDF and standalone HTML.
https://timvink.github.io/mkdocs-print-site-plugin/
MIT License
146 stars 23 forks source link

Adjust heading level from markdown files #117

Open mbs44 opened 2 months ago

mbs44 commented 2 months ago

Hi

I have a bigger technical documentation generated from real world application in mkdocs format with material design theme. I have used print-site plugin quite successfully but one problem I couldn't solve.

I have a structure of folders of depth 3 or 4 and folders contain markdown files. I'm using heading 1 and often heading 2 inside markdown files. Everything works and looks nicely on the original multi file web page.

But if I generate everything into single page file then surprisingly the heading levels from the individual markdown files stay the same. E. g. in the output print_page.html I have heading 3 generated from the folder structure and then follows the first heading 1 from the individual markdown file which doesn't look nice. I would expect heading 4 in this case, so the heading level from markdown file should be shifted by the current depth of folder structure.

For example when I generate the pdf file using with-pdf plugin the headings from markdown files are adjusted correctly and the numbering is correct too.

Am I missing some setting or doing it wrongly? On the other hand I would expect this should be the default behavior.

nurse-the-code commented 2 months ago

Can you provide some examples (i.e. relevant file structure, markdown headings and screenshot of PDF output headings) so it is a little clearer what the problem is?