forked from alex-rudakov/sphinx-argparse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several improvements + Read The docs modern theme
- Loading branch information
Aleksandr Rudakov
committed
May 15, 2014
1 parent
c8bc98e
commit 39eaf66
Showing
14 changed files
with
432 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
|
||
|
||
Contribution | ||
----------------------------------------- | ||
|
||
Any help is welcome! | ||
Most wanted: | ||
* documentation correction (I am not native english speaker) | ||
* bugfixes | ||
* examples | ||
* ports for other libraries (optparse, what else?) | ||
|
||
Contributions are accepted through github pull-request. | ||
Bug reports are also through bug-tracker on github. | ||
|
||
https://github.com/ribozz/sphinx-argparse | ||
|
||
Don't forget to run tests before commit:: | ||
|
||
py.test` | ||
|
||
Any feedback is welcome: ribozz (a) gmail dot com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
|
||
|
||
|
||
Extending result of `argparse` directive | ||
----------------------------------------- | ||
|
||
You can add extra content or even replace some part of documentation generated by `argparse` directive. | ||
For example, any content you put inside directive (follow reText identation rules), will be inserted, just before argument and option list:: | ||
|
||
.. argparse:: | ||
:module: my.module | ||
:func: my_func_that_return_parser | ||
:prog: fancytool | ||
|
||
My content here that will be inserted as extra, right before argument list. | ||
|
||
Also any valid markup... | ||
************************* | ||
|
||
... may `be` *applied* here | ||
|
||
including:: | ||
|
||
any directives you usually use. | ||
|
||
|
||
Also, there is an option to insert own content into argument/option/subcommand description. Just create definition-list, | ||
where name is argument/option/subcommand name and definition-body is any reStructured markup:: | ||
|
||
.. argparse:: | ||
:module: my.module | ||
:func: my_func_that_return_parser | ||
:prog: fancytool | ||
|
||
My content here that will be inserted as extra right before argument list. | ||
|
||
foo | ||
This text will go right after "foo" positional argument help. | ||
|
||
install | ||
This text will go right after "install" subcommand help and before it's arguments. | ||
|
||
--upgrade | ||
This text will go to upgrade option of install subcommand, nesting is not limited | ||
|
||
|
||
You can also add classifiers to definition-list that will change behavior of content merge algorythm:: | ||
|
||
.. argparse:: | ||
:module: my.module | ||
:func: my_func_that_return_parser | ||
:prog: fancytool | ||
|
||
My content that will be inserted as extra, right before argument list. | ||
|
||
foo : @before | ||
This text will go right after "foo" positional argument help. | ||
|
||
install : @replace | ||
This text will go right after "install" subcommand help and befor it's arguments. | ||
|
||
--upgrade : @after | ||
This text will go to upgrade option of install subcommand, nesting is not limited | ||
|
||
|
||
@before | ||
Insert content before parsed help message of argument/option/subcommand. | ||
|
||
@after | ||
Insert content after parsed help message of argument/option/subcommand. | ||
|
||
This is default, if you do not specify classifier explicitly. | ||
|
||
@replace | ||
Replace content of help message of argument/option/subcommand. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.