Skip to main content

Overview

The Simple JSON generator creates a simplified JSON representation of the API documentation. This generator is designed for debugging and testing purposes rather than production use.
This generator produces a single consolidated JSON file with all API documentation, making it ideal for debugging but not suitable for production deployment.

Metadata

name
string
default:"json-simple"
Generator identifier
version
string
default:"1.0.0"
Generator version
dependsOn
string
default:"metadata"
Requires metadata generator output as input

Configuration

output
string
Output directory path for the generated JSON file
minify
boolean
default:"false"
Enable JSON minification (removes whitespace and indentation)

Output Format

The generator produces:
  • Single file: api-docs.json containing all API documentation
  • Format: Array of simplified metadata entries
  • Indentation: 2 spaces (unless minified)

Usage

doc-kit -t json-simple
With minification:
doc-kit -t json-simple --config.json-simple.minify=true

Dependency Chain

ast → metadata → json-simple
The simple JSON generator depends on:
  1. ast - Parses Markdown to AST
  2. metadata - Extracts API metadata
  3. json-simple - Converts to simplified JSON

Implementation Details

The generator:
  • Deep clones content nodes to avoid affecting upstream nodes
  • Removes redundant nodes using unist-util-remove:
    • Stability nodes (already in metadata)
    • Heading nodes (already represented in metadata)
  • Maps input to simplified structure
  • Writes consolidated output to api-docs.json

Content Cleaning

The generator removes:
  • Stability indicators: Already captured in entry metadata
  • Headings: Already represented in the heading structure
This produces cleaner JSON focused on actual content rather than duplicated metadata.
The full JSON generator (in development) will create one JSON file per top-level API doc file. Use that generator for production deployments.
Source: src/generators/json-simple/

Build docs developers (and LLMs) love