- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
extend option directive syntax #10840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extend option directive syntax #10840
Conversation
A bit of context: as you likely know I'm working on transition of th GCC compiler documentation from Texinfo to Sphinx and this feature would help you reference Is the Sphinx community interested in the feature? I can add more tests and document it. |
My concern is about making the option directive too complicated to maintain for quite a niche usecase. Is it possible in your conversion work to implement a custom option directive that works for GCC, or a flag to the standard option directive that hooks into your extra processing? If there are constraints that GCC must use only vanilla Sphinx then those routes aren't useable, clearly. Is the following style usable? .. option:: -Wimplicit-fallthrough
Warn when a switch case falls through. Legal values are:
- 0: Disable it altogether.
- 1: Level 1
- 2: Level 2
- 3: Level 3
:option:`-Wimplicit-fallthrough` is the same as :option:`-Wimplicit-fallthrough=3`
and :option:`-Wno-implicit-fallthrough` is the same as
:option:`-Wimplicit-fallthrough=0`.
.. option:: -Wno-implicit-fallthrough
Default setting; overrides :option:`-Wimplicit-fallthrough`.
Try :option:`-Wimplicit-fallthrough=` or :option:`-Wimplicit-fallthrough` or :option:`-Wimplicit-fallthrough=n` This would only require changing the option role to ignore A |
I do share the concert about the maintainability of the functionality.
We would like to support only vanilla Sphinx.
Yes, that's a feasible solution for us, I think.
Yep. That would be a pretty small change, let me push it. |
9f0d216
to
38eae9f
Compare
2592cfd
to
ac32bbe
Compare
Please merge 5.x to fix mypy |
Please also add a CHANGES entry |
ac32bbe
to
d631093
Compare
Both done now. |
One can cross-reference an option value: :option:`--module=foobar`.
d631093
to
9dee9f7
Compare
I don't like the GitHub UI where you're not prompted to review the commit message if your last merge was a "rebase and merge"... for posterity I was going to use:
A |
I like the wording improvement, please commit it. |
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Extends: sphinx-doc#10840
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it support a format when space is used: -fauto-profile path. Extends: sphinx-doc#10840
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it supports a format when space is used: -fauto-profile path. Extends: sphinx-doc#10840
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it supports a format when space is used: -fauto-profile path. Extends: sphinx-doc#10840
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it supports a format when space is used: -fauto-profile path. Extends: sphinx-doc#10840 Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it supports a format when space is used: -fauto-profile path. Extends: sphinx-doc#10840 Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it supports a format when space is used: -fauto-profile path. Extends: sphinx-doc#10840 Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
The motivation of pull request is a documentation syntax we use in GCC docs (working on the porting):
As seen, we basically need to distinguish:
-Woption
and-Woption=
directives-Woption=value1
,-Woption=value2
, ...Where it would be handy to reference to any of the aforementioned versions. I came up with a new syntax
#
that is a non-breaking version of=
. Is the suggestion something the community would accept?Example:
https://splichal.eu/tmp/demo2/html/