alex-rudakov / sphinx-argparse

Sphinx extension that automatically document argparse commands and options
MIT License
49 stars 40 forks source link

How to use relative paths for filename #142

Closed thedannymarsh closed 2 years ago

thedannymarsh commented 2 years ago

Hi, I have a rst file:

.. argparse::
   :filename: ../config/system/run_utils/parse_args.py
   :func: parser
   :prog: run

which works properly on my Windows computer, but breaks on read the docs:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/ascent-docs/envs/latest/lib/python3.7/site-packages/sphinxarg/ext.py", line 469, in run
    f = open(self.options['filename'])
FileNotFoundError: [Errno 2] No such file or directory: '../config/system/run_utils/parse_args.py'

How can I add a relative path outside of the docs directory?

Thanks!

JOJ0 commented 2 years ago

This repo is abandoned, but there is an actively mantained fork you should use: https://github.com/ashb/sphinx-argparse

@ashb Your fork does not have issues github feature enabled.You might wanna consider that. It's a default on forks I think.

ashb commented 2 years ago

@JOJ0 oh thanks! Issues turned on there now

thedannymarsh commented 2 years ago

I put it on that repo, thanks!