{"$schema":"https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json","id":"generators-json-all","path":"/generators/json-all","type":"module","module":"generators-json-all","title":"JSON bundle","introducedIn":null,"sourceLink":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"The `json-all` generator writes every document of the\n[`json` generator](https://doc-kit.nodejs.org/generators/json) into a single\n`all.json`, for tools that would rather load your whole API from one file.","summary":"The `json-all` generator writes every document of the `json` generator into a single `all.json`, for tools that would rather load your whole API from one file.","examples":[],"children":[{"kind":"section","id":"usage","name":"Usage","title":"Usage","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"```bash\nnpx @doc-kit/cli generate -t json-all -i \"doc/api/*.md\" -o out --index doc/api/index.md\n```\n\nThis writes `out/all.json`. `json` runs first without being listed, and writes\nits own files to the same directory. To leave those out, see\n[Writing only the bundle](#writing-only-the-bundle).","summary":"This writes `out/all.json`. `json` runs first without being listed, and writes its own files to the same directory. To leave those out, see Writing only the bundle.","examples":[{"language":"bash","displayName":null,"code":"npx @doc-kit/cli generate -t json-all -i \"doc/api/*.md\" -o out --index doc/api/index.md"}],"children":[]},{"kind":"section","id":"configuring","name":"Configuring","title":"Configuring","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"* `schemaURL` {string} URL template for the bundle's `$schema`.\n  `{schemaVersion}` is the schema's version. The documents inside keep the\n  `$schema` from `json.schemaURL`. **Default:**\n  `'https://doc-kit.nodejs.org/schemas/api-doc-all/{schemaVersion}.json'`.\n\nIt also reads the\n[global options](https://doc-kit.nodejs.org/configuration#global-options)\n`output`, `minify` and `index`, which sets the\n[document order](#document-order). The documents themselves come from `json`,\nso the options that shape them, such as `repository` and `ref`, go in the\n`json` section or in `global` (see\n[JSON](https://doc-kit.nodejs.org/generators/json#configuring)).","summary":"It also reads the global options `output`, `minify` and `index`, which sets the document order. The documents themselves come from `json`, so the options that shape them, such as `repository` and `ref`, go in the `json` section or in `global` (see JSON).","examples":[],"children":[]},{"kind":"section","id":"what-the-bundle-holds","name":"What the bundle holds","title":"What the bundle holds","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"```json displayName=\"out/all.json\"\n{\n  \"$schema\": \"https://doc-kit.nodejs.org/schemas/api-doc-all/1.0.1.json\",\n  \"documents\": [\n    {\n      \"$schema\": \"https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json\",\n      \"id\": \"getting-started\",\n      \"path\": \"/getting-started\",\n      \"type\": \"module\",\n      \"module\": \"getting-started\",\n      \"title\": \"Getting started\",\n      \"introducedIn\": null,\n      \"sourceLink\": null,\n      \"stability\": null,\n      \"added\": [],\n      \"deprecated\": [],\n      \"removed\": [],\n      \"napiVersion\": [],\n      \"changes\": [],\n      \"description\": \"Install the package, then run it.\",\n      \"summary\": \"Install the package, then run it.\",\n      \"examples\": [],\n      \"children\": []\n    }\n  ]\n}\n```\n\n* `$schema` {string} The URL of the schema the bundle conforms to, from\n  `schemaURL`. With the default, its file name is the schema version.\n* `documents` {Array} Every `json` document, exactly as `json` writes it to its\n  own file (see\n  [The document](https://doc-kit.nodejs.org/generators/json#the-document)), in\n  the [document order](#document-order).\n\nThe bundle's schema ships as `@doc-kit/core/generators/json-all/schema.json`\nand is published at the default `$schema` URL. For the documents, it refers to\nthe `json` schema of the same version.","summary":"The bundle's schema ships as `@doc-kit/core/generators/json-all/schema.json` and is published at the default `$schema` URL. For the documents, it refers to the `json` schema of the same version.","examples":[{"language":"json","displayName":"out/all.json","code":"{\n  \"$schema\": \"https://doc-kit.nodejs.org/schemas/api-doc-all/1.0.1.json\",\n  \"documents\": [\n    {\n      \"$schema\": \"https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json\",\n      \"id\": \"getting-started\",\n      \"path\": \"/getting-started\",\n      \"type\": \"module\",\n      \"module\": \"getting-started\",\n      \"title\": \"Getting started\",\n      \"introducedIn\": null,\n      \"sourceLink\": null,\n      \"stability\": null,\n      \"added\": [],\n      \"deprecated\": [],\n      \"removed\": [],\n      \"napiVersion\": [],\n      \"changes\": [],\n      \"description\": \"Install the package, then run it.\",\n      \"summary\": \"Install the package, then run it.\",\n      \"examples\": [],\n      \"children\": []\n    }\n  ]\n}"}],"children":[]},{"kind":"section","id":"document-order","name":"Document order","title":"Document order","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"Without an index, the documents are sorted by `id`. With one, the documents\nits links point to come first, in the order of the links, and the rest follow\nby `id`:\n\n```text displayName=\"docs/index.md\"\n# My library\n\n* [Getting started](getting-started.md)\n* [Configuration](configuration.md)\n```\n\n* A link places the document whose `id` is the link's target without `.md`:\n  `getting-started.md` matches the document of `docs/getting-started.md`.\n* `index.md` is a document too when your input matches it, ordered with the\n  rest. Leave it out with `--ignore docs/index.md`.","summary":"Without an index, the documents are sorted by `id`. With one, the documents its links point to come first, in the order of the links, and the rest follow by `id`:","examples":[{"language":"text","displayName":"docs/index.md","code":"# My library\n\n* [Getting started](getting-started.md)\n* [Configuration](configuration.md)"}],"children":[]},{"kind":"section","id":"writing-only-the-bundle","name":"Writing only the bundle","title":"Writing only the bundle","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"`json` writes its documents to its own `output`, which is `global.output`\nunless you set one under `json`. To write `all.json` alone, set it to `null`;\n`-o out` still sets where the bundle goes:\n\n```js displayName=\"doc-kit.config.mjs\"\nexport default {\n  json: {\n    output: null,\n  },\n};\n```\n\n> \\[!NOTE]\n> A source file named `all.md` at the top of your input becomes `all.json` as\n> well, and the bundle overwrites it. To keep both, give the bundle a directory\n> of its own with `json-all.output`, such as `'out/bundle'`.","summary":"`json` writes its documents to its own `output`, which is `global.output` unless you set one under `json`. To write `all.json` alone, set it to `null`; `-o out` still sets where the bundle goes:","examples":[{"language":"js","displayName":"doc-kit.config.mjs","code":"export default {\n  json: {\n    output: null,\n  },\n};"}],"children":[]}]}