Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
},
"workspaceMount": "source=${localWorkspaceFolder},target=/docs,type=bind",
"workspaceFolder": "/docs",
"onCreateCommand": ".devcontainer/on-create-command.sh",
"updateContentCommand": ".devcontainer/update-content-command.sh",
Comment thread
fujitatomoya marked this conversation as resolved.
"customizations": {
"vscode": {
"settings": {},
Expand Down
12 changes: 0 additions & 12 deletions .devcontainer/on-create-command.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .devcontainer/update-content-command.sh

This file was deleted.

45 changes: 39 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
FROM ubuntu:focal
Comment thread
fujitatomoya marked this conversation as resolved.
# This dockerfile is for building the Navigation2 documentation.
#
# To build the image (from the root of the repository):
# $ docker build -f Dockerfile --build-arg user=$(id -un) --build-arg uid=$(id -u) -t nav2_docs .
#
# To use the image to build the docs:
# $ docker run --rm -v $(pwd):/docs nav2_docs make html
#
# To run autobuild (watches for changes and rebuilds automatically):
# $ docker run --init --rm -it -v $(pwd):/docs -p 8000:8000 nav2_docs make autobuild
# Then browse to http://127.0.0.1:8000
# Use Ctrl+C to stop (--init flag enables proper signal handling)
#
# The built documentation will be in _build/html/

ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y \
FROM ubuntu:noble

ARG user=nav2doc
ARG uid=1000

ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL=/bin/bash

# Delete user if it exists in container (e.g Ubuntu Noble: ubuntu)
RUN if id -u $uid ; then userdel `id -un $uid` ; fi

RUN apt-get update && \
apt-get install --no-install-recommends -y \
doxygen \
git \
graphviz \
make \
openjdk-8-jre \
openssh-server \
python3-pip \
ttf-dejavu
fonts-dejavu && \
rm -rf /var/lib/apt/lists/*

RUN useradd -u $uid -m $user

ENV HOME=/home/$user
ENV PATH="$HOME/.local/bin:$PATH"

USER $user

COPY requirements.txt ./
RUN pip3 install -r requirements.txt
RUN pip3 install --no-warn-script-location --user --break-system-packages -r requirements.txt
Comment thread
fujitatomoya marked this conversation as resolved.

WORKDIR /docs
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ html:
# Autobuild the docs on changes

autobuild:
sphinx-autobuild -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS)
sphinx-autobuild --host 0.0.0.0 --port 8000 -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS)
Comment thread
fujitatomoya marked this conversation as resolved.

# Remove generated content (Sphinx and doxygen)

Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,43 @@ source venv/bin/activate
pip3 install -r requirements.txt
```

### Using Docker

Build the Docker image (from this directory):

```bash
docker build -f Dockerfile --build-arg user=$(id -un) --build-arg uid=$(id -u) -t nav2_docs .
```

To build the documentation:

```bash
docker run --rm -v $(pwd):/docs nav2_docs make html
```

To run autobuild (watches for changes and rebuilds automatically):

```bash
docker run --init --rm -it -v $(pwd):/docs -p 8000:8000 nav2_docs make autobuild
```

Then browse to http://127.0.0.1:8000. Use Ctrl+C to stop (the `--init` flag enables proper signal handling).

### Using VS Code Dev Container

If you're using Visual Studio Code, you can use the dev container for an easy setup:

1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
2. Open this folder in VS Code
3. When prompted, click "Reopen in Container" (or use Command Palette: "Dev Containers: Reopen in Container")
4. Once the container is built and running, use the integrated terminal to build the docs

The dev container automatically sets up all dependencies. You can then use the build tasks or run commands directly:
- Build once: `make html` or use the "Build" task (Ctrl+Shift+B)
- Auto-rebuild: `make autobuild` or use the "Autobuild" task

### Build the Docs

Build the docs locally with `make html` and you'll find the built docs entry point in `_build/html/index.html`.

To automate the build process, you can use a [sphinx-autobuild](https://github.com/sphinx-doc/sphinx-autobuild) package. \
Expand Down
Loading