Skip to content

Normalize command lines in code blocks #947

@bhrutledge

Description

@bhrutledge

In most places where there's a command line, it's shown without a prompt, e.g.

.. code-block:: bash

    python3 --version

However, there are some places where it's preceded by a prompt character:

::

  $ pipx run cowsay moooo

I think we should remove the prompt characters entirely, and standardize on code-block:: bash (plus code-block:: bat for Windows if the command is different). For places where that's not practical (i.e. where including the prompt character and/or command output improves readability), I think we should use code-block:: console (plus code-block:: doscon for Windows if the command is different).

I think this is a list of all of the occurrences of a prompt character (which notably doesn't include any use of > for Windows):

% rg '^\s*(\$ |> )'
source/guides/installing-stand-alone-command-line-tools.rst
47:  $ pipx install PACKAGE
48:  $ ENTRYPOINT_OF_PACKAGE [ARGS]
54:  $ pipx install cowsay
59:  $ cowsay moo
74:  $ pipx list
94:  $ pipx upgrade PACKAGE
95:  $ pipx uninstall PACKAGE
118:  $ pipx run PACKAGE [ARGS]
124:  $ pipx run cowsay moooo
130:  $ pipx --help

source/guides/analyzing-pypi-package-downloads.rst
283:    $ pypinfo requests

source/guides/index-mirrors-and-caches.rst
40:    $ python -m pip wheel --wheel-dir=/tmp/wheelhouse SomeProject
41:    $ python -m pip install --no-index --find-links=/tmp/wheelhouse SomeProject

source/guides/using-testpypi.rst
31:    $ twine upload --repository testpypi dist/*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions