Skip to content

Commit af690dc

Browse files
committed
Add support for building both main and Python client Sphinx docs in CI
1 parent b579ff2 commit af690dc

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

.github/workflows/sphinx-docs.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,35 @@ jobs:
1919
with:
2020
python-version: '3.10'
2121

22-
- name: Install dependencies
22+
- name: Install dependencies for main docs
23+
working-directory: ./docs
2324
run: |
2425
python -m pip install --upgrade pip
25-
pip install -r docs/requirements.txt
26+
pip install -r requirements.txt
27+
28+
- name: Install dependencies for Python client docs
29+
working-directory: ./client/python/projectairsim/docs
30+
run: |
31+
pip install -r requirements.txt
2632
27-
- name: Build HTML with Sphinx
33+
- name: Build Python client docs
34+
working-directory: ./client/python/projectairsim/docs
35+
run: make html
36+
37+
- name: Build main docs
2838
working-directory: ./docs
2939
run: make html
3040

41+
- name: Copy Python client docs into main docs
42+
run: |
43+
mkdir -p docs/build/html/client_api
44+
cp -r client/python/projectairsim/docs/build/html/* docs/build/html/client_api/
45+
3146
- name: Deploy to gh_page branch
3247
if: github.event_name == 'push'
3348
uses: peaceiris/actions-gh-pages@v3
3449
with:
3550
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./docs/build/html
51+
publish_dir: docs/build/html
3752
publish_branch: gh_page
3853
force_orphan: true

client/python/projectairsim/docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
9-
BUILDDIR = _build
9+
BUILDDIR = build
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:

client/python/projectairsim/docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Add projectairsim src/ folder to the Python path for sphinx to find it
44
import os
55
import sys
6+
7+
import sphinx_rtd_theme
68
sys.path.insert(0, os.path.abspath("../src"))
79

810
project = 'Project AirSim'
@@ -19,5 +21,5 @@
1921
# -- Options for HTML output -------------------------------------------------
2022
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
2123

22-
html_theme = 'haiku'
23-
html_static_path = ['_static']
24+
html_theme = 'sphinx_rtd_theme'
25+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

0 commit comments

Comments
 (0)