-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add how to build the doc with devcontainer. #4757
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,29 +33,37 @@ The root directory contains configuration and files required to locally build th | |
Building the site locally | ||
------------------------- | ||
|
||
Start by installing requirements located in the ``requirements.txt`` file: | ||
Start by creating `venv <https://docs.python.org/3/library/venv.html>`__ to build the documentation: | ||
|
||
.. code-block:: console | ||
|
||
# activate the venv | ||
python3 -m venv ros2doc | ||
|
||
# activate venv | ||
source ros2doc/bin/activate | ||
|
||
And install requirements located in the ``requirements.txt`` file: | ||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Linux | ||
|
||
The next command does a user-specific install, which requires ``~/.local/bin/`` to be added to ``$PATH``: | ||
|
||
.. code-block:: console | ||
|
||
pip3 install --user --upgrade -r requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this command fails with venv, (ros2doc) root@tomoyafujita:~/ros2_ws/work/ros2_documentation# pip3 install --user --upgrade -r requirements.txt
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv. |
||
pip install -r requirements.txt -c constraints.txt | ||
|
||
.. group-tab:: macOS | ||
|
||
.. code-block:: console | ||
|
||
pip3 install --user --upgrade -r requirements.txt | ||
pip install -r requirements.txt -c constraints.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am almost sure this works, but i do not have the dev environment with macOS and Windows, so i would like someone to help to make sure. |
||
|
||
.. group-tab:: Windows | ||
|
||
.. code-block:: console | ||
|
||
python -m pip install --user --upgrade -r requirements.txt | ||
python -m pip install -r requirements.txt -c constraints.txt | ||
|
||
In order for Sphinx to be able to generate diagrams, the ``dot`` command must be available. | ||
|
||
|
@@ -232,6 +240,38 @@ Finally, to view the site, you can click on the "Go Live" button in the right bo | |
:width: 100% | ||
:alt: Live Server | ||
|
||
Building the Site with Devcontainer | ||
----------------------------------- | ||
|
||
`ROS 2 Documentation GitHub repository <https://github.com/ros2/ros2_documentation>`__ also supports ``Devcontainer`` development environment with Visual Studio Code. | ||
This will enable you to build the documentation much easier without changing your operating system. | ||
|
||
See :doc:`../../How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container` to install VS Code and Docker before the following procedure. | ||
|
||
Clone repository and start VS Code: | ||
|
||
.. code-block:: console | ||
|
||
git clone https://github.com/ros2/ros2_documentation | ||
cd ./ros2_documentation | ||
code . | ||
|
||
To use ``Devcontainer``, you need to install "Remote Development" Extension within VS Code search in Extensions (CTRL+SHIFT+X) for it. | ||
|
||
And then, use ``View->Command Palette...`` or ``Ctrl+Shift+P`` to open the command palette. | ||
Search for the command ``Dev Containers: Reopen in Container`` and execute it. | ||
This will build your development docker container for you automatically. | ||
|
||
To build the documentation, open a terminal using ``View->Terminal`` or ``Ctrl+Shift+``` and ``New Terminal`` in VS Code. | ||
Inside the terminal, you can build the documentation: | ||
|
||
.. code-block:: console | ||
|
||
make html | ||
|
||
.. image:: images/vscode_devcontainer.png | ||
:width: 100% | ||
:alt: VS Code Devcontainer | ||
|
||
Writing pages | ||
------------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is required for ubuntu 24.04 or later, see more details for https://peps.python.org/pep-0668/
and that should be no problem, since this option is applied in the container environment only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm a bit confused about why this is needed here.
The current Dockerfile uses Ubuntu 22.04:
ros2_documentation/docker/image/Dockerfile
Line 6 in 5668ae0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR also changes the Dockerfile to use
ubuntu:24.04
? or did you mean something else?? btw, i verified that this works with no problem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, sorry, I just looked too quickly.
One thing we have to be careful about with changing the Dockerfile is that the Dockerfile is used to build and deploy the documentation. So as soon as we merge this, we'll start using 24.04 for the deployment. That is the correct thing going forward, but I'm going to hold off on merging this until I can merge it and immediately run a doc deployment job.