sphinx-doc / sphinx-doc/sphinx-argparse
Newer versions of Python Argparse give you Colors on Usage String
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 38
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Newer version of Python's argparse return colors. Colors are nice. but they partially break this tool:
[1;34musage: [0m[1;35mtfreport.py[0m [[32m-h[0m] [[36m--level [33mLEVEL[0m] [[32m-v[0m] [32mpath[0m
It looks like the terminal stuff is leaking in there.
I can fix it by making color=False in my thing = argparse.ArgumentParser(... color=False) and it corrects in the documentation. Or when running my sphinx build/make I can set NO_COLOR=1:
NO_COLOR=1
make clean; make html
... yeilds a readable
usage: tfreport.py [-h] [--level LEVEL] [-v] path
And it will do the right thing. But I wonder if there's an option to disable color "on the fly" so that this tool can always be no color (or if colors could be supported, that would be cool too).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by running the Sphinx build or make html with a newer Python argparse, and compare the colored usage output with NO_COLOR=1 or color=False. Trace how argparse usage text is collected and rendered by the extension. Done means generated documentation contains readable usage text without terminal escape sequences, while existing argparse documentation remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100