mkdocs-print-site-plugin icon indicating copy to clipboard operation
mkdocs-print-site-plugin copied to clipboard

Toc inclusion not fully documented

Open Anico2 opened this issue 6 months ago • 3 comments

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

Anico2 avatar Feb 09 '24 22:02 Anico2

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

timvink avatar Feb 10 '24 18:02 timvink

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

Anico2 avatar Feb 10 '24 19:02 Anico2

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) .

timvink avatar Feb 11 '24 19:02 timvink