-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat(mermaid): Add Mermaid.js diagrams plugin #1547
Conversation
✅ Deploy Preview for kuma ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The docs team added this to our stylesheet: https://github.com/Kong/docs.konghq.com/blob/e2f6df6b7f639891c59aad47b54ffe83c752c94b/app/_assets/stylesheets/page.less#L346 But I wasn't sure where to put that in the kuma-website style sheet. |
I need to delete this edit before this PR is merged, but here's an example of how a flowchart would currently render in the Kuma docs: https://deploy-preview-1547--kuma.netlify.app/docs/2.5.x/introduction/about-service-meshes/ |
I think you should be able to set it here, to fix the styling: This should work: pre,
pre[class*='language-'],
div[class*='language-'] {
background-color: $codeBgColor;
&.mermaid {
background-color: unset;
}
code {
font-size: 0.9rem;
line-height: 1.5;
color: #333;
}
} If that doesn't work, then you can do it like this: pre,
pre[class*='language-'],
div[class*='language-'] {
background-color: $codeBgColor;
code {
font-size: 0.9rem;
line-height: 1.5;
color: #333;
}
}
pre.mermaid {
background-color: unset;
} |
@lena-larionova Thanks for the feedback! You're first suggestion fixed it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! :) We already have some diagrams like this one
and a policy to make the diagrams
kuma-website/WRITING-DOCUMENTATION.md
Line 28 in 58bbbac
The team is moving diagrams to [Google slides](https://docs.google.com/presentation/d/1qvIKeYfcuowrHW1hV9fk9mCptt3ywroPBUYFjMj9gkk/edit#slide=id.g13d0c1ffb72_0_67). |
Added @lahabana to reviewers so he can take a look at this.
I think this is very welcome! Lowering the bar of adding graph and charts is a great idea! Can we start using it somewhere? I think it'd make it easier to review :) Also is it ok to rely on a CDN for the mermaid lib? @fabianrbz WDYT? |
We can, however, we wouldn't be gaining much tbh.
We have a few examples in docs.konghq
It should be ok, it's what they use in their docs.
It's the same implementation we have in docs.konghq, I'm trying to improve it so that the script doesn't get included with every diagram (we could have several diagrams on one page). I also don't want to include the mermaid js on every page. |
@cloudjumpercat can you rebase you first commit so it's Signed-Off too? (or just squash all your commits). |
Signed-off-by: Diana <[email protected]>
705b0ad
to
e7ddd55
Compare
@bartsmykla I squashed and signed the commit, but I'm not sure if it worked correctly since it seems to have brought in changes to the master branch. I used the following to squash it:
|
@cloudjumpercat all looks good now, thank you! |
The docs team recently added Mermaid.js to our own docs repo (see PR here) to make it easy to create diagrams. We also added some custom styles to match our branding colors. I thought it would make a nice addition to the Kuma repo, and I have a doc that I'm writing that would benefit from this diagram tool.
It can be used with the following syntax:
With mermaid we can describe graphs and diagrams in a markdown file and have them render as what we want.
So
would render as:
We've been using https://mermaid.live/edit to easily generate diagrams and see the rendered output before adding it to docs.
Did you sign your commit? Instructions Yes
Have you read Contributing guidelines? Yes