Mermaid for easy schemas
Schemas configured as code
As the saying goes, an image is worth a thousand words...
Whenever I tried to create schema before, I always had trouble keeping it up-to-date and had to drop it :(
But no longer thanks to Mermaid !
What is Mermaid ?
Mermaid is a language to create schmas.
No long are you stuck editing PNGs !
You can access the online tool here. And the project's GitHub here.
What's even better, mmd (mermaid markdown) is supported in GitHub Readme !
it's unfortunatly not supported by Docusaurus :(
Example
And here is the associated code, that you can copy paste and easily edit!
---
config:
layout: elk
theme: mc
look: classic
---
classDiagram
direction LR
namespace HylozoaCompany2077 {
class Employee {
+int employeeId
+String position
+double salary
+work(hours: int) : void
+requestLeave(days: int) : bool
}
class Report {
+String title
+Date generatedOn
+String content
+export(format: String) : bool
}
class Rulian {
+String specialty
+customMethod() : void
}
class Person:::someclass {
lol name
+int age
+String address
+greet() : void
+updateAddress(newAddress: String) : void
}
}
Person --> Employee
Employee o.. "entrypoint" Report : draft
Person <-- Rulian
classDef someclass fill:#f9f,stroke:#333,stroke-width:4px;