MikhailKravets / mkdocs_puml

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

Uuid cannot be replaced by SVG file #38

Closed HouzeZHANG closed 2 months ago

HouzeZHANG commented 2 months ago

Hello community,

I am trying to use inline plantuml to insert uml svg in mkdocs webpage.

I followed the readme.md steps to configure and you can check one part of my mkdocs.yml file as below:

plugins:
  - search
  - awesome-pages
  - git-revision-date-localized:
      type: date
  - minify:
      minify_html: true
      minify_js: true
      minify_css: true
      htmlmin_opts:
      remove_comments: true
  - plantuml:
      puml_url: https://www.plantuml.com/plantuml
      num_workers: 8
      puml_keyword: puml
      verify_ssl: true

After inserting the code segment of plantuml in the markdown file like below:

@startuml
Bob -> Alice : hello
@enduml

What I got is this part is replaced by an uuid. I test with localhost:8000:

8ca8b494-ec31-49b1-ad47-7e8d955749e4

It seems that my webpage doesn't reveive the response of the plantuml server after replacing the code segment by uuid.

I tried build_plantuml plugin which is an non-inline support for mkdocs and it seems that the server url is correct because it works.

Anyone know why it happens? Why mkdocs_plantuml cannot replace its uuid :) ?

MikhailKravets commented 2 months ago

Hi @HouzeZHANG, thanks for raising this issue!

I'll try to research this problem. But until then could you please run mkdocs server disabling each plugin except plantuml?

HouzeZHANG commented 2 months ago

You're right. 👍

I found that this plugin cannot work if I set minify:minify_html as true.

After setting it as false, the uuid is replaced by svg correctly.

That's strange. I think it's a plugin conflict.

BTW thanks for your help. ❤️

HouzeZHANG commented 2 months ago

Sorry 😓 it's my first time to use github issue, shall I close this issue or let it reopen?

MikhailKravets commented 2 months ago

@HouzeZHANG, try to place plantuml plugin before minify. This should fully process puml -> svg. Then minify the page. Please let me know of the result. If it doesn't help, I'll research minify if it's possible to make mkdocs_puml compatible with it.

HouzeZHANG commented 2 months ago

It works exactly as you said. Thanks. ❤️