DIM · Dagon Inference Marketplace

Docs house style

Every page answers one question, and its first paragraph is the answer. Write that paragraph so it stands alone in a search result or an answer engine, then use the rest of the page to show how and why, with a worked example, links to the glossary, and a Related list at the end.

Files and front matter

A page is one markdown file at docs/site/<section>/<NN>-<slug>.md. Its public path is /docs/<section>/<slug>.

Part Rule
section One of concepts, buyers, sellers, verifiers, protocol
NN Reading order inside the section, lowest first
slug Lowercase words joined by hyphens; it is the page's address, so never rename a published one

The file starts with front matter:

---
title: Open a channel
description: One answer-first sentence of at most 160 characters, used for search results and answer engines.
order: 20
---

title and description are required. order is optional and overrides NN. The page title is printed as the page heading, so the body never starts with a # Title line.

Check every page and link before you push:

bun apps/marketplace-ui/src/features/docs/docs-index.ts

Answer first

  • The first paragraph restates the description as a complete answer, in two to four sentences. It is shown larger than the rest of the page.
  • Lead with the outcome ("A Mandate limits what an agent can spend"), not the history or the motivation.
  • Plain, specific, protocol-true. One caveat per section at most.

One idea per page

A page that needs two answers is two pages. Split long procedures into steps on one page; split separate questions into separate pages and link them.

Show an example

Every page shows the idea working: a request and its response, a command and its output, or a worked number. Use real field names, headers and paths from the repository, and label synthetic values as synthetic.

Headings and anchors

  • ## for sections and ### for subsections. Both appear in "On this page" and in search.
  • Each heading gets an anchor: its text in lowercase, without punctuation, spaces joined by hyphens. ## Close a channel becomes #close-a-channel. A repeated heading gets -2, -3.
  • Keep headings short and unique on the page; a heading is a link target other pages depend on.
  • Link other pages by public path: [Mandates](/docs/concepts/mandates), or a section of a page: [closing](/docs/buyers/closing-channels#close-a-channel).
  • Link the first use of a defined term on each page to its glossary entry, for example [voucher](/docs/concepts/glossary#voucher).
  • A relative link to another repository file, such as ../../mvp/protocol-contract.md, opens it on GitHub, or in the docs when it is published here.
  • The check command fails on a link to a page or anchor that does not exist.

Code, tables and callouts

  • Fence code with its language (ts, sh, json, http, …). The language is shown above the block, next to a Copy button.
  • Tables scroll sideways on small screens; keep cells short.
  • Callouts use GitHub's alert syntax, one per section at most:
> [!NOTE]
> A Mandate never widens its parent's limits.

renders as:

[!NOTE] A callout of kind NOTE, TIP, IMPORTANT, WARNING or CAUTION, with its kind as the label.

  • HTML comments are dropped: use them for notes to authors, such as the sources line under the front matter. <sub>, <sup>, <kbd> and <br> render when written without attributes; any other raw HTML is shown as text, never rendered.

Truth

  • docs/mvp/protocol-contract.md is normative. docs/architecture/, docs/decisions/ and the code in packages/, services/, crates/ and programs/ back everything else.
  • Cite the files a page is written from in a comment under the front matter: ``.
  • Never invent an API, a number or a guarantee. When the code and a document disagree, document what the code does and raise the gap.

End every page with a ## Related list of two to five links, each with a short reason to follow it.