fralau / mkdocs-mermaid2-plugin

A Mermaid graphs plugin for mkdocs
https://mkdocs-mermaid2.readthedocs.io
MIT License
220 stars 28 forks source link

Allow offline use looking for library in custom_dir ... #94

Closed fccagou closed 9 months ago

fccagou commented 9 months ago

Example of mkdocs.yaml

theme:
  name: mkdocs
  highlightjs: true
  custom_dir: custom_theme/mkdocs/

plugins:
    - search
    - mermaid2:
        javascript: 'js/mermaid@10.4.0/dist/mermaid.esm.min.mjs'
fralau commented 9 months ago

Thank you for your PR. As mentioned in the Contributing Guidelines, before submitting a PR, always open an Issue and consider the answers.

According to the documentation, it is already possible to use a local javascript library.

When opening the issue, could I ask you to explain what problem this change aims to solve, that was not already solved?

fccagou commented 9 months ago

oh! I didn't see this part of the documentation concerning local js and PR to quickly, my bad :( It could be interesting to had this information in the get-started doc to focus offline site. Do I make an issue for that ?

I've update my site using your advice and it works fine !

Concerning this PR, it seems useless now ... even if using custom_theme can be a way to package the configuration for many sites... It can be used to replace de hard link to highlight.js on cdn in mkdocs ... I'll work on it in mkdocs code and create an issue if you think it could be a good idea.

Thanks a lot for your work.

fralau commented 9 months ago

oh! I didn't see this part of the documentation concerning local js and PR to quickly, my bad :(

No trouble! That's why I keep saying that one should always raise an issue before starting to work on a PR. 🙂 (Who knows, there could already be a solution?)

Plus, it can be fun to interact with like-minded people who want to solve the same problems.

It could be interesting to had this information in the get-started doc to focus offline site. Do I make an issue for that ?

By all means! The more explicit the documentation is, the better it will be.

I've update my site using your advice and it works fine !

Great to hear 👍

Concerning this PR, it seems useless now ... even if using custom_theme can be a way to package the configuration for many sites... It can be used to replace de hard link to highlight.js on cdn in mkdocs ... I'll work on it in mkdocs code and create an issue if you think it could be a good idea.

It's an intriguing idea! Is that already an issue, or do you wish to start with a discussion? (It is up to you). Discussions are not too bad, because they are more informal, and people might be willing to throw in more ideas.

Thanks a lot for your work.

You are welcome. Thanks to you too: it is contributions from the community that make the effort of maintaining an Open Source project worthwhile.