alex-rudakov / sphinx-argparse

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

Handle submodules and subattributes (dotted.named.things) #7

Closed cottrell closed 10 years ago

cottrell commented 10 years ago

Not heavily tested (rand py.test on 3.3 and 2.7) but if you see the note in commit 29c4d36 I was unable to pass references to the module.submodule and object.get_argparser function. Possibly I was using the api incorrectly?

I think it would be nice to make the code for handling :module: and :func: a bit more robust. Maybe it would make sense to also allow passing a direct reference to an argparser object (i.e. ":func: main.argparser") by some extra checks in the code? I had to add a function to my CLI class to make this part work.

alex-rudakov commented 10 years ago

Thanks for contribution, there are couple small corrections to your pull request:

  1. It would be cool if you can write simple test case for you scenario, ex. crate _some/module inside test directory and create test case that imports this module and function using your contributed code. This will prevent this trouble from appearing in future.
  2. I guess it would be vise to keep :module: :func: api backward compatible, and make it understand both module/func and func only approach.
  3. (Not your pull request issue) I noticed that there were committed sphinx documentation compiled version, so I removed them, can you please merge it into your documentation fix?
alex-rudakov commented 10 years ago

Implemented in version 0.1.10. See :ref: syntax.