-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation set up with Sphinx (#200)
Supersedes #173 May close #80 @melissawm implements the sphinx documentation setup, similar to the napari/docs repository documentation setup @GenevieveBuckley adds scrapers for the examples gallery (for videos and static napari screenshots), and adds the github actions docs deployment
- Loading branch information
Showing
24 changed files
with
761 additions
and
51 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,60 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
# Only allow one docs build at a time so that overlapping stale builds will get | ||
# cancelled automatically. | ||
concurrency: | ||
group: deploy_docs | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build & Deploy | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # so we can write to github pages without a token | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- uses: tlambert03/setup-qt-libs@v1 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install "napari[all]" | ||
python -m pip install -e ".[doc]" | ||
- name: Build Docs | ||
uses: aganders3/headless-gui@v2 | ||
with: | ||
run: make docs | ||
|
||
- name: Check file tree contents | ||
run: tree | ||
|
||
# At a minimum this job should upload artifacts using actions/upload-pages-artifact | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
name: github-pages | ||
path: docs/_build | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |
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
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,46 @@ | ||
.PHONY: docs clean | ||
|
||
SPHINXOPTS = | ||
|
||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
current_dir := $(dir $(mkfile_path)) | ||
docs_dir := $(current_dir)docs | ||
|
||
clean: | ||
echo clean | ||
echo $(current_dir) | ||
rm -rf $(docs_dir)/_build/ | ||
rm -rf $(docs_dir)/gallery/ | ||
rm -f $(docs_dir)/sg_execution_times.rst | ||
|
||
docs-build: | ||
NAPARI_CONFIG="" NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b html docs/ docs/_build $(SPHINXOPTS) | ||
|
||
docs-xvfb: | ||
NAPARI_CONFIG="" NAPARI_APPLICATION_IPY_INTERACTIVE=0 xvfb-run --auto-servernum sphinx-build -b html docs/ docs/_build $(SPHINXOPTS) | ||
|
||
docs: clean docs-build copy-gallery-videos | ||
|
||
# Implies noplot, but no clean - call 'make clean' manually if needed | ||
# Autogenerated paths need to be ignored to prevent reload loops | ||
html-live: | ||
NAPARI_APPLICATION_IPY_INTERACTIVE=0 \ | ||
sphinx-autobuild \ | ||
-b html \ | ||
docs/ \ | ||
docs/_build \ | ||
-D plot_gallery=0 \ | ||
--ignore $(docs_dir)"/gallery/*" \ | ||
--ignore $(docs_dir)"/jupyter_execute/*" \ | ||
--open-browser \ | ||
--port=0 \ | ||
$(SPHINXOPTS) | ||
|
||
html-noplot: clean | ||
NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -D plot_gallery=0 -b html docs/ docs/_build $(SPHINXOPTS) | ||
|
||
linkcheck-files: | ||
NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b linkcheck -D plot_gallery=0 --color docs/ docs/_build ${FILES} $(SPHINXOPTS) | ||
|
||
copy-gallery-videos: | ||
rsync -rupE docs/gallery/images docs/_build/gallery |
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
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 @@ | ||
<!-- A small template snippet for theme testing --> | ||
<a class="navbar-brand" href="{{ pathto(master_doc) }}"> | ||
napari-animation | ||
</a> |
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,5 @@ | ||
root: index | ||
subtrees: | ||
- entries: | ||
- file: gallery | ||
- file: developers/contributing |
Oops, something went wrong.