# Sphinx 5 Generate API Documentation

> Sub-skill of sphinx: 5. Generate API Documentation (+1).

- Skill: `vamseeachanta/sphinx-5-generate-api-documentation` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/sphinx-5-generate-api-documentation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/sphinx-5-generate-api-documentation/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/sphinx-5-generate-api-documentation

---


# 5. Generate API Documentation (+1)

## 5. Generate API Documentation


```bash
# Auto-generate API documentation stubs
sphinx-apidoc -o docs/source/api src/mypackage -f -e -M

# Options:
# -o: Output directory
# -f: Force overwrite
# -e: Separate pages for each module
# -M: Module-first ordering
# -d 2: TOC depth

# Build HTML documentation
sphinx-build -b html docs/source docs/build/html

# Build with verbose output
sphinx-build -b html docs/source docs/build/html -v

# Clean and rebuild
rm -rf docs/build && sphinx-build -b html docs/source docs/build/html
```


## 6. MyST Markdown Support


```python
# conf.py - Enable MyST
extensions = [
    'myst_parser',
]

# MyST configuration
myst_enable_extensions = [
    'amsmath',
    'colon_fence',
    'deflist',
    'dollarmath',
    'fieldlist',
    'html_admonition',
    'html_image',
    'replacements',
    'smartquotes',
    'strikethrough',
    'substitution',
    'tasklist',
]

myst_heading_anchors = 3
myst_footnote_transition = True
```

```markdown
<!-- docs/source/guide/overview.md -->

# Overview

This guide provides an overview of MyProject.

