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

Pre-render Mermaid diagrams #3449

Merged
merged 4 commits into from
Dec 20, 2023
Merged

Pre-render Mermaid diagrams #3449

merged 4 commits into from
Dec 20, 2023

Conversation

astrojuanlu
Copy link
Member

Description

This avoids calling the Mermaid CLI every single time we build the docs. The Mermaid diagrams change very rarely, so this is unwarranted. Plus it was creating lots of problems, see gh-3395 for the last straw.

Development notes

Unfortunately, this means that, next time we change the diagrams, we'd have to re-render them. That can be done by calling the Mermaid CLI ourselves or using any other service though, so this shouldn't be a problem.

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Fix gh-3395.

Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Copy link
Contributor

@stichbury stichbury left a comment

Choose a reason for hiding this comment

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

Yay! This is great. Thank you.

Could you also leave a comment above each diagram on how to make an update and regenerate the PNG please? That is, what did you do this time to build them, so the rest of the team know how to uncomment, where to put the code, etc etc.

Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
@astrojuanlu
Copy link
Member Author

Wrote the instructions in https://github.com/kedro-org/kedro/wiki/Render-Mermaid-diagrams, tested them locally, and adding links from within the docs. Let me know what you think @stichbury

Copy link
Contributor

@stichbury stichbury left a comment

Choose a reason for hiding this comment

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

Looks great to me. I'd maybe later include versioning of what you're using mermaid/Python etc but I see it's kind of listed there already in the npm install

Thanks for this!

Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

Thanks @astrojuanlu this makes sense to me 👍

@astrojuanlu astrojuanlu enabled auto-merge (squash) December 20, 2023 12:57
@astrojuanlu astrojuanlu merged commit b11666e into main Dec 20, 2023
36 checks passed
@astrojuanlu astrojuanlu deleted the docs/static-mermaid-render branch December 20, 2023 13:36
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.

None yet

3 participants