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

Add support for Mermaid.js diagrams #1111

Closed
gcushen opened this issue May 27, 2019 · 0 comments
Closed

Add support for Mermaid.js diagrams #1111

gcushen opened this issue May 27, 2019 · 0 comments
Milestone

Comments

@gcushen
Copy link
Collaborator

gcushen commented May 27, 2019

Also, refer to the current diagram recommendations at https://sourcethemes.com/academic/docs/writing-markdown-latex/#diagrams .

Docs

To create a diagram or flowchart:

Add diagram: true to a page's YAML front matter.

Add Mermaid diagram syntax to the content of a page, wrapping it in the new Diagram shortcode:

{{< diagram >}}
graph LR;
    A[Hard edge] -->|Link text| B(Round edge)
    B --> C{Decision}
    C -->|One| D[Result one]
    C -->|Two| E[Result two]
{{< /diagram >}}

Future work

For case where day/night mode is enabled and toggled by visitor, we don't require a page refresh if we keep track of the graph_data for each .mermaid div prior to the first init of Mermaid.js and then apply a different day/night theme on that data:

$('#mermaid').html(graph_data).removeAttr('data-processed');
mermaid.init({ theme: theme_name });

See mermaid-js/mermaid#311 (comment)

@gcushen gcushen changed the title Consider adding support for Mermaid.js diagrams Add support for Mermaid.js diagrams May 27, 2019
@gcushen gcushen added this to the v4.4 milestone May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant