Skip to content
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

Mypy command line options reference anchors #7784

merged 1 commit into from Oct 25, 2019


Copy link

hoefling commented Oct 23, 2019

Also added references in command_line.rst. This is another suggestion for adding crossrefs to the docs. If you like this suggestion, I will add more PRs that replace verbatim option texts with references in chunks (same approach as with the stdlib crossrefs).


When reading the docs in the other PR I made earlier, I noticed the command line options are referenced throughout the docs. For that, a label is added above the command line paragraph which is linked by using the ref role. Although this does generate a valid link, e.g. in Import discovery:


this doesn't look nice (the verbatim formatting is missing and the double hyphens are merged to an em dash) and the overall construct (adding an anchor and using ref for referencing) can be simplified by using the :option: directive. When rendered, it will add an anchor automatically:


The anchor can then be referenced by using the :option: role:


@hoefling hoefling changed the title Command line options reference anchors Mypy command line options reference anchors Oct 23, 2019

This comment has been minimized.

Copy link
Contributor Author

hoefling commented Oct 23, 2019

Another side effect would be fixing (rare) typos in command args, i.e. --disallow-untype-defs instead of --disallow-untyped-defs in error_codes.rst.


Signed-off-by: Oleg Höfling <>
@hoefling hoefling force-pushed the hoefling:options-refs branch from 1dea0bf to f19034b Oct 23, 2019
Copy link

msullivan left a comment

This is great. Thank you!

@msullivan msullivan merged commit dc15ace into python:master Oct 25, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@hoefling hoefling deleted the hoefling:options-refs branch Oct 26, 2019
JukkaL added a commit that referenced this pull request Oct 28, 2019
This is the follow-up of #7784. All options verbatim texts and :ref: usages are 
replaced with the :option: role.
JukkaL added a commit that referenced this pull request Oct 28, 2019
…in stubgen.rst (#7801)

This is the follow-up of #7784. Added :option: directives in stubgen.rst.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.