KEMBAR78
References for config file values by hoefling · Pull Request #7859 · python/mypy · GitHub
Skip to content

Conversation

@hoefling
Copy link
Contributor

@hoefling hoefling commented Nov 2, 2019

This is another suggestion for adding 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.

Since Sphinx doesn't define any config-specific role, I have added the special confval directive and role. The .. confval:: directive accepts two optional info fields, :type: and :default:. For example,

.. confval:: verbosity

    :type: integer
    :default: 0

    Controls how much debug output will be generated.  Higher numbers are more verbose.

renders as

image

The :confval: role adds a crossref to the config value in a similar fashion as the :option: role for command line options. Example:

See the :confval:`verbosity` configuration option for more details.

renders as
image

If you like this suggestion, I will add another PR that adds crossreferences to the config file values throughout the docs.

…ile.rst

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
.. _config-precedence:

When options conflict, the precedence order for configuration is:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This newline is not related to this PR's topic, but it fixes a small rendering issue. Right now on current master, the list is rendered like this:

image

This is because the list items are too deeply indented. With a proper separation of the list and the preceding paragraph, it becomes

image

hoefling and others added 2 commits November 2, 2019 22:13
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks! It's to be able to add links to config file options.

@JukkaL JukkaL merged commit e87bf24 into python:master Jul 31, 2020
@hoefling hoefling deleted the config-file-refs branch July 31, 2020 16:06
@hoefling
Copy link
Contributor Author

hoefling commented Aug 1, 2020

@JukkaL awesome, thanks! I will then prepare (or better to say, blow the dust off of) an another PR that will add crossrefs for config values in the current docs.

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