Draw, chart and show
5 Draw, chart and show
Some facts are shapes: how data flows through the server, how throughput grew
from one release to the next, what the dashboard looks like. OINK draws them
from text you keep in the page, a few lines of Mermaid, an ECharts option
block, a TeX formula, so a change shows up in review as a readable diff and
search finds the words inside. This chapter illustrates the Starter’s
Architecture page, content/docs/introduction/architecture.md, and the
Overview beside it.
A diagram from text
Name a fence mermaid and write the diagram. This one shows how a write
reaches disk and how a query finds it:
flowchart LR
client["Clients"] -->|HTTP write| api["Ingest API"]
api --> wal[("Write-ahead log")]
api --> mem["Memtable"]
mem -->|flush| parts[("Monthly partitions")]
sql["SQL client"] --> engine["Query engine"]
engine --> mem
engine --> partsThere is nothing to configure. The Mermaid engine ships with the theme and runs
in the reader’s browser, and only pages with a mermaid fence load it. A
corner button opens each diagram in a viewer where readers can pan and zoom.
Mermaid
covers sequence diagrams, Gantt charts and the rest.
A chart from data
A benchmark is a table of numbers that readers understand faster as bars. An
echarts fence holds an ECharts option object in YAML, so the numbers stay in
your Markdown:
tooltip:
trigger: axis
xAxis:
type: category
data: ['2.0', '2.4', '3.0']
yAxis:
type: value
name: million points/s
series:
- name: ingest rate, 8 cores
type: bar
data: [1.2, 1.9, 3.4]Hugo checks the options while it builds and warns with the line number if they do not parse, and the chart follows light and dark mode. ECharts shows line, pie and combined charts.
A formula
Readers sizing a server want the arithmetic. Formulas are TeX, rendered to
HTML and MathML by KaTeX while the site builds, but the $$ and \(…\)
delimiters need Goldmark’s passthrough extension, which the Starter does not
turn on. Add it to the markup block of hugo.yaml; Hugo does not inherit
markup settings from a theme, so OINK cannot do this for you:
Keep the existing renderer, parser and highlight keys beside it. Then
write the estimate:
Disk use over a retention period is roughly:
for series written times per second for seconds, with bytes per raw point and a compression ratio , typically about 10.
A single $ is deliberately not a delimiter, so “$5” in prose stays a price.
Chapter 7 numbers a formula like this one.
Screenshots with captions
A screenshot that only one page uses belongs beside that page. Turn the page
into a page bundle: move architecture.md to architecture/index.md and put
the image in the same directory. The address does not change.
A page bundle
- content/docs/introduction/
- architecture/
- index.md
- index.zh.md
- dashboard.webpshared by both languages
- architecture/
Write the image as ordinary Markdown in a paragraph of its own and add one attribute line under it, touching it, for the caption:
Here is the same pattern with an image from this site:

The theme writes the image’s size into the page so the text does not jump while
it loads. Set params.ui.image_zoom: true in hugo.yaml and readers can click
an image to open it full size. To compare screens side by side, write one image
per line in a gallery fence:

Light mode

Dark mode
A terminal recording
An installation is easier to follow when watched, and an
asciinema recording keeps the output as text, so
readers can pause it and copy a command. Put the .cast file under static/
and name it in the shortcode:
Single-node install — /images/install.cast
This recording is a real six-minute installation of
Pigsty on Debian, about 196 KB. Record your own with
asciinema rec install.cast. The player ships with the theme and follows the
site’s light and dark palette.
Milestones on a timeline
The Overview page tells the project’s history. A definition list with
{.timeline} under it lays the events along a line, each beside its marker:
- 2024-03
- Acme DB 1.0. A single-node server with SQL queries.
- 2025-02
- Acme DB 2.0. Monthly partitions and retention policies.
- 2026-10
- Acme DB 3.0. Tiered storage and three times the ingest rate.
Keep a blank line between entries and none before {.timeline}; the build
warns when the attribute line has come loose.
Video, audio and more
Each of these has its own page with examples, when your content calls for it:
- Video — A product demo as an MP4 beside the page, or a YouTube card that loads nothing until clicked.
- Audio — A podcast episode or a pronunciation sample with the browser’s own player.
- Draw.io — Diagrams you edit in diagrams.net and keep as SVG.
- PlantUML — UML diagrams rendered in the browser by a bundled engine.
- Markmap — A Markdown outline drawn as a mind map.
- Maps — Points on a map, once you name a tile service.
What loads, and from where
Every engine in this chapter, Mermaid, ECharts, KaTeX’s styles, the asciinema player, is part of the theme, and a page loads only what its own content uses: a page with one chart and no diagram downloads ECharts and not Mermaid. Nothing contacts another server unless you configure it to. A map waits for a tile service you name, and a YouTube card connects to YouTube only when the site allows it and the reader clicks.
Check your work
- The Architecture page shows the data-flow diagram and the benchmark chart, and both switch with light and dark mode.
- The formula renders after the passthrough block is in
hugo.yaml; before it,$$shows as text. - The screenshot sits in the page bundle, shows its caption, and opens full size when zoom is on.
- The Overview shows three releases on a timeline.