Comments (7)
This has bothered me recently as well, thanks for bringing it up! I haven't tested it yet, but my guess is that this is the culprit. If that's the case, we can at least document that people should change this setting.
from sphinx-argparse.
Thanks for the tip! @alejandrovr, can you check it out?
from sphinx-argparse.
from sphinx-argparse.
Just tried it and I think this is fixed now
from sphinx-argparse.
Hi, I wouldn't consider this issues fixed. This is a global setting and a bulk my documentation want this to be set to the default value, which is True
. Would you consider adding an escape sequence to the generated markup instead ?
from sphinx-argparse.
Hi @lqc
When I said this is fixed is when I noticed our documentation now has this correct: https://software.acellera.com/docs/latest/parameterize/index.html. And we did not change the html_use_smartypants
to True as @dpryan79 suggested, so I assumed it just got fixed somehow?
from sphinx-argparse.
Is this fixed? Because I can still reproduce this using the script below.
Or at the least, the man
renders only one hyphen.
What am I missing?
#!/bin/bash
cd /tmp
rm -rf WORKDIR
mkdir WORKDIR
cd WORKDIR
sphinx-quickstart $PWD --extensions sphinxarg.ext --sep -p option_bug -a author -r 0.1 -l en --no-batchfile --makefile
cat >>source/conf.py <<EOF
man_pages = [
('cmd_main', 'tmpmain', 'tmpmain Documentation',
['name of author'], 1)
]
import sys
import os
sys.path.insert(0, os.path.dirname(os.getcwd()))
EOF
mkdir pymodule
touch pymodule/__init__.py
cat >pymodule/tmpmain.py <<EOF
#!/usr/bin/env python3
import argparse
def my_func_that_returns_a_parser():
parser = argparse.ArgumentParser()
parser.add_argument('foo', default=False, help='foo help')
parser.add_argument('bar', default=False)
parser.add_argument('--general', '-G', default=False, help='General option')
subparsers = parser.add_subparsers()
subparser = subparsers.add_parser('install', help='install help')
subparser.add_argument('ref', type=str, help='foo1 help')
subparser.add_argument('--upgrade', action='store_true', default=False, help='foo2 help')
subparser.add_argument('-U', action='store_true', default=False, help='foo3 help')
return parser
if __name__ == '__main__':
p = my_func_that_returns_a_parser()
p.parse_args()
EOF
chmod a+x pymodule/tmpmain.py
cat >source/index.rst <<EOF
Welcome to pymodule's documentation!
====================================
.. toctree::
:maxdepth: 2
:caption: Contents:
cmd_main
EOF
cat >source/cmd_main.rst <<EOF
.. argparse::
:module: pymodule.tmpmain
:func: my_func_that_returns_a_parser
:prog: fancytool
EOF
make man
man build/man/tmpmain.1
from sphinx-argparse.
Related Issues (20)
- LICENSE not in pypi tarball HOT 2
- Files in sphinx-argparse.egg-info are chmodded to 640
- Feature request: support for argparse.SUPPRESS
- Some tests fail when py.test has a different name HOT 4
- Deprecation warning due to invalid escape sequences. HOT 1
- sphinx/sphinx-argparse can not interpret hyphen as underscore or vice-versa HOT 1
- Section numbers wrong when multiple argparse directives used in single page
- Consider adding the sphinx-extension GitHub topic
- %(prog)s format specifier is not converted in description and epilog HOT 1
- Help with maintainance HOT 4
- Are you looking for a new maintainer? HOT 17
- 0.2.5: pytest is failing
- 0.2.5: setuptools build_sphinx target is failing HOT 6
- 0.3.0 sdist tarball on pypi.org has no tag
- 0.3.0 sdist tarball on pypi misses tests
- How to use relative paths for filename HOT 3
- There is no support for class.method type entry HOT 3
- Named Arguments listing - two hrules when there are two underlines in argument name HOT 2
- Sphinx autodoc like mock imports.
- archive this repo to prevent new issues/PRs? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-argparse.