Skip to content
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

Pull in latest mermaid version while allowing custom versions #1410

Merged
merged 8 commits into from
Feb 2, 2024

Conversation

deining
Copy link
Collaborator

@deining deining commented Feb 12, 2023

Making asset URL configurable was discussed more than once in the past. There was even PR #1006 that tried to resolve this issue, better never got merged due to CLA issues.
I myself proposed a solution on this issue with #803 a while ago. Yesterday @huima came up with a question about this issue again. This motivated me to author this PR which implements a quite simple solution for the outstanding issue: users now can simply specify the wanted mermaid version inside project's hugo.yaml:

params:
  mermaid:
    version: 9.3.0

Everything else is transparently done behind the scenes. One can even specify latest in order to pull in the latest released version:

params:
  mermaid:
    version: latest

This PR also adds a paragraph to the mermaid section of the user guide, documenting the newly introduced version parameter in the mermaid config section.

This PR also contributes to #1354 (better GDPR support) in the sense that mermaid script is now pulled in at build time and not at runtime any more.

This PR currently addresses mermaid only. Should be fairly easy to extend this PR so that version of other dependencies (KaTeX, ...) can be specified inside hugo.yaml, too.

This issue fixes #1484.


Preview: https://deploy-preview-1410--docsydocs.netlify.app/docs/adding-content/diagrams-and-formulae/#diagrams-with-mermaid


@deining deining changed the title Mermaid: custom version used can now be given in hugo.yaml Pull in latest mermaid version while allowing custom versions Feb 13, 2023
@deining
Copy link
Collaborator Author

deining commented Feb 28, 2023

Mermaid is at version 10.0.1 now, which is ESM only.
This PR needs to be reworked so that mermaid script is imported as module.

@deining
Copy link
Collaborator Author

deining commented Mar 1, 2023

This PR was reworked, mermaid script is now imported as module. This allows use use mermaid version 10 and above, right now we are at 10.0.2.

@deining deining force-pushed the issue-803 branch 3 times, most recently from ac279e3 to cbc57f9 Compare March 13, 2023 19:04
@deining deining mentioned this pull request Mar 13, 2023
@deining deining mentioned this pull request Apr 4, 2023
4 tasks
@deining deining force-pushed the issue-803 branch 2 times, most recently from a57fd66 to c395c29 Compare May 12, 2023 20:49
@deining
Copy link
Collaborator Author

deining commented May 12, 2023

Rebased PR to HEAD of branch main and bumped mermaid version to latest released version 10.1.0.

@LisaFC
Copy link
Collaborator

LisaFC commented May 24, 2023

@chalin is this something we can pull in without disturbing the Great Bootstrap Upgrade?

@chalin
Copy link
Collaborator

chalin commented May 24, 2023

I've delayed addressing this PR because it feels like a one-off solution to something we might address as a more global solution to:

@deining deining force-pushed the issue-803 branch 2 times, most recently from eb6e107 to e40937d Compare May 25, 2023 20:22
@chalin chalin added this to the 23Q3 milestone May 31, 2023
@deining
Copy link
Collaborator Author

deining commented Jun 11, 2023

I've delayed addressing this PR because it feels like a one-off solution

Can you be more specific please? What exactly is missing in my PR?

to something we might address as a more global solution to:

* [Better GDPR support #1354](https://github.com/google/docsy/issues/1354)

I had a look at #1354 again and I'm still on the impression that my PR covers all aspects discussed there. If I missed something however, please advise and I will happily extended and improve my PR so that it covers all desired aspects/functionalities.

@chalin chalin modified the milestones: 23Q3, 23Q4 Jul 27, 2023
@chalin chalin modified the milestones: 23Q4, 24Q1 Nov 3, 2023
@deining deining force-pushed the issue-803 branch 2 times, most recently from 8bcfeeb to badb9fb Compare November 9, 2023 11:13
@deining deining mentioned this pull request Nov 9, 2023
@dogmatic69
Copy link

I've delayed addressing this PR because it feels like a one-off solution to something we might address as a more global solution to:

In the mean time packages are so outdated we cant do something as simple as document a diagram? Can this get merged in the mean time as it does not change things from a GDPR perspective.

@deining deining requested a review from chalin November 19, 2023 09:24
@deining deining force-pushed the issue-803 branch 3 times, most recently from 0ffc029 to 973fe1b Compare November 19, 2023 16:16
@chalin chalin modified the milestones: 24Q1, 23Q4 Nov 29, 2023
@chalin chalin modified the milestones: 23Q4, 24Q1 Jan 11, 2024
@chalin chalin mentioned this pull request Feb 2, 2024
33 tasks
@chalin chalin self-assigned this Feb 2, 2024
@deining
Copy link
Collaborator Author

deining commented Feb 2, 2024

Resolved the issues raised and updated documentation to latest mermaid version. From my point of view, this ready for merging.

Copy link
Collaborator

@chalin chalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@chalin chalin merged commit 40561ad into google:main Feb 2, 2024
11 checks passed
@deining deining deleted the issue-803 branch February 2, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update mermaid
5 participants