-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Parse TOC from JSON and add PDF metadata #24
base: main
Are you sure you want to change the base?
Conversation
Thanks for your contribution! just had a quick glance at this PR, generating the ToC from JSON directly is an interesting idea. I want to check, do you see any clear difference in the ToC content between the original way and your way? Maybe we can just use your way as the default option if they are actually producing the same result. |
Well on my document, the html-based one misses at least half of the TOC, which is why I did this in the first place. As such, I can't really compare. It should have the same result, thought. For context, I use Unicode characters in titles, titles do not match the file names and I use msedge.exe on Windows to generate the PDF. |
Okay, now I know what's going on, you may be in the same situation as: Since it's meaningless to generate a PDF file with broken internal links, the Your PR doesn't work with my patched version of mdBook (see the first pdf file), as in that patch, I append a path id prefix to all the anchors. You can modify this PR to use the file path information in JSON and later I may consider replacing the HTML way with your method if this gets fixed. Even though I can see that your PR works almost correctly with the unpatched mdBook, some are still problematic (See the second pdf file), and you may also want to handle these issues as well: (The third one is the current HTML-based version) If you find any issues with the current version, please let me know. |
Please let me know when you are ready, thanks for your contribution again! (Since I've been working on this repository all by myself, you will become the 2nd one who has contributed to this repository if your PR gets merged 🙌 !) |
Thanks for your time and review. Right now I won't have time to fix this further, and it currently works for me. I'll come back and fix this in one or two months. Don't hesitate to ping me then. |
9199582
to
39bb46f
Compare
29a09e4
to
08f741d
Compare
Using the JSON description of the book allows easier and more reliable generation for the table of contents / pdf outline.
This PR also add the book title, author, and description to the PDF metadata.