This repo demonstrates how mermaid-maker/action can be integrated into your web-app.
-
The
public/*.mmddirectory contains the mermaid definition files. -
The
app/componentsdirectory contains 2 components:
app/components/ClientMermaid.tsxgenerates mermaid diagrams on the client for dev environments.app/components/MermaidDiagram.tsxchecks whether the current environment is dev or prod, before choosing the rendering strategy for mermaid diagrams.
- The
.github/workflowsdirectory which contains 2 workflows:
.github/workflows/gen_mermaid.ymlwhich you can run (workflow_dispatch) to see how the action generates a test diagram.github/workflows/nextjs.ymldeploys the app into github pages. This is the workflow that shows howmermaid-maker/actioncan be integrated into a Next app deployment.
Feel free to fork the repo, add more mermaid definition files to the public directory, and see the action in actions!