Skip to content

doc: add sphinx

doc: add sphinx #4

Workflow file for this run

name: Build-sphinx-doc
on:
push:
# branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[doc]
pip install ghp-import
- name: Build HTML
env:
TOKEN: ${{ secrets.TOKEN }}
run: |
sed -i '/nb_execution_mode = "off"/d' doc/source/conf.py # enable executing jupyter notebook
cd doc
make html
- name: Remove ampersand encoding and token in the generated html
run: |
# See issues about ampersand encoding at https://github.com/executablebooks/MyST-Parser/issues/760
sed -i 's/amp;//g' doc/build/html/Tutorial/Oceans_3.0_API_Tutorial.html
sed -i 's/token=[a-zA-Z0-9-]\+/token=YOUR_TOKEN/g' doc/build/html/Tutorial/onc_Library_Tutorial.html
- name: Run ghp-import to generate GitHub Pages
run: |
ghp-import -npfo doc/build/html