Skip to content

References for config file values #7859

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

Merged
merged 3 commits into from
Jul 31, 2020
Merged

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.

@@ -57,6 +57,7 @@ section names in square brackets and flag settings of the form
.. _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

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