{
  "type": "module",
  "source": "doc/api/writing-docs.md",
  "modules": [
    {
      "textRaw": "Writing documentation",
      "name": "writing_documentation",
      "type": "module",
      "desc": "<p><code>doc-kit</code> reads GitHub Flavored Markdown, so everything you already know\napplies. On top of it, a handful of conventions get special treatment.</p>",
      "modules": [
        {
          "textRaw": "The smallest document",
          "name": "the_smallest_document",
          "type": "module",
          "desc": "<pre><code class=\"language-markdown\"># hello\n\nA one-line description of the module.\n</code></pre>\n<p>The level-one heading is the page's identity: it becomes the sidebar label\nand the output filename. Every file needs exactly one, at the top.</p>",
          "displayName": "The smallest document"
        },
        {
          "textRaw": "Where this departs from plain Markdown",
          "name": "where_this_departs_from_plain_markdown",
          "type": "module",
          "desc": "<ul>\n<li><code>{curly braces}</code> in prose and lists are <a href=\"#types-that-link-themselves\">type annotations</a>,\nnot literal text.</li>\n<li>Blockquotes beginning with <code>Stability:</code> are <a href=\"#stability\">stability indicators</a>.</li>\n<li>HTML comments beginning with <code>YAML</code> (and <code>key=value</code> comments) are\n<a href=\"#recording-history\">metadata</a>, not ignored text.</li>\n</ul>\n<p>Everything else is standard GFM.</p>",
          "displayName": "Where this departs from plain Markdown"
        },
        {
          "textRaw": "Documenting an API",
          "name": "documenting_an_api",
          "type": "module",
          "desc": "<p>Each heading below the title starts an <em>entry</em>. Write the heading the way\nAPI docs are conventionally written, and <code>doc-kit</code> classifies it — no\nannotation needed:</p>\n<pre><code class=\"language-markdown\">## Class: `http.Server`\n\n### `new Agent([options])`\n\n### `server.listen(port[, callback])`\n\n### `server.maxHeadersCount`\n\n### Static method: `Buffer.from(string[, encoding])`\n\n### Event: `'close'`\n</code></pre>\n<p>Parentheses make a method; their absence makes a property; <code>Class:</code>,\n<code>Static method:</code>, and <code>Event:</code> prefixes mark those kinds; <code>new X()</code> marks a\nconstructor. Optional parameters go in square brackets — <code>[, callback]</code> —\nnesting where needed: <code>buf.write(string[, offset[, length]])</code>.</p>\n<p>Headings that match none of these patterns (like <code>## Synopsis</code>) are ordinary\nsections, which is exactly right for prose. Wrap identifiers in backticks;\nleave prose headings unwrapped.</p>",
          "displayName": "Documenting an API"
        },
        {
          "textRaw": "Parameters and return values",
          "name": "parameters_and_return_values",
          "type": "module",
          "desc": "<p>Directly under an entry's heading, an unordered list describes its\nparameters. Each item is a name, a type in braces, and prose:</p>\n<pre><code class=\"language-markdown\">### `fs.readFile(path[, options], callback)`\n\n- `path` {string|URL} The file to read.\n- `options` {Object}\n  - `encoding` {string} **Default:** `'utf8'`.\n  - `signal` {AbortSignal} Allows aborting the read.\n- `callback` {Function}\n- Returns: {Promise} Fulfills with the file contents.\n</code></pre>\n<ul>\n<li>Nested lists document the properties of an object parameter, to any depth.</li>\n<li><code>**Default:** `value`</code> marks a parameter optional and records its\ndefault.</li>\n<li><code>Returns:</code> describes the return value; <code>Extends:</code> names a class's\nsuperclass; <code>Type:</code> gives a property's type.</li>\n</ul>\n<p>The list is lifted out of the prose and becomes structured data — rendered\nas parameter tables in HTML, fields in JSON, and so on.</p>",
          "displayName": "Parameters and return values"
        },
        {
          "textRaw": "Types that link themselves",
          "name": "types_that_link_themselves",
          "type": "module",
          "desc": "<p>Anything in <code>{braces}</code> — in a list or mid-prose — is a TypeScript type\nexpression, rendered as code with each type name resolved to a link:</p>\n<pre><code class=\"language-markdown\">- `data` {string|Buffer} The payload.\n\nOn success, returns a {Promise} that fulfills with a {stream.Readable}.\n</code></pre>\n<p>Names resolve in tiers: your configured type map first, then JavaScript\nbuilt-ins, then Web APIs on MDN, and finally <code>module.Name</code> patterns link to\nthe matching page in your own docs. A name nothing recognizes stays plain\ntext — that's fine, not an error.</p>",
          "displayName": "Types that link themselves"
        },
        {
          "textRaw": "Recording history",
          "name": "recording_history",
          "type": "module",
          "desc": "<p>An HTML comment holding YAML, placed right after a heading, records an\nentry's life story:</p>\n<pre><code class=\"language-markdown\">### `hello.greet(name)`\n\n&#x3C;!-- YAML\nadded: v1.2.0\nchanges:\n  - version: v2.0.0\n    pr-url: https://github.com/me/hello/pull/42\n    description: Invalid names now throw instead of returning `null`.\n-->\n</code></pre>\n<p><code>added</code>, <code>deprecated</code>, and <code>removed</code> take a version (or an array of versions,\nfor backports); <code>changes</code> is a chronological list of notable changes with\ntheir pull requests. The HTML generator renders this as a version-history\nwidget; JSON consumers get it as data.</p>",
          "displayName": "Recording history"
        },
        {
          "textRaw": "Stability",
          "name": "stability",
          "type": "module",
          "desc": "<p>A blockquote in the exact form below marks an entry's lifecycle stage —\n<code>0</code> (deprecated), <code>1</code> (experimental, with optional <code>1.0</code>/<code>1.1</code>/<code>1.2</code>\nsub-levels), <code>2</code> (stable), or <code>3</code> (legacy):</p>\n<pre><code class=\"language-markdown\">### `hello.shout(name)`\n\n> [Stability: 1](documentation.html#stability-index) - Experimental. May change without notice.\n</code></pre>\n<p>Place it after the YAML comment (if any) and before the parameter list. On\nthe title heading, it applies to the whole page.</p>",
          "displayName": "Stability"
        },
        {
          "textRaw": "Code samples",
          "name": "code_samples",
          "type": "module",
          "desc": "<p>Use fenced code blocks with a language identifier. An optional <code>displayName</code>\nlabels the block in rendered output:</p>\n<pre><code class=\"language-markdown\">```js displayName=\"Reading a file\"\nconst data = await fs.readFile('/path/to/file');\n```\n</code></pre>",
          "displayName": "Code samples"
        },
        {
          "textRaw": "Linking between pages",
          "name": "linking_between_pages",
          "type": "module",
          "desc": "<p>Link to other documents by their source filename — the <code>.md</code> extension is\nrewritten to the right output extension at build time:</p>\n<pre><code class=\"language-markdown\">See [`hello.greet()`][] for the simple form.\n\n[`hello.greet()`]: hello.md#hellogreetname\n</code></pre>\n<p>Reference-style links with the definitions collected at the bottom of the\nfile keep prose readable. References to system calls like <code>open(2)</code> link to\ntheir man pages automatically.</p>",
          "displayName": "Linking between pages"
        },
        {
          "textRaw": "Pages that aren't API reference",
          "name": "pages_that_aren't_api_reference",
          "type": "module",
          "desc": "<p>Guides and tutorials need nothing special, most of the time. Headings that\nmatch none of the patterns above stay ordinary sections.</p>\n<p>The exception is a page whose headings <em>do</em> look like signatures but aren't\nmodule exports. A <code>type</code> directive under the title reclassifies the whole\ndocument, so those entries render as conceptual sections instead:</p>\n<pre><code class=\"language-markdown\"># C++ addons\n\n&#x3C;!--type=misc-->\n</code></pre>\n<p>Frontmatter (<code>---</code>-delimited YAML) at the top of a file is also accepted and\ntreated as metadata. And if a page needs real components — heroes, tabs, live\nexamples — name it <code>.mdx</code> and use JSX directly; see\n<a href=\"./customization.html#custom-components-and-mdx\">Customizing the site</a>.</p>",
          "displayName": "Pages that aren't API reference"
        },
        {
          "textRaw": "The full contract",
          "name": "the_full_contract",
          "type": "module",
          "desc": "<p>This page covers what most documents use, but a full\n<a href=\"./specification.html\">specification</a> is also available.</p>",
          "displayName": "The full contract"
        }
      ],
      "displayName": "Writing documentation"
    }
  ]
}