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.
npx @doc-kit/cli generate -t json-all -i "doc/api/*.md" -o out --index doc/api/index.md
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.
string$schema.
{schemaVersion} is the schema's version. The documents inside keep the
$schema from json.schemaURL. Default:
'https://doc-kit.nodejs.org/schemas/api-doc-all/{schemaVersion}.json'.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).
{ "$schema": "https://doc-kit.nodejs.org/schemas/api-doc-all/1.0.1.json", "documents": [ { "$schema": "https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json", "id": "getting-started", "path": "/getting-started", "type": "module", "module": "getting-started", "title": "Getting started", "introducedIn": null, "sourceLink": null, "stability": null, "added": [], "deprecated": [], "removed": [], "napiVersion": [], "changes": [], "description": "Install the package, then run it.", "summary": "Install the package, then run it.", "examples": [], "children": [] } ] }
stringschemaURL. With the default, its file name is the schema version.Arrayjson document, exactly as json writes it to its
own file (see
The document), in
the document order.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.
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:
# My library * [Getting started](getting-started.md) * [Configuration](configuration.md)
- A link places the document whose
idis the link's target without.md:getting-started.mdmatches the document ofdocs/getting-started.md. index.mdis a document too when your input matches it, ordered with the rest. Leave it out with--ignore docs/index.md.
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:
export default { json: { output: null, }, };
A source file named all.md at the top of your input becomes all.json as
well, and the bundle overwrites it. To keep both, give the bundle a directory
of its own with json-all.output, such as 'out/bundle'.