Skip to content

Add mermaid.js as a dependency #5019

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

Merged
merged 4 commits into from
Mar 10, 2025
Merged

Add mermaid.js as a dependency #5019

merged 4 commits into from
Mar 10, 2025

Conversation

pezholio
Copy link
Contributor

@pezholio pezholio commented Mar 10, 2025

https://trello.com/c/JfbTFW0e/917-tech-documentation

A lot of docs are loaded in from Github. As Github-flavoured Markdown supports Mermaid for diagrams, Mermaid markup is used in a lot of our Readmes and docs (For example). This renders great in Github, but when we load it into developer docs, we just see the source code, for example:

image

This loads in Mermaid.js as a dependency, so now docs render like so:

image

This is the first time we've introduced JS-level dependencies to this repo, so I'd appreciate a steer that I've done it correctly!

@pezholio pezholio force-pushed the add-mermaid-js-dependency branch 4 times, most recently from 34251ad to 703d69f Compare March 10, 2025 10:45
This loops through all the direct dependencies specified in package.json
and adds the `dist` directory to the sprockets path, to ensure the
dependency’s code gets loaded.
This initializes mermaid.js with a custom selector, which ensures we
support Mermaid charts that have been loaded in from Github.
@pezholio pezholio force-pushed the add-mermaid-js-dependency branch from 703d69f to 12c8edf Compare March 10, 2025 15:41
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

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

@pezholio pezholio merged commit fcb6c79 into main Mar 10, 2025
6 checks passed
@pezholio pezholio deleted the add-mermaid-js-dependency branch March 10, 2025 15:57
pezholio added a commit to alphagov/govuk-docker that referenced this pull request Mar 12, 2025
We’ve now added JS dependencies (see alphagov/govuk-developer-docs#5019)
so we should add `yarn` as a step when making and spinning up the
project.
pezholio added a commit to alphagov/govuk-docker that referenced this pull request Mar 12, 2025
We’ve now added JS dependencies (see alphagov/govuk-developer-docs#5019)
so we should add `yarn` as a step when making and spinning up the
project.
pezholio added a commit to alphagov/govuk-docker that referenced this pull request Mar 12, 2025
We’ve now added JS dependencies (see alphagov/govuk-developer-docs#5019)
so we should add `yarn` as a step when making and spinning up the
project.
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.

2 participants