Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Jan 18, 2026

Summary

  • Replace external sphinx-argparse dependency with custom sphinx_argparse_neo extensions
  • Port extensions from vcspull project
  • Add comprehensive test suite for Sphinx extensions

Changes

  • Add docs/_ext/sphinx_argparse_neo/ module
  • Add docs/_ext/argparse_exemplar.py extension
  • Replace pretty_argparse.py with new extensions
  • Keep aafig.py extension (tmuxp-specific)
  • Add syntax highlighting lexers and roles
  • Remove sphinx-argparse from dependencies
  • Add tests for all new extensions

Test plan

  • uv run ruff check . --fix --show-fixes passes
  • uv run ruff format . passes
  • uv run mypy passes
  • uv run py.test --reruns 0 -vvv tests/docs/ passes (298 tests)
  • cd docs && sphinx-build -b html . _build/html builds successfully

why: Custom extensions provide better control over CLI documentation
rendering and eliminate external dependency on sphinx-argparse.

what:
- Add docs/_ext/sphinx_argparse_neo/ module for argparse rendering
- Add docs/_ext/argparse_exemplar.py extension (replaces sphinxarg.ext)
- Add syntax highlighting lexers and roles for CLI documentation
- Replace pretty_argparse.py with argparse_exemplar.py
- Keep aafig.py extension (tmuxp-specific ASCII art rendering)
- Add comprehensive test suite for all Sphinx extensions
- Remove sphinx-argparse from dependencies
- Update docs/conf.py to use argparse_exemplar extension
- Update mypy overrides for new extension modules
@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.11%. Comparing base (a984ae4) to head (16a4b5b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1009   +/-   ##
=======================================
  Coverage   80.11%   80.11%           
=======================================
  Files          28       28           
  Lines        2409     2409           
  Branches      457      457           
=======================================
  Hits         1930     1930           
  Misses        356      356           
  Partials      123      123           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony marked this pull request as ready for review January 18, 2026 19:14
@tony
Copy link
Member Author

tony commented Jan 18, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

tony added 2 commits January 18, 2026 16:20
Add argparse-highlight.css with "One Dark" color palette to style
the CLI usage lines with semantic colorization:
- Blue: "usage:" heading
- Purple: program name
- Green: subcommands
- Teal: options (-h, --tree)
- Yellow: metavars

Also strip ANSI codes and disable colors during doc builds to ensure
clean parsing by the argparse lexer.
Add intro paragraphs, wrap argparse directives in `## Command` sections,
and rename generic `## Usage` to descriptive section names for consistent
documentation structure across projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants