---
title: Markdown that renders everything
slug: primitives-showcase
order: 20
type: doc
description: Code, Mermaid and draw.io diagrams, tabs, callouts, and rich media — every content primitive, rendered beautifully on one page.
seoTitle: Markdown docs with draw.io & Mermaid diagrams, code and media
seoDescription: Markdown-based documentation that renders syntax-highlighted code, Mermaid and draw.io diagrams, tabs, callouts, and embedded media natively — with a built-in draw.io editor that runs offline.
llmSummary: "Live showcase of every Markdown content primitive DSR Docs renders natively: headings, emphasis, lists, Shiki-highlighted code, GitHub-style alerts, tabs, GFM tables, zoomable images with editor-set sizing, self-hosted/YouTube/Vimeo/Loom video, an audio directive, Mermaid diagrams, allow-listed trusted iframe embeds, and horizontal rules. Drawn diagrams use a built-in draw.io editor vendored into the container and served from the site's own origin (CSP connect-src 'self', verified offline by a test); a diagram is stored as an SVG carrying its own draw.io source, so it renders as a plain image for readers, survives PDF/HTML export, print and search, and reopens for editing with no second copy. Confluence exports whose diagrams arrive as fenced drawio XML blocks are converted to those SVGs on import. Author once in plain Markdown plus a few natural extensions; it renders on your brand everywhere. Links out to the one-engine concept guide and the multi-spec use case."
visibility: public
copyright: © 2026 DSR Corporation
icon: Sparkles
faq:
  - q: What can DSR Docs render from plain Markdown?
    a: Syntax-highlighted code, GitHub-style alerts, tabbed examples, GFM tables, zoomable images with editor-set sizing, video and audio, Mermaid diagrams, allow-listed embeds, and the ordinary headings, lists and emphasis. You author Markdown plus a few natural extensions; the renderer does the rest, styled to your brand.
  - q: Does DSR Docs support Mermaid diagrams in documentation?
    a: Yes, natively. A Mermaid code fence renders as a live diagram on the page — flowcharts, sequence diagrams and the rest — with no external service and no image export step.
  - q: Can I embed video and audio in a documentation page?
    a: Yes. Self-hosted MP4, YouTube, Vimeo and Loom all embed from standard Markdown image syntax, and audio has its own directive that renders native player controls — because a narration clip is primary content, not a figure that happens to play sound.
  - q: Can I embed an external site or widget in the docs?
    a: Yes, but only from origins an admin has put on a trusted-origin allow-list. Anything else renders a blocked-embed warning instead of loading the URL, so an author cannot accidentally embed a malicious site.
  - q: Do I need MDX or custom React components?
    a: No. Everything on this page is plain Markdown with a handful of directives, so writers stay in Markdown and the output still carries your brand's colors, fonts and spacing.
  - q: Can I draw diagrams in DSR Docs, or only write them as code?
    a: Both. Mermaid renders diagrams written as code in a fenced block, and the draw.io editor is built in for diagrams you would rather draw with a mouse. A drawn diagram is saved as an SVG that carries its own source inside it, so it opens again for editing with no second file to keep in step.
  - q: Do draw.io diagrams work offline or in an air-gapped install?
    a: Yes. The editor is vendored into the container and served from your own origin, with hosted-product plugins and cloud-storage connectors stripped out and a Content-Security-Policy whose connect-src is 'self'. A test drives the real editor through a real diagram and fails on a single off-origin request, so the guarantee is checked rather than asserted.
  - q: Do diagrams from a Confluence export survive the migration?
    a: Yes. Confluence exports carry diagrams as fenced blocks of draw.io XML, which most tools show as raw markup. DSR Docs converts them once on import, using the same editor that draws them, so they arrive as pictures that still open for editing.
---

# Markdown that renders everything

DSR Docs is Markdown-based documentation, so plain Markdown goes in. What comes out is syntax-highlighted code, live diagrams, tabbed examples, callouts, zoomable images, embedded video and audio — all styled to your brand, all on this one page. This isn't a feature list; it's the renderer running. Scroll through and see for yourself.

## Headings

Standard Markdown headings — `#` through `######`. They build the in-page Table of Contents on the right rail. Anchor links are emitted for each.

```markdown
## Section heading
### Subsection
#### Smaller subsection
```

## Paragraphs and inline emphasis

Just write text. **Bold**, *italic*, ~~strikethrough~~, `inline code`, and [external links](https://example.com) all work via standard Markdown.

```markdown
**Bold**, *italic*, ~~strikethrough~~, `inline code`, [link](https://example.com).
```

## Lists

Unordered, ordered, and nested — all standard CommonMark.

* First bullet
* Second bullet
  * Nested item
  * Another nested item
* Third bullet

1. Ordered item
2. Another ordered item
3. And one more

## Code blocks

Fenced code blocks with a language tag get syntax highlighting via Shiki. The header carries a language label and a copy-to-clipboard button.

```typescript
type PageEntry = {
  slug: string;
  title: string;
  order: number;
  type: "doc" | "api-operation" | "api-spec";
  description: string;
  path: string;
};

function firstPageOf(domain: DomainEntry): PageEntry | null {
  return [...domain.ungroupedPages, ...domain.groups.flatMap((g) => g.pages)][0] ?? null;
}
```

```python
from dataclasses import dataclass

@dataclass
class Page:
    slug: str
    title: str
    order: int = 999

pages = [Page(slug="intro", title="Introduction"), Page(slug="api", title="API")]
pages.sort(key=lambda p: p.order)
```

```bash
docker run -d \
  -p 8080:8080 \
  -v "$PWD/content:/data/content" \
  --name docs \
  registry.example.com/docs:latest
```

Source for the TypeScript block:

````markdown
```typescript
type PageEntry = { slug: string; title: string; order: number };
```
````

## Alerts (GitHub-flavored)

GitHub-style blockquote alerts cover the common callout patterns. Eight flavors, each with its own color and icon — pick the one that matches intent:

`NOTE` · `TIP` · `INFO` · `IMPORTANT` · `SUCCESS` · `WARNING` · `CAUTION` · `DANGER`.

> [!WARNING]
> Callouts carry intent at a glance. Use them sparingly — a page where everything shouts says nothing.

Source:

```markdown
> [!WARNING]
> Callouts carry intent at a glance. Use them sparingly.
```

Swap the keyword inside `[!…]` to change the flavor. Every flavor uses the same `> [!FOO]` syntax — no further markup needed.

## Tabs

For showing the same content across multiple variants — languages, package managers, OS — use the `:::tabs` directive. **Four colons** outer, **three colons** inner.

::::tabs
:::tab{label="cURL"}
```bash
curl -X POST https://api.example.com/v1/widgets \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"name": "demo"}'
```
:::

:::tab{label="JavaScript"}
```js
await fetch("https://api.example.com/v1/widgets", {
  method: "POST",
  headers: { Authorization: `Bearer ${token}` },
  body: JSON.stringify({ name: "demo" }),
});
```
:::

:::tab{label="Python"}
```python
import requests
requests.post(
    "https://api.example.com/v1/widgets",
    headers={"Authorization": f"Bearer {token}"},
    json={"name": "demo"},
)
```
:::
::::

Source:

````markdown
::::tabs
:::tab{label="cURL"}
```bash
curl …
```
:::

:::tab{label="JavaScript"}
```js
await fetch(…);
```
:::
::::
````

## Tables

Standard GFM tables. Pipes, headers, and alignment.

| HTTP method | Idempotent? | Used for                    |
| ----------- | :---------: | --------------------------- |
| GET         |     yes     | Retrieving a resource       |
| POST        |      no     | Creating, RPC-style actions |
| PUT         |     yes     | Replacing a resource        |
| PATCH       |      no     | Partial update              |
| DELETE      |     yes     | Removing a resource         |

## Images

Standard Markdown image syntax. The renderer wraps it in a clickable zoom overlay — click to see full-size with pan + keyboard shortcuts (`+`, `-`, `0`, arrow keys, `Esc`).

![ACME logo](/branding/acme-logo.svg)

```markdown
![ACME logo](/branding/acme-logo.svg)
```

### Sizing

The image dialog in the rich editor (Insert → Image, or click an existing image and pick **Edit**) has dedicated **Width** and **Height** fields. They get encoded into the Markdown title slot — so an image sized through the editor round-trips as plain CommonMark and stays editable from any text editor.

![Sized to 96 px in the editor](/branding/acme-logo.svg "96")

```markdown
![Sized to 96 px in the editor](/branding/acme-logo.svg "96")
![Hard cap 200×160](/branding/acme-logo.svg "200x160")
```

* **Width only** (`"96"`) — caps the rendered width; height scales proportionally.
* **Width × height** (`"200x160"`) — hard caps on both dimensions.
* Clearing both fields restores the natural size.
* The same `title` slot serves regular captions when it isn't a pixel count — a caption uses `"some text"`, a sized image uses `"320"` or `"320x240"`.

## Video

The `Media` component branches on URL: same syntax for self-hosted MP4, YouTube, Vimeo, and Loom. No separate directive.

### Self-hosted MP4

![A short demo clip](/demo/sample.mp4)

```markdown
![A short demo clip](/demo/sample.mp4)
```

### YouTube

Any `youtube.com/watch?v=...` or `youtu.be/...` URL renders through the privacy-enhanced `youtube-nocookie.com` embed.

![Big Buck Bunny — the open-movie short used as a standard test reel.](https://www.youtube.com/watch?v=aqz-KE-bpKQ)

### Vimeo

A standard `vimeo.com/<id>` URL becomes the `player.vimeo.com` embed.

![The Mountain — a time-lapse from Vimeo's staff-picks era.](https://vimeo.com/22439234)

### Loom

Loom share links resolve to the `loom.com/embed/...` endpoint automatically.

![A Loom walkthrough — share links are rewritten to the embed endpoint automatically.](https://www.loom.com/share/912e89a68ccc42c5ab5096fec7cd63d6)

## Audio

Audio has its own directive — `:::audio{}` — separate from `![alt](url)` because a podcast clip or narration is primary content, not a figure that happens to play sound. It renders as a native `<audio controls>` inside a hairline plate.

:::audio{src="/demo/DSRDocs.wav" title="DSR Docs — sample voiceover"}
:::

```markdown
:::audio{src="/demo/DSRDocs.wav" title="DSR Docs — sample voiceover"}
:::
```

Two attributes:

* **`src`** *(required)* — root-relative path or absolute URL. `.mp3`, `.m4a`, `.wav`, `.ogg`, `.opus` all work.
* **`title`** *(recommended)* — caption shown above the player. An unlabeled audio plate gives readers no context.

## Mermaid diagrams

Fenced code block with `mermaid` as the language. Rendered client-side.

```mermaid
flowchart LR
  W[Writer in /edit] -->|saves .md| FS[Content volume]
  E[Engineer in IDE] -->|git push| FS
  FS --> APP[docs-app container]
  APP --> READER[Reader]
```

```mermaid
sequenceDiagram
  participant U as User
  participant FE as docs-app
  participant DB as Audit log
  U->>FE: PUT /api/edit/pages/:file
  FE->>DB: append entry
  FE-->>U: ok + new mtime
```

```mermaid
gantt
    title Q3 release plan (example)
    dateFormat YYYY-MM
    section Backend
    Discovery           :done, 2026-01, 2M
    Implementation      :active, 2026-03, 2M
    QA + load testing   :2026-05, 2M
    section Frontend
    Design system       :2026-06, 1M
    Component rollout   :2026-08, 2M
```

Source:

````markdown
```mermaid
flowchart LR
  A[Step 1] --> B[Step 2]
```
````

## Drawn diagrams (draw.io)

Mermaid is for diagrams you would rather write than draw. When the diagram wants a mouse — an architecture map, a network layout, a floor plan — DSR Docs has the **draw.io editor built in**. Open it from the editor toolbar, draw, save, and the diagram lands on the page.

What it stores is the trick. A saved diagram is an ordinary **SVG that carries its own source inside it**, so:

* **Readers load a picture.** No editor, no renderer, no script on the reading path.
* **Everything downstream just works.** PDF export, HTML export, print and the search index need to learn nothing about diagrams, because there is nothing to learn — it is an image.
* **There is no second copy to keep in step.** Opening the picture in the editor reads the source back out of it, so the drawing and the file can never drift apart.

**Migrating from Confluence?** Pages exported from Confluence carry their diagrams as fenced blocks of draw.io XML, which most tools render as a wall of markup where a picture should be. DSR Docs converts them on the way in — once, with the same editor that draws them — so they arrive as pictures you can still open and edit.

The editor is **vendored and served from your own origin**: 19 MB of it ships inside the container, with the hosted-product plugins, integrations and cloud-storage connectors stripped out, under a Content-Security-Policy whose `connect-src` is `'self'`. That it never phones home is checked rather than claimed — a test drives the real editor through a real diagram and fails on a single off-origin request. Which is what makes it usable in an air-gapped network at all.

![Diagram](/content/_blobs/a5/a50da56d5c68632239166a438978da98c00a3eccc2122162d111613de19d65ba.svg)

> [!NOTE]
> draw.io and diagrams.net are trademarks of JGraph Ltd. DSR Corporation is not affiliated with, endorsed by, or sponsored by JGraph Ltd. The editor is redistributed under the Apache License 2.0 and named here only to identify the software DSR Docs embeds.

## Trusted embeds

`:::embed` mounts an `<iframe>`, but **only** for origins an admin has put on a trusted-origin allow-list. Anything else renders a "blocked embed" warning instead of loading the URL, so authors can't accidentally embed a malicious site. Safe by default, flexible when you need it.

:::embed{src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik" title="OpenStreetMap demo" height="320"}
:::

```markdown
:::embed{src="https://your-trusted-origin.example/widget" title="A widget" height="400"}
:::
```

## Horizontal rule

A `---` on its own line emits a horizontal rule. Useful for breaking long pages into reading sections.

***

That's one page. Everything above is plain Markdown plus a handful of natural extensions — write it once in text, and it renders like this, on your brand, everywhere. The same engine renders your API references natively alongside this prose: see [one engine, every API](/docs/guides/one-engine) for how OpenAPI, GraphQL, and Doxygen sit next to Markdown, or [document OpenAPI, GraphQL & C/C++ SDKs together](/docs/use-cases/document-openapi-graphql-and-cpp-sdks-together) for the multi-spec workflow.

> [!IMPORTANT]
> **Want this on your own documentation?** Write to docs@dsr-corporation.com. Ask about migration, licensing, or anything this page didn't cover.
