Skip to content

Latest commit

 

History

History
230 lines (163 loc) · 3.68 KB

examples.md

File metadata and controls

230 lines (163 loc) · 3.68 KB

Diagram examples

Each example shows its Mermaid source and rendered output. The source listing and diagram read the same file, so the text is directly reusable in a mermaid fence or directive. These examples exercise the bundled Pele renderer; they do not imply support for every Mermaid option.

For Sphinx authoring patterns, see reStructuredText examples and how to add diagrams. Styling recipes are in how to style diagrams.

Flowchart with frontmatter

Diagram frontmatter supplies a title, layout settings, font size, and a CSS variable.

---
language: text
---

Sequence diagram

A caption, named reference, accessible label, width, and zoom controls are attached by the Sphinx directive.

---
language: text
---
---
name: request-flow
caption: A **request** and response.
alt: Client requests a page from the server.
zoom: true
width: 75%
---

External file

The same UTF-8 file supplies the source listing and diagram. Sphinx tracks it as a build dependency.

---
language: text
---
---
caption: Loaded from a Mermaid document.
---

Pie chart

A chart with two labeled slices.

---
language: text
---

Class diagram

Classes, members, and a composition relationship.

---
language: text
---

Entity relationship diagram

A documentation collection with pages and embedded diagrams.

---
language: text
---

State diagram

Transitions through a review cycle, including a return to the draft state.

---
language: text
---

Gantt chart

Fixed dates and a disabled today marker keep this example stable across builds.

---
language: text
---

User journey

Scores describe how a reader experiences each part of a documentation task.

---
language: text
---

Git graph

A documentation branch merged back into main.

---
language: text
---

Mind map

A hierarchy of documentation topics.

---
language: text
---

Timeline

Milestones grouped by month.

---
language: text
---

Quadrant chart

Work items positioned by effort and reader impact.

---
language: text
---

Sankey diagram

Values represent reader traffic between documentation sections.

---
language: text
---

XY chart

Bars show completed examples over four weeks.

---
language: text
---

Requirement diagram

A test element verifies a rendering requirement.

---
language: text
---

The sequence figure can be referenced as {ref}request-flow.