mdpdf
mdpdf copied to clipboard
Table of content in PDF
Is there a way to generate the PDF outline/table of content? I do have a ToC within the document with working links (using markdown-toc), but the generated PDF does not have the native outline based on my headings.
This isn't something supported by mdpdf right now but I think it would be a good addition. I don't really use mdpdf much myself right now so it's not something I can spend time doing but I'd be open to a pull request if anyone fancied building it.
Mdpdf is quite a thin wrapper around the md -> html -> pdf conversion, you'd probably need to do an additional transformation during the initial md -> html step. Right now we don't have anything which really interrogates the markdown aside from converting relative links to absolute so we'd probably need some kind of markdown parser to yank out all the headers, format a ToC, and insert it into the correct place.