Skip to content

Don't needlessly repeat Sphinx directives #118030

Closed
@nineteendo

Description

@nineteendo

Documentation

If you repeat Sphinx directives they are separated by an empty line. For example:

cpython/Doc/library/typing.rst

Lines 1974 to 1975 in f703957

.. data:: ParamSpecArgs
.. data:: ParamSpecKwargs

Renders with a newline:

image

Could be changed to:

.. data:: ParamSpecArgs
          ParamSpecKwargs

Which renders without a newline:

image

Regexes:

  • \.\. attribute::.*\n \.\. attribute::: 35 matches
  • \.\. data::.*\n \.\. data::: 2 matches
  • \.\. decorator::.*\n \.\. decorator::: 1 match
  • \.\. index::.*\n \.\. index::: 3 matches
  • \.\. method::.*\n \.\. method::: 3 matches
  • \.\. versionadded::.*\n \.\. versionadded::: 1 match
  • \.\. versionchanged::.*\n \.\. versionchanged::: 1 match
  • \.\. attribute::.*\n\.\. attribute::: 4 matches
  • \.\. data::.*\n\.\. data::: 6 matches
  • \.\. describe::.*\n\.\. describe::: 1 match
  • \.\. exception::.*\n\.\. exception::: 1 match
  • \.\. function::.*\n\.\. function::: 11 matches
  • \.\. index::.*\n\.\. index::: 2 matches
  • \.\. method::.*\n\.\. method::: 2 matches
  • \.\. module::.*\n\.\. module::: 1 match
  • \.\. moduleauthor::.*\n\.\. moduleauthor::: 13 matches
  • \.\. opcode::.*\n\.\. opcode::: 1 match
  • \.\. option::.*\n\.\. option::: 17 matches
  • \.\. sectionauthor::.*\n\.\. sectionauthor::: 26 matches
  • \.\. versionadded::.*\n\.\. versionadded::: 4 matches

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions