-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from OceanNetworksCanada/issue-7-add-sphinx-doc
Issue 7 add sphinx doc
- Loading branch information
Showing
34 changed files
with
4,715 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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 | ||
sphinx-build -W doc/source doc/build/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 | ||
# Some cell outputs in the Jupyter notebook contain the token | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,3 +150,6 @@ dmypy.json | |
|
||
# commit-msg hook | ||
commit-msg | ||
|
||
# Mac OS specfic | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.