Giter VIP home page Giter VIP logo

Comments (7)

dpryan79 avatar dpryan79 commented on June 27, 2024

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.

j3mdamas avatar j3mdamas commented on June 27, 2024

Thanks for the tip! @alejandrovr, can you check it out?

from sphinx-argparse.

alejandrovr avatar alejandrovr commented on June 27, 2024

from sphinx-argparse.

j3mdamas avatar j3mdamas commented on June 27, 2024

Just tried it and I think this is fixed now

from sphinx-argparse.

lqc avatar lqc commented on June 27, 2024

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.

j3mdamas avatar j3mdamas commented on June 27, 2024

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.

madebr avatar madebr commented on June 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.