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
merged 1 commit into from
Oct 25, 2019

Conversation

hoefling
Copy link
Contributor

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).

Motivation

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:

image

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:

image

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

image

@hoefling hoefling changed the title Command line options reference anchors Mypy command line options reference anchors Oct 23, 2019
@hoefling
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.

…command_line.rst

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thank you!

@msullivan msullivan merged commit dc15ace into python:master Oct 25, 2019
@hoefling hoefling deleted the options-refs branch October 26, 2019 09:38
JukkaL pushed 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 pushed 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.
JukkaL pushed a commit that referenced this pull request Jul 31, 2020
This adds crossrefs to the docs, a follow-up of #7652 (crossrefs to standard 
library items) and #7784 (crossrefs for command line options), only now for 
the config file values.

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants