clap_autodoc
Auto-generate markdown documentation tables from clap configuration structs.
Quick Start
[]
= "0.2.0"
= { = "4.0", = ["derive"] }
Basic Usage
use generate;
use Parser;
Generated output:
| Field Name | Type | Required | Default | Details | Group |
|---|---|---|---|---|---|
| database-host | String | Yes | - | Database host | Config |
| database-port | u16 | No | 5432 | Database port | Config |
Nested Structs (Grouped Format)
use ;
use Parser;
// Required for nested structs
Generated output:
DatabaseConfig Configuration
| Field Name | Type | Required | Default | Details |
|---|---|---|---|---|
| host | String | Yes | - | Database host |
AppConfig Configuration
| Field Name | Type | Required | Default | Details |
|---|---|---|---|---|
| port | u16 | No | 8080 | - |
How It Works
- Add
[//]: # (CONFIG_DOCS_START)and[//]: # (CONFIG_DOCS_END)markers to your markdown file - The macro generates tables between these markers during compilation
- Supports flat (single table) and grouped (separate sections) formats
Options
target: Path to markdown file (required)format:"flat"(default) or"grouped"
License
MIT OR Apache-2.0