← Back to all products
$10
API Docs Generator
Generate beautiful static HTML documentation from OpenAPI specs with dark theme and search.
PythonMarkdownJSON
Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
Interactive Reader (Free Preview) ⚙ Try Demo Tools Download Free SampleFile Structure 14 files
api-docs-generator/
├── LICENSE
├── README.md
├── examples/
│ └── sample_spec.json
├── free-sample.zip
├── guide/
│ ├── 01_api-docs-generator.md
│ ├── 02_features.md
│ └── 03_quick-start.md
├── index.html
├── interactive.html
├── src/
│ ├── __pycache__/
│ │ └── main.cpython-312.pyc
│ └── main.py
└── tests/
├── __pycache__/
│ └── test_main.cpython-312-pytest-9.0.2.pyc
└── test_main.py
Documentation Preview README excerpt
API Docs Generator
Generate beautiful static HTML documentation from OpenAPI specs. Single-file output with dark theme, search, and responsive design. Zero dependencies.
Part of the API Launchpad toolkit by [CodeVault](https://codevault.dev).
Features
- Single-file HTML output — host anywhere (S3, GitHub Pages, Netlify, Vercel)
- Dark theme with syntax-highlighted code blocks and amber accents
- Sidebar navigation with tag-based endpoint grouping
- Live search across endpoint names, paths, and descriptions
- Request/response examples auto-generated from schema definitions
- Parameter tables with type, location, required status, and description
- Responsive design — works on desktop and mobile
- Zero dependencies — runs on Python stdlib only
Quick Start
# Generate docs from an OpenAPI spec
python3 src/main.py --spec openapi.json --output docs.html
# Generate demo docs
python3 src/main.py --demo --output docs.html
# Print HTML to stdout
python3 src/main.py --demo
Then open docs.html in your browser.
Using as a Library
from main import generate_docs
import json
# Load your OpenAPI spec
with open("openapi.json") as f:
spec = json.load(f)
# Generate HTML documentation
html = generate_docs(spec, custom_css="""
/* Override brand color */
.logo { color: #00FF88; }
""")
# Save to file
with open("docs.html", "w") as f:
f.write(html)
What Gets Generated
The output HTML includes:
1. Header with API title, version, and description
2. Server list with base URLs
3. Sidebar navigation grouped by OpenAPI tags
... continues with setup instructions, usage examples, and more.
Code Sample .py preview
src/main.py
#!/usr/bin/env python3
"""
API Docs Generator — Beautiful Static HTML Docs from OpenAPI Specs
===================================================================
Transforms OpenAPI 3.0 specs into self-contained static HTML documentation.
Features a dark theme, syntax highlighting, endpoint explorer, search,
and responsive design. Output is a single HTML file.
Zero dependencies. Run as CLI.
Part of the API Launchpad toolkit by DataNest.
License: MIT
"""
from __future__ import annotations
import json
import logging
import re
from html import escape
from pathlib import Path
from typing import Any
# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
datefmt="%Y-%m-%dT%H:%M:%S",
)
logger = logging.getLogger("api-docs-gen")
# HTTP method colors for the documentation UI
METHOD_COLORS = {
"GET": "#61affe",
"POST": "#49cc90",
"PUT": "#fca130",
"DELETE": "#f93e3e",
"PATCH": "#50e3c2",
"HEAD": "#9012fe",
"OPTIONS": "#0d5aa7",
}
# ---------------------------------------------------------------------------
# OpenAPI Spec Parser
# ---------------------------------------------------------------------------
# ... 494 more lines ...