Skip to main content

Stop writing docs in Markdown. Write compact DSL, get polished HTML with charts, diagrams, and more.

Project description

minidoc

Stop writing documentation in Markdown. Write it once, render it beautifully.

A compact DSL that compiles to polished, self-contained HTML — with charts, diagrams, tabs, metrics, and syntax highlighting. Write the same amount, get dramatically more.

PyPI Python License: MIT

English · 中文

→ Live examples


The problem with Markdown documentation

Markdown is everywhere — READMEs, wikis, design docs, postmortems. It's easy to write, but hard to read at scale. By the time a document has tables, code blocks, and a system diagram, it's a wall of symbols that no one wants to open.

minidoc was built to fix that. Write a compact DSL (or have an LLM write it), get back a self-contained HTML file with real charts, interactive tabs, Mermaid diagrams, and a clean visual layout. The kind of document people actually open.

Real benchmark: URL shortener system design

We compiled the same system design document in both Markdown and minidoc DSL and measured the result.

Markdown minidoc DSL
Input size to write 3,908 tokens 4,598 tokens (~same effort)
Output Flat text + tables Interactive HTML, 13,394 tokens of rendered output
Charts ❌ not supported ✅ Chart.js — bar, line, pie, doughnut
Architecture diagrams ❌ not supported ✅ Mermaid — flowchart, sequence, ER
Tabs / accordions ❌ not supported ✅ built-in
KPI / metric cards ❌ not supported ✅ built-in
Syntax highlighting Basic (renderer-dependent) ✅ highlight.js, github-dark
Shareable Needs a Markdown renderer ✅ Open in any browser, no tools needed

You write roughly the same amount. minidoc compiles it into something Markdown never could.

Source: benchmark/url_shortener/ — minidoc DSL vs Markdown, measured with tiktoken (cl100k_base).


Quick start

pip install minidoc

Create report.minidoc:

@doc title="Q3 Report" theme=light

# Q3 Business Review

[columns]
[col][metric label="MRR" value="$48K" trend=+12% color=green][/col]
[col][metric label="Churn" value="2.1%" trend=-0.4% color=blue][/col]
[col][metric label="NPS" value="61" trend=+8 color=purple][/col]
[/columns]

[chart type=bar title="Monthly Revenue"
  Jan=38 Feb=41 Mar=44 Apr=46 May=48
]

[table cols="Initiative,Owner,Status"
  Mobile redesign | Design team | ✅ Done
  API v2          | Backend     | 🔄 In progress
  SOC 2           | Security    | 📋 Planned
]

Compile:

minidoc report.minidoc -o report.html

Open report.html in any browser. No internet required after compile.


Features

  • Token-efficient — the entire DSL reference fits in a single system prompt
  • LLM-reliable — constrained syntax means fewer hallucinations and malformed output
  • Zero runtime — compiled HTML is fully self-contained; share it as an email attachment or static file
  • Rich component library — metrics, KPIs, charts, tables, diagrams, code blocks, timelines, tabs, accordions
  • MCP server — native integration with Claude and any MCP-compatible agent
  • Dark modetheme=dark via Pico CSS CSS variables
  • Mermaid diagrams — flowchart, sequence, ER, Gantt — all declarative
  • Syntax highlighting — 100+ languages via highlight.js

Usage

CLI

# Compile a file
minidoc report.minidoc -o output.html

# Read from stdin
echo '@doc title="Hello" theme=light
# Hello World' | minidoc -o hello.html

Python API

from minidoc import compile_to_html

dsl = """
@doc title="My Report" theme=light
# Hello
[metric label="Users" value="1,240" color=blue]
"""

html = compile_to_html(dsl)
with open("report.html", "w") as f:
    f.write(html)

MCP server (for Claude and LLM agents)

Start the server:

uv run python mcp/server.py

Add to .mcp.json (or Claude Code settings):

{
  "mcpServers": {
    "minidoc": {
      "type": "stdio",
      "command": "uvx",
      "args": ["minidoc-mcp"]
    }
  }
}

Available tools:

Tool Description
render_and_open(dsl, name?) Compile DSL, save to result/, open in browser
render_minidoc(dsl, name?) Compile and save, return file path

Available prompts:

Prompt Description
minidoc_guide Loads the full DSL reference into the model context

Recommended workflow in Claude:

  1. Start with the minidoc_guide prompt to load the DSL reference
  2. Ask Claude to generate a report
  3. Claude calls render_and_open — the result opens in your browser instantly

DSL reference

Document header

@doc title="Title" theme=light

theme: light (default) · dark

Text

# H1  /  ## H2  /  ### H3
> blockquote
paragraph text with **bold**, *italic*, `code`, [link](url)
[divider]

Metrics

[metric label="ARR" value="$4.8M" trend=+18% color=green]
[kpi label="ARR" value="$4.8M" target="$5.0M" trend=+18% color=green]
[progress label="Q3 Goal" value=72 color=green target="$2.2M"]
[badge text="On Track" color=green]

Data

[table cols="Name,Stage,Value"
  Acme   | Negotiation | $120k
  Globex | Proposal    | $85k
]

[chart type=bar title="Revenue"
  Jan=40 Feb=55 Mar=72
]

Content blocks

[alert type=info text="Message here."]
[callout icon=💡 title="Insight" text="Detail here." color=blue]

[code lang=python title="app.py"
def hello():
    return "world"
]

[diagram
flowchart TD
    A[Client] --> B[API] --> C[(Database)]
]

[image src="https://..." alt="..." caption="Figure 1" width=800]

Layout

[columns]
[col][metric label="MRR" value="$700K"][/col]
[col][metric label="NRR" value="118%"][/col]
[/columns]

[section title="Title" style=card]
content here
[/section]

[tabs]
[tab title="Overview"] ... [/tab]
[tab title="Details"]  ... [/tab]
[/tabs]

[accordion title="Show more"] ... [/accordion]

Lists & timelines

[list style=check]
- Shipped feature A
- Fixed bug B
[/list]

[timeline color=blue]
- Q1: Launched MVP — 500 users
- Q2: Series A closed — $4M
[/timeline]

Colors: green red blue yellow purple gray
Alert types: info warning error success
Chart types: bar line pie doughnut
Code languages: python javascript typescript sql bash json yaml go rust
List styles: bullet numbered check


Example documents

# Compile any example
minidoc examples/netflix_architecture.minidoc -o result/out.html
File Description
netflix_architecture.minidoc System architecture with Mermaid diagram, layered tabs
q3_report.minidoc Executive business report with charts and KPIs
sales_pipeline.minidoc CRM-style pipeline dashboard
incident_postmortem.minidoc Engineering postmortem template
ml_experiment.minidoc ML experiment tracking
board_report_q3.minidoc Investor-ready board deck
url_shortener_system_design.minidoc System design document

Frontend stack

Compiled HTML files load all dependencies from CDN — no bundler, no build step, no Node.js.

Layer Library
CSS Pico CSS v2 — classless, CSS-variable theming
Charts Chart.js
Diagrams Mermaid.js v11
Syntax highlight highlight.js — github-dark theme

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minidoc_dsl-0.1.1.tar.gz (129.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minidoc_dsl-0.1.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file minidoc_dsl-0.1.1.tar.gz.

File metadata

  • Download URL: minidoc_dsl-0.1.1.tar.gz
  • Upload date:
  • Size: 129.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for minidoc_dsl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 594b9d50ffd2b81776c1ef4fc97085e920e16b9b50cd1b731d935c21ebacd367
MD5 f1581397b1e70f6f5b513e455f1466a5
BLAKE2b-256 84b990e2bfb29120c37e7f0bae92cac0baaa7b0d39aebc130fa16be49b5b4673

See more details on using hashes here.

Provenance

The following attestation bundles were made for minidoc_dsl-0.1.1.tar.gz:

Publisher: publish.yml on shalayiding/minidoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minidoc_dsl-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: minidoc_dsl-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for minidoc_dsl-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3f5c37fb8829150265718c6ab8805954fc41a1639d213ffdff6b3e1635540eb
MD5 9b6bd540a3d47a1a8b4ae2bed57ce571
BLAKE2b-256 8a3cdefbef28181421dcb876a3ebc8c5f67b9afc0a1a3ffd074c0f6268427020

See more details on using hashes here.

Provenance

The following attestation bundles were made for minidoc_dsl-0.1.1-py3-none-any.whl:

Publisher: publish.yml on shalayiding/minidoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page