From ba199dede8c55254c334a8384d5c5ed45ad829de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Thu, 8 Feb 2024 04:39:13 -0300 Subject: [PATCH 1/2] Add mastodon link to footer (#153) --- napari_sphinx_theme/napari-footer-links.html | 6 ++++++ .../partials/mastodon-light-blue.html | 13 +++++++++++++ napari_sphinx_theme/partials/mastodon.html | 15 +++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 napari_sphinx_theme/partials/mastodon-light-blue.html create mode 100644 napari_sphinx_theme/partials/mastodon.html diff --git a/napari_sphinx_theme/napari-footer-links.html b/napari_sphinx_theme/napari-footer-links.html index 64df93a6..472b5511 100644 --- a/napari_sphinx_theme/napari-footer-links.html +++ b/napari_sphinx_theme/napari-footer-links.html @@ -15,6 +15,12 @@ GitHub + + {% include "partials/mastodon.html" %} + {% include "partials/mastodon-light-blue.html" %} + Mastodon + + {% include "partials/twitter.html" %} {% include "partials/twitter-light-blue.html" %} diff --git a/napari_sphinx_theme/partials/mastodon-light-blue.html b/napari_sphinx_theme/partials/mastodon-light-blue.html new file mode 100644 index 00000000..e5e7a32e --- /dev/null +++ b/napari_sphinx_theme/partials/mastodon-light-blue.html @@ -0,0 +1,13 @@ + + + diff --git a/napari_sphinx_theme/partials/mastodon.html b/napari_sphinx_theme/partials/mastodon.html new file mode 100644 index 00000000..9772c5b3 --- /dev/null +++ b/napari_sphinx_theme/partials/mastodon.html @@ -0,0 +1,15 @@ + + + Visit Mastodon page + + From 2a4e5742de4fd967860030684cc3db2ca4397bae Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:15:36 -0500 Subject: [PATCH 2/2] build napari-docs on theme PR (#156) * build napari-docs on theme PR * ensure we clone the theme repo * remove doctrees before uploading artifact * v4 of upload action * fix .doctrees path --- .github/workflows/build_napari.yml | 93 ++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/build_napari.yml diff --git a/.github/workflows/build_napari.yml b/.github/workflows/build_napari.yml new file mode 100644 index 00000000..d09dd5f2 --- /dev/null +++ b/.github/workflows/build_napari.yml @@ -0,0 +1,93 @@ +name: Build napari Docs on PR + +on: + pull_request: + branches: + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-upload: + name: Build & Upload Artifact + runs-on: ubuntu-latest + steps: + - name: Clone napari-sphinx-theme + uses: actions/checkout@v4 + + - name: Clone napari docs repo + uses: actions/checkout@v4 + with: + repository: napari/docs + path: napari-docs # place in a named directory + + - name: Clone napari repo + uses: actions/checkout@v4 + with: + path: napari # place in a named directory + repository: napari/napari + # ensure version metadata is proper + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache-dependency-path: | + napari/setup.cfg + docs/requirements.txt + + - uses: tlambert03/setup-qt-libs@v1 + + - name: Install napari Dependencies + run: | + python -m pip install --upgrade pip + python -m pip install "napari/[all]" + env: + PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt + + - name: Testing + run: | + python -c 'import napari; print(napari.__version__)' + python -c 'import napari.layers; print(napari.layers.__doc__)' + + - name: Install napari-docs Dependencies + run: | + python -m pip install -qr ${{ github.workspace }}/napari-docs/requirements.txt + env: + PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt + + # Build and install the theme package. + - name: Build and install theme + env: + ENV: prod + run: | + pip install --upgrade build ".[doc]" + python -m build + pip install dist/napari_sphinx_theme*.whl + + - name: Build Docs + uses: aganders3/headless-gui@v2 + env: + GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }} + GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }} + PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt + with: + # using html instead of docs will skip installing requirements + run: make -C napari-docs html + # skipping setup stops the action from running the default (tiling) window manager + # the window manager is not necessary for docs builds at this time and it was causing + # problems with screenshots (https://github.com/napari/docs/issues/285) + linux-setup: "echo 'skip setup'" + linux-teardown: "echo 'skip teardown'" + + - name: remove .doctrees folder (400Mb) + run: rm -rf napari-docs/docs/_build/.doctrees + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: napari-docs + path: napari-docs/docs/_build \ No newline at end of file