Add force_refs_lower flag #179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sphinx chooses to
lower()
all:ref:
values, which means that we can not link to a program that has an upper-case value in it's program name, nor differentiate between upper and lower-case single character flags in references (e.g.-A
/-a
).While we could simply
lower()
the program name, it's not quite so simple for mixed-case arguments because they can then make duplicate refs. A alternative simple approach that fits nicely into the existing code is to simply prefix capitals in references with "_" and lower them.Unfortunately since this changes the refs, this would be a backwards incompatible change if made unconditionally. You may also decide that mixed case references are more clear in your output HTML URL's if you are not worried about ever making internal references in your documentation.
Thus this adds a
:force_refs_lower:
flag to optionally enable the prefix/lower behaviour.A test-case and documentation is added as well.