Skip to content

Produce clear guidelines about indentation #9

Open
@benoitbryon

Description

@benoitbryon

Issues with 2 spaces:

  1. It's a pain to have several indentation levels in a same RST document while editing it, because the TAB shorcut gives wrong results.
    As an example toctree directive doesn't work with 2 spaces but seems to work with 3 or 4 spaces.
  2. in code-blocks, it's a pain to deal with mixed indentation.
    As an example:
The following block is indented with 2 spaces.
.. code-block:: python

  def some_intendation():
      """This comment is indented with 4 spaces."""

Python convention is to use 4 spaces. Since most Sphinx projects are about Python projects, Python code-blocks are a really common use case. So 4 space indentation may be useful for many users (most of them?).

Another common use case for code-blocks is sh or bash... 4 spaces doesn't hurt in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions