Skip to content

Commit 610fb39

Browse files
Merge branch 'ros2:rolling' into triaging-reporting-an-issue
2 parents 1aa5e82 + 25ca290 commit 610fb39

7 files changed

Lines changed: 75 additions & 5 deletions

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ifeq ($(OS),Windows_NT)
99
endif
1010
BUILD = $(PYTHON) -m sphinx
1111
OPTS =-c . -W # Treat warnings as errors
12+
LIVE_HOST ?= 0.0.0.0
13+
LIVE_PORT ?= 2022
1214

1315
DICTIONARIES := codespell_dictionary.txt codespell_whitelist.txt
1416

@@ -61,4 +63,7 @@ linkcheck:
6163
@echo
6264
@echo "Check finished. Report is in $(LINKCHECKDIR)."
6365

64-
.PHONY: help Makefile multiversion test test-tools linkcheck lint spellcheck check-dictionaries sort-dictionaries
66+
serve:
67+
sphinx-autobuild --host $(LIVE_HOST) --port $(LIVE_PORT) -c . $(SOURCE) $(OUT)/html
68+
69+
.PHONY: help Makefile multiversion test test-tools linkcheck serve lint spellcheck check-dictionaries sort-dictionaries

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ For local testing of the current tree use:
5151

5252
`sensible-browser build/html/index.html`
5353

54+
### Live-reload local development
55+
56+
To iterate on documentation without manually rebuilding and refreshing the browser, use [`sphinx-autobuild`](https://github.com/sphinx-doc/sphinx-autobuild).
57+
It watches the source files, rebuilds incrementally on save, and serves the result with automatic browser reload.
58+
59+
`sphinx-autobuild` is installed as part of `requirements.txt`.
60+
Start the live server with:
61+
62+
```
63+
make serve
64+
```
65+
66+
Then open `http://localhost:2022` in a browser.
67+
68+
The `serve` target binds to `0.0.0.0:2022` by default (a little ROS 2 vibe) so the server is reachable through devcontainer / port forwarding.
69+
Override the bind address or port if needed:
70+
71+
```
72+
make serve LIVE_HOST=127.0.0.1 LIVE_PORT=8080
73+
```
74+
5475
### Spelling Check
5576

5677
To check the spelling, use:

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ docutils
44
pip
55
pytest
66
sphinx
7+
sphinx-autobuild
78
sphinx-copybutton
89
sphinx-lint
910
sphinx-multiversion

source/The-ROS2-Project/Contributing/Contributing-To-ROS-2-Documentation.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,27 @@ This is the recommended way to test out local changes.
9696
The build process can take some time.
9797
To see the output, open ``build/html/index.html`` in your browser.
9898

99+
Live-reload local development
100+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101+
102+
When iterating on documentation, instead of re-running ``make html`` and refreshing the browser after every edit, use `sphinx-autobuild <https://github.com/sphinx-doc/sphinx-autobuild>`__ to watch the source files, rebuild incrementally on save, and serve the result with automatic browser reload.
103+
104+
``sphinx-autobuild`` is installed as part of ``requirements.txt``.
105+
Start the live server with:
106+
107+
.. code-block:: console
108+
109+
$ make serve
110+
111+
Then open ``http://localhost:8000`` in a browser.
112+
113+
The ``serve`` target binds to ``0.0.0.0:8000`` by default so the server is reachable through devcontainer / port forwarding.
114+
Override the bind address or port if needed:
115+
116+
.. code-block:: console
117+
118+
$ make serve LIVE_HOST=127.0.0.1 LIVE_PORT=8080
119+
99120
100121
Checking / Testing the site
101122
^^^^^^^^^^^^^^^^^^^^^^^^^^^

source/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ Install colcon
3737

3838
.. tabs::
3939

40-
.. group-tab:: Linux
40+
.. group-tab:: Ubuntu
4141

4242
.. code-block:: console
4343
4444
$ sudo apt install python3-colcon-common-extensions
4545
46+
.. group-tab:: RHEL
47+
48+
.. code-block:: console
49+
50+
$ sudo dnf install python3-colcon-common-extensions
51+
4652
.. group-tab:: macOS
4753

4854
.. code-block:: console

source/Tutorials/Intermediate/Rosdep.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,19 @@ If you are using ``rosdep`` with ROS, it is conveniently packaged along with the
157157
This is the recommended way to get ``rosdep``.
158158
You can install it with:
159159

160-
.. code-block:: console
160+
.. tabs::
161+
162+
.. group-tab:: Ubuntu
163+
164+
.. code-block:: console
165+
166+
$ sudo apt install python3-rosdep
167+
168+
.. group-tab:: RHEL
169+
170+
.. code-block:: console
161171
162-
$ apt-get install python3-rosdep
172+
$ sudo dnf install python3-rosdep
163173
164174
.. note::
165175

source/Tutorials/Intermediate/Tf2/Using-Stamped-Datatypes-With-Tf2-Ros-MessageFilter.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,18 @@ This tutorial expects you to have ``turtle_tf2_py`` package installed.
4242

4343
.. tabs::
4444

45-
.. group-tab:: Linux
45+
.. group-tab:: Ubuntu
4646

4747
.. code-block:: console
4848
4949
$ sudo apt install ros-{DISTRO}-turtle-tf2-py
5050
51+
.. group-tab:: RHEL
52+
53+
.. code-block:: console
54+
55+
$ sudo dnf install ros-{DISTRO}-turtle-tf2-py
56+
5157
.. group-tab:: From Source
5258

5359
.. code-block:: console

0 commit comments

Comments
 (0)