You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-1
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ Within the reStructuredText files use the `sphinx_argparse_cli` directive that t
43
43
| group_title_prefix | (optional) groups subsections title prefixes, accepts the string `{prog}` as a replacement for the program name - defaults to `{prog}`|
44
44
| group_sub_title_prefix | (optional) subcommands groups subsections title prefixes, accepts replacement of `{prog}` and `{subcommand}` for program and subcommand name - defaults to `{prog} {subcommand}`|
45
45
| no_default_values | (optional) suppresses generation of `default` entries |
46
-
46
+
| force_refs_lower | (optional) Sphinx `:ref:` only supports lower-case references. With this, any capital letter in generated reference anchors are lowered and given an `_` prefix (i.e. `A` becomes `_a`) |
47
47
For example:
48
48
49
49
```rst
@@ -84,3 +84,14 @@ being `cli`:
84
84
- to refer to the optional arguments group use ``:ref:`cli:tox-optional-arguments` ``,
85
85
- to refer to the run subcommand use ``:ref:`cli:tox-run` ``,
86
86
- to refer to flag `--magic` of the `run` sub-command use ``:ref:`cli:tox-run---magic` ``.
87
+
88
+
Due to Sphinx's `:ref:` only supporting lower-case values, if you need to distinguish mixed case program names or
89
+
arguments, set the `:force_refs_lower:` argument. With this flag, captial-letters in references will be converted to
90
+
their lower-case counterpart and prefixed with an `_`. For example:
91
+
92
+
- A `prog` name `SampleProgram` will be referenced as ``:ref:`_sample_program...` ``.
93
+
- To distinguish between mixed case flags `-a` and `-A` use ``:ref:`_sample_program--a` `` and ``:ref:`_sample_program--_a` `` respectively
94
+
95
+
Note that if you are _not_ concernced about using internal Sphinx `:ref:` cross-references, you may choose to leave this
96
+
off to maintain mixed-case anchors in your output HTML; but be aware that later enabling it will change your anchors in
0 commit comments