| name | api-doc-generator |
| description | Generate API documentation from code, OpenAPI specs, or raw endpoints. Supports Markdown, HTML, and interactive documentation. |
| triggers | ["generate api docs","API 文档生成","openapi documentation","swagger docs"] |
API Doc Generator
Generate beautiful API documentation from code or specs.
Features
- 📝 Multi-format — Markdown, HTML, PDF
- 🎨 Interactive — Try-it-out functionality
- 📊 OpenAPI — Generate from OpenAPI/Swagger
- 🔄 Auto-sync — Keep docs updated
- 🌐 Hosting — Deploy to GitHub Pages
Usage
From Code
hermes api-docs generate --framework fastapi --file main.py
hermes api-docs generate --framework express --dir ./src
hermes api-docs generate --framework gin --file main.go
From OpenAPI
hermes api-docs generate --spec openapi.yaml
hermes api-docs update --spec openapi.yaml --output ./docs
Generate Output
hermes api-docs generate --format markdown --output README.md
hermes api-docs generate --format html --output docs/
hermes api-docs generate --format stoplight --output docs/
Examples
FastAPI Project
hermes api-docs generate \
--framework fastapi \
--file app/main.py \
--title "My API" \
--version 1.0.0 \
--output docs/
From OpenAPI 3.0
hermes api-docs generate \
--spec api.yaml \
--theme redoc \
--output docs/
Output Formats
| Format | Use Case | Interactive |
|---|
| Markdown | GitHub README | ❌ |
| HTML/Redoc | Self-hosted docs | ✅ |
| HTML/Swagger | Swagger UI | ✅ |
| Slate | Stripe-style docs | ✅ |
| PDF | Offline viewing | ❌ |
Configuration
output:
format: redoc
theme: dark
metadata:
title: My API
version: 1.0.0
description: API documentation
hosting:
provider: github-pages
branch: gh-pages
Pitfalls
- Spec Quality — Good docs need good OpenAPI spec
- Keep Updated — Docs can become stale
- Security — Don't expose internal endpoints