Skip to content

Commit 30a95e9

Browse files
authored
Merge pull request #121 from hmakelin/vitepress2
Add VitePress docs
2 parents 5187402 + b2c340c commit 30a95e9

File tree

116 files changed

+5927
-3535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+5927
-3535
lines changed

.dockerignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ build/
1515
install/
1616
log/
1717

18-
# Built Sphinx documentation
19-
docs/_build/
18+
# VitePress
19+
docs/vitepress/docs/.vitepress/dist
20+
docs/vitepress/docs/.vitepress/build
21+
docs/vitepress/docs/.vitepress/cache
22+
docs/vitepress/docs/reference/
23+
24+
# Sphinx
25+
docs/sphinx/build
2026

2127
# coverage.py files
2228
.coverage*
@@ -31,3 +37,6 @@ gisnav/test/sitl/ulog_analysis/.ipynb_checkpoints/
3137

3238
# mypy
3339
.mypy_cache
40+
41+
# node
42+
node_modules
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Build and deploy Sphinx documentation
1+
name: Build and deploy docs
22

33
on:
4-
push:
5-
# Run when new version tag is pushed
6-
tags:
7-
- v*
4+
# Push trigger is disabled because the Docker container that builds the docs
5+
# in this workflow will not have the new tag, meaning the API reference would
6+
# have the wrong version tag displayed (commit would still be correct). Need to
7+
# build a new Docker image and then use that to build and deploy the docs.
8+
#push:
9+
# # Run when new version tag is pushed
10+
# tags:
11+
# - v*
812

913
# Allows running manually from the Actions tab
1014
workflow_dispatch:
@@ -17,11 +21,11 @@ jobs:
1721
run:
1822
shell: bash
1923
steps:
20-
- name: Build Sphinx docs
24+
- name: Build docs
2125
run: |
2226
mkdir -p docs/_build
2327
docker run ghcr.io/${{ github.repository }}:latest make docs
24-
docker cp $(docker ps -q -l):/opt/colcon_ws/src/gisnav/docs/_build docs
28+
docker cp $(docker ps -q -l):/opt/colcon_ws/src/gisnav/docs/vitepress/docs/dist docs
2529
2630
- name: Install node
2731
run: |
@@ -30,19 +34,13 @@ jobs:
3034
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
3135
sudo apt-get install -y nodejs
3236
33-
- name: Setup pages
37+
- name: Configure pages
3438
uses: actions/configure-pages@v1
3539

36-
#- name: Make "Upload pages artifact" step work with containers
37-
# run: |
38-
# mkdir -p ${{runner.temp}}
39-
# mkdir -p /__w/_temp
40-
# ln -s ${{runner.temp}}/artifact.tar /__w/_temp/artifact.tar
41-
4240
- name: Upload pages artifact
4341
uses: actions/upload-pages-artifact@v2
4442
with:
45-
path: 'docs/_build/html/'
43+
path: "docs"
4644

4745
deploy:
4846
needs: build
@@ -58,6 +56,6 @@ jobs:
5856

5957
runs-on: ubuntu-20.04
6058
steps:
61-
- name: Deploy to GitHub Pages
59+
- name: Deploy pages
6260
id: deployment
6361
uses: actions/deploy-pages@v3

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ build/
1212
install/
1313
log/
1414

15-
# Built Sphinx documentation
16-
docs/_build/
15+
# VitePress
16+
docs/vitepress/docs/.vitepress/dist
17+
docs/vitepress/docs/.vitepress/build
18+
docs/vitepress/docs/.vitepress/cache
19+
docs/vitepress/docs/reference/
20+
21+
# Sphinx
22+
docs/sphinx/build
1723

1824
# coverage.py files
1925
.coverage*
@@ -36,3 +42,6 @@ debian
3642

3743
# mypy
3844
.mypy_cache
45+
46+
# node
47+
node_modules

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,15 @@ include docker/Makefile
88

99
.PHONY: docs
1010
docs:
11-
@$(MAKE) -C docs html
12-
@cd docs/_build/html && touch .nojekyll # for GitHub Pages
11+
@cd docs/sphinx && sphinx-build -M markdown ./source ./build
12+
@mkdir -p docs/vitepress/docs/reference && cp -r docs/sphinx/build/markdown/* docs/vitepress/docs/reference
13+
@cd docs/vitepress && npm run docs:build
14+
@cd docs/vitepress/docs/.vitepress/dist && touch .nojekyll # for GitHub Pages
15+
16+
.PHONY: docs-preview
17+
docs-preview:
18+
@cd docs/vitepress && npm run docs:preview
19+
20+
.PHONY: docs-dev
21+
docs-preview:
22+
@cd docs/vitepress && npm run docs:dev

docker/mavros/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ RUN apt-get update \
107107
&& rm -rf /var/lib/apt/lists/* \
108108
&& apt clean
109109

110+
# Node 18 for building the docs (Sphinx dependencies already in setup.py)
111+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
112+
&& source ~/.nvm/nvm.sh \
113+
&& nvm install 18 \
114+
&& nvm use 18
115+
110116
ENTRYPOINT ["/entrypoint.sh"]
111117

112118
# TODO: proper health check - check that public facing topics are publishing

docker/mavros/gisnav/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ set -e
44
source "/opt/ros/$ROS_VERSION/setup.bash"
55
source "/opt/colcon_ws/install/setup.bash" --
66

7+
# Ensure we have npm to build docs
8+
source ~/.nvm/nvm.sh
9+
710
# Needed for pip installed dev tools like pre-commit and sphinx-build
811
export PATH=/usr/lib/gisnav:$PATH
912

docs/_static/css/style.css

Lines changed: 0 additions & 115 deletions
This file was deleted.

docs/_static/fonts/Poppins Medium.ttf

-153 KB
Binary file not shown.
-155 KB
Binary file not shown.
-48.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)