Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ Compare the above with a ``bash`` ``code-block``:
[INFO] [1742150439.026043867] [my_turtle]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]

To simplify code blocks, ``bash`` can still be used without ``$`` for commands meant to be run in a terminal if the code block does not include any output lines.

To help choose between ``bash`` and ``console``, see the following list of use-cases and corresponding examples:

#. Commands meant to be copied into a script file
Expand All @@ -489,25 +488,10 @@ To help choose between ``bash`` and ``console``, see the following list of use-c
export ROS_DOMAIN_ID=42
ros2 run turtlesim turtlesim_node

#. Commands meant to be run in a terminal *without* any output lines

* Use ``.. code-block:: bash`` without ``$``:

.. code-block:: bash

source /opt/ros/{DISTRO}/setup.bash
ros2 run turtlesim turtlesim_node

* Or use ``.. code-block:: console`` with ``$`` on all command lines, i.e., all lines:
#. Commands meant to be run in a terminal:

.. code-block:: console

$ source /opt/ros/{DISTRO}/setup.bash
$ ros2 run turtlesim turtlesim_node

#. Commands meant to be run in a terminal *with* output lines

* Use ``.. code-block:: console`` with ``$`` on all command lines:
* It is highly recommended to use ``.. code-block:: console`` with ``$`` on all command lines for consistency and clarity.
If there is output that needs to be displayed, include it in the same block:

.. code-block:: console

Expand All @@ -516,6 +500,11 @@ To help choose between ``bash`` and ``console``, see the following list of use-c
[INFO] [1743878028.269334696] [turtlesim]: Starting turtlesim with node name /turtlesim
[INFO] [1743878028.275096618] [turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]

.. note::

If some output lines start with ``#``, it is crucial to separate commands from their output because the ``#`` symbol is used to denote a command.
Therefore, place the output in a separate ``.. code-block:: text``.

Images
^^^^^^

Expand Down