Commit a5ebb45
authored
docs: Add CLI documentation and version flag support (#46)
## Summary
Adds CLI documentation infrastructure and improves CLI usability:
- **CLI**: `g --version` / `g -V` now shows g's version (previously passed to VCS)
- **Documentation**: New [CLI documentation page](https://g.git-pull.com/cli/) with complete command reference
- **Documentation**: Linkable argument anchors (headerlinks) for easy sharing
- **Documentation**: Semantic CLI markup roles and syntax highlighting
## User-facing changes
### CLI
- `g --version` and `g -V` display g's version instead of being passed to the underlying VCS
- Documentation now accurately describes this behavior
### Documentation
- New CLI page at `/cli/` with argparse-generated command reference
- CLI arguments have linkable anchors (¶ headerlinks)
- Improved CSS for light/dark mode compatibility
## Technical changes
- Added `docs/_ext/sphinx_argparse_neo/` - argparse documentation with headerlinks
- Added `docs/_ext/argparse_lexer.py` - syntax highlighting for CLI output
- Added `docs/_ext/argparse_roles.py` - semantic markup roles (`:cli-opt:`, `:cli-cmd:`, etc.)
- Added `docs/_ext/argparse_exemplar.py` - epilog examples transformation
- Added `docs/_static/css/argparse-highlight.css` - CLI styling
- Added comprehensive test suite in `tests/docs/_ext/`
- Updated `docs/conf.py` with extension configuration
- Updated `pyproject.toml` with mypy overrides34 files changed
Lines changed: 8648 additions & 8 deletions
File tree
- docs
- _ext
- sphinx_argparse_neo
- _static/css
- cli
- src/g
- tests
- docs
- _ext
- sphinx_argparse_neo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments