Skip to content

Commit

Permalink
Add Mermaid support and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
katomm committed Dec 2, 2024
1 parent a5321b7 commit 7669450
Show file tree
Hide file tree
Showing 4 changed files with 957 additions and 8 deletions.
51 changes: 51 additions & 0 deletions docs/portal-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,57 @@ This is a tip admonition with a custom title
</TabItem>
</Tabs>

## Mermaid

To use Mermaid diagram, add a code block with language `mermaid`. See the [Mermaid syntax documentation](https://mermaid-js.github.io/mermaid/#/./n00b-syntaxReference) for more information on the Mermaid syntax and the different diagrams. Some examples:

```mermaid
mindmap
root((Cardano))
Technology
Blockchain
Proof of Stake
Ouroboros
Smart Contracts
Aiken
Marlowe
Community
Developers
Stake Pool Operators
Ambassadors
Use Cases
Decentralized Finance
Identity Management
KERI
Supply Chain
Research
Peer-Reviewed Papers
Academic Collaboration
Formal Methods
Ecosystem
Native Tokens
dApps
Catalyst
```

```mermaid
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Continue]
B -->|No| D[Stop]
```

```mermaid
pie
"Metadata" : 81
"Smart Contracts" : 62
"Simple transactions" : 231
```




## Other style elements
Please try to avoid other style elements, and always keep in mind that people with visual handicaps should also be able to cope with your content.

## Editor extensions and configurations
Expand Down
4 changes: 4 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ module.exports = {
repository: `${vars.repository}`,
branch: `${vars.branch}`,
},
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
themeConfig: {
// Docs Sidebar
docs: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"clear": "docusaurus clear"
},
"dependencies": {

"@docusaurus/core": "3.6.3",
"@docusaurus/plugin-client-redirects": "^3.6.3",
"@docusaurus/plugin-content-docs": "^3.6.3",
"@docusaurus/plugin-ideal-image": "^3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@docusaurus/theme-mermaid": "^3.6.3",
"@docusaurus/theme-search-algolia": "3.6.3",
"@mdx-js/react": "^3.1.0",
"@popperjs/core": "^2.11.2",
Expand Down
Loading

0 comments on commit 7669450

Please sign in to comment.