MikhailKravets / mkdocs_puml

Inline PlantUML diagrams in your MkDocs documentation
MIT License
26 stars 5 forks source link

site-print doesn't work with plugin #25

Closed Q-efx closed 1 year ago

Q-efx commented 1 year ago

Describe the bug If you create a single page via site-print plugin, you get no images but UID reference numbers.

To Reproduce Steps to reproduce the behavior: install this plugin install site-rpint Create simple plantuml diagram Create single page html

Expected behavior Diagrams are also in the single page html

MikhailKravets commented 1 year ago

Hi @Q-efx, are you talking about mkdocs-print-site-plugin plugin?

MikhailKravets commented 1 year ago

Hey @Q-efx, are there any updates on the issue?

rbejar commented 1 year ago

Hi. I am having the same issue. Using mkdocs-print-site-plugin==2.3.5 and mkdocs-puml==1.2.0. I see the UUIDs, but not the UML diagramas when I go to the print_page of my site. If there is anything I can do to help, please, tell me.

rbejar commented 1 year ago

Hi. We have worked around this by using another plugin (plantuml-markdown==3.9.1). You just need to add it to the markdown_extensions section of the mkdocs.yml file and in the code blocks instead of puml you write plantuml. And that's essentially it. In any case, thanks for your work with mkdocs-puml.

MikhailKravets commented 1 year ago

This issue requires thorough investigation of mkdocs-print-site-plugin to work out the solution. I bet we have operlaping events.

@rbejar , plantuml-markdown makes 1 request to puml server per 1 diagram. mkdocs-puml, on the contrary, use multithreading to make requests to the server. So, if you have many diagrams mkdocs-puml works way faster.

MikhailKravets commented 1 year ago

@Q-efx, @rbejar, I've figured out the problem. Appeared that I've returned correct value from on_post_page event but mkdocs doesn't apply the output to Page object. I had to do it manually. And mkdocs-print-site-plugin, on the contrary, works with Page objects.

I plan to publish a new version with this fix over few days 🎉

rbejar commented 1 year ago

I will test it as soon as it is published. Thanks for looking at this!

MikhailKravets commented 1 year ago

The issue was fixed in #27. Please upgrade mkdocs-puml package to the newest 1.2.1 version.