Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of content in PDF #114

Open
mirko3000 opened this issue Apr 29, 2022 · 1 comment
Open

Table of content in PDF #114

mirko3000 opened this issue Apr 29, 2022 · 1 comment

Comments

@mirko3000
Copy link

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.

@BlueHatbRit
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants