iSOLveIT / mkdocs-pdf-generate

An MkDocs plugin to generate individual PDF files from content pages.
https://isolveit.github.io/mkdocs-pdf-generate/
MIT License
6 stars 0 forks source link

Combined pdf option #17

Open nicorikken opened 1 year ago

nicorikken commented 1 year ago

My main use-case is to generate a single pdf from the mkdocs documentation. This plugin is the best I found available at the moment, but lacks the combined pdf feature, although there is some commented out code available in the repo. It is however not instrumented to be run.

It seem to be coming from https://github.com/zhaoterryy/mkdocs-pdf-export-plugin/tree/master/mkdocs_pdf_export_plugin but the overall structure is different to the point where a 1:1 copy doesn't make sense. I started adding this feature but I quickly ran into the structural changes that warrant a different approach for a combined pdf.

What is the roadmap for supporting a combined pdf generation?

Furthermore, I have noticed two shortcomings from other plugins I would like to raise here as well:

Relative heading levels according to the nav: section inm the mkdocs.yml

When you have pages lower in the hierarchy starting with a header one, the resulting pdf outline doesn't match the tree in the nav section. I can think of two solutions:

Mermaid.js handling

Mermaid.js is has become one of the default code-based diagramming solutions. It is also supported in mkdocs-material https://squidfunk.github.io/mkdocs-material/reference/diagrams/ However when rendering the pdf, the diagram is shown just as a code block:

afbeelding

I found this Pandoc filter to handle mermaid cases. Something like that might be interesting, of course implemented differently. Perhaps even as a separate plugin, not sure how that would work with mkdocs. https://github.com/raghur/mermaid-filter Original thread of implementing mermaid.js in material theme for reference: https://github.com/squidfunk/mkdocs-material/issues/693

iSOLveIT commented 1 year ago

Hi @nicorikken, Thanks for opening this issue. Although the pdf-generate plugin is a company internal tool, I've taken note of your concerns and will look at them when appropriate.

I will leave the issue as opened.

nicorikken commented 1 year ago

So to clarify, it sounds like you are not against it but you don't have a need for it yourself. So if I were to contribute a pull request, would you be willing to consider it?

iSOLveIT commented 1 year ago

As I said earlier, the plugin was built purposely to be used internally in a company so I wouldn't be able to merge the pull request because the company using this tool doesn't need the combined PDF feature.

nicorikken commented 1 year ago

Thanks for clarifying.