mkdocs-print-site-plugin
mkdocs-print-site-plugin copied to clipboard
Toc inclusion not fully documented
Hi there,
thank you for this great plugin. I am experiencing some difficulties while trying to put the TOC in the pdf. Do I need to put it into an external file and load it? If yes, under which path and where to put the path? And in which format?
Sorry about this but I haven't found any example in the documentation. Could you please provide an example?
Thanks
Hi Anico2,
Happy to hear the plugin is useful for you.
The table of contents is auto-generated, if you have it enabled in the options (which is default):
add_table_of_contents
Default is true. Adds a table of contents section at the beginning of the print page (in print version, the HTML version has a different sidebar ToC). (from https://timvink.github.io/mkdocs-print-site-plugin/options.html)
So hit CTRL + P on the print site page to see the print preview of your table of contents
Thank you very much for your reply.
Yeah, i read that docs section. I left all the default configuration but I ended up with an empty page at the beginning of the pdf with only the 'TOC' header at the top. Since my project is only at the beginning, some pages in mkdocs raise 404 because they are still empty. Could this be the cause of the empty toc?
Thank u
I'm not sure how to help you. I recommend creating a new, small site (mkdocs new my-project
) and checking if something is wrong. This plugin does require each page to have an h1 heading (the first line having something like # title
) .