Skip to content

Add support for Mermaid diagrams#340

Merged
LisaFC merged 3 commits intogoogle:masterfrom
gwatts:gareth/mermaid
Sep 28, 2020
Merged

Add support for Mermaid diagrams#340
LisaFC merged 3 commits intogoogle:masterfrom
gwatts:gareth/mermaid

Conversation

@gwatts
Copy link
Copy Markdown
Contributor

@gwatts gwatts commented Sep 21, 2020

Adding diagrams to documentation is a pretty useful thing; Mermaid really helps as it allows you to generate a diagram from simple code, and keep the code as part of the document, allowing the browser to render it on the fly.

This update allows Mermaid documents to be included as fenced code, in the same way as Gitlab supports, so if you happen to be working in that environment, it should be a similar experience.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Sep 21, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@gwatts
Copy link
Copy Markdown
Contributor Author

gwatts commented Sep 21, 2020

@googlebot I signed it!

@gwatts
Copy link
Copy Markdown
Contributor Author

gwatts commented Sep 21, 2020

Here's the link to the doc preview with diagram embedded.

gwatts and others added 2 commits September 22, 2020 21:32
* Scale diagrams to fit instead of displaying a horizontal scroll bar
* Don't display diagram source before rendering
* Document diagram level configuration override option
@LisaFC
Copy link
Copy Markdown
Collaborator

LisaFC commented Sep 28, 2020

This is FANTASTIC. Thanks so much for adding it, it's a great feature.

@LisaFC LisaFC merged commit 174e1ff into google:master Sep 28, 2020
@LisaFC
Copy link
Copy Markdown
Collaborator

LisaFC commented Sep 28, 2020

Feel free to send a mail to docsy-users@googlegroups.com to let the community know about the feature, I think lots of users would like to try it.

@gwatts
Copy link
Copy Markdown
Contributor Author

gwatts commented Sep 28, 2020

Thanks for merging @LisaFC ! I'll have a little update once the next version of Mermaid is released to cleanup the javascript some, and also move it into assets/js along with the other theme javascript and cleanup partial/scripts.html

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