From e9f2d7f394dc226fcbd8192de93d732e688655fc Mon Sep 17 00:00:00 2001 From: Callum Rollo Date: Tue, 29 Oct 2024 13:36:16 +0100 Subject: [PATCH] Create autobuilding docs (#41) * docs skeleton with rtd theme * docs with notebook * publish docs to gh pages --- .github/workflows/docs.yml | 53 +++++++++++++++++++++++++++++++++ docs/Makefile | 20 +++++++++++++ docs/source/_static/glider.jpg | Bin 0 -> 6328 bytes docs/source/conf.py | 41 +++++++++++++++++++++++++ docs/source/glidertest.rst | 7 +++++ docs/source/index.rst | 22 ++++++++++++++ notebooks/demo.ipynb | 11 +++++-- requirements-dev.txt | 4 +++ 8 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/Makefile create mode 100644 docs/source/_static/glider.jpg create mode 100644 docs/source/conf.py create mode 100644 docs/source/glidertest.rst create mode 100644 docs/source/index.rst diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..ddc54d2 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,53 @@ +name: Documentation + +on: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build-docs: + runs-on: ubuntu-latest + + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Micromamba ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v2 + with: + environment-name: TEST + init-shell: bash + create-args: >- + python=3 pip + --file requirements-dev.txt + --channel conda-forge + + - name: Install glidertest + shell: bash -l {0} + run: | + python -m pip install -e . --no-deps --force-reinstall + + - name: Build documentation + shell: bash -l {0} + run: | + set -e + jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb + mv notebooks/*output.ipynb docs/source/ + pushd docs + make clean html + popd + + - name: Deploy + if: success() && github.event_name == 'release' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/html + diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/source/_static/glider.jpg b/docs/source/_static/glider.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a69e0e4597ea31b4a950e4e26281ba743726c1d5 GIT binary patch literal 6328 zcmbVQc{r5a-@lP;WvLnaQXzY?lqF0X(-0a&6k6<(?7OL+q-N|Uhg08`=0xp`#Q_#eDCwQKi~U0=X=w~>9YW@p#jVQU}9nd zQWzINp93!I2f8`|01PG%umb?V1h_^XVcY>gm{EQwW`Oxmj=y?Z7%i5+>p6doF)aK5 zt^q8}%)c`u9bsfvc2?FSM_4)8*p9Lv<2-hZi<67%IQI$OI5_zQ1cij9&&tTk$*W(usG+H)eeJrw0rUpU(A?s- zrPUp4n@0|gPR=f_Za%(#{sDnO!GFArcoq5jO;lpi+vJqgckk13a`W;(q6!L&Dyyo| zHMO7X>f74Cc64ICb#)I7V@F2E#wRA{@biR)#iiwyRpQq64r!N6+1vlkiwR))2d#fH z`)|DX7`&K|9AP=a_L~;7Crz1e4aV>ByzerqGk5%yKq6b zBVK+Ud$n}nq+L7*=;*0O7Y?Ac1qhLY;K(#O&{mG614~V{hdVP=dvT?tcwXe9RfXvobxIuH@?i4F`1wrp&c-R%>~T?2FOZtJ`a)fzLUHbChBf>mO( z)UVN@l~;mW#PlcVn$PI3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