Skip to content

Commit

Permalink
Merge pull request #804 from thewtex/sphinx-docs
Browse files Browse the repository at this point in the history
Sphinx docs
  • Loading branch information
thewtex authored Apr 14, 2023
2 parents 7503181 + a32dd56 commit 45dc6e2
Show file tree
Hide file tree
Showing 51 changed files with 149 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '18.2'
node-version: '18.16'

- name: Install
run: |
Expand Down
28 changes: 24 additions & 4 deletions .github/workflows/python-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
working-directory: ./src/python/itkwasm
working-directory: ./packages/core/python/itkwasm
run: |
python -m pip install --upgrade pip
cd test/test-accelerator
python -m pip install -e "."
cd -
python -m pip install -e ".[test]"
- name: Test with pytest
working-directory: ./src/python/itkwasm
working-directory: ./packages/core/python/itkwasm
run: |
pytest --junitxml=junit/test-results.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
with:
report_paths: 'src/python/itkwasm/junit/test-results*.xml'
report_paths: 'packages/core/python/itkwasm/junit/test-results*.xml'

test-pythonpackages:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -62,4 +62,24 @@ jobs:
working-directory: ./packages/compress-stringify/python/itkwasm-compress-stringify
run: |
python -m pip install -e .
pytest
pytest
build-sphinx-docs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
working-directory: ./packages/core/python/itkwasm
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
python -m pip install hatch
- name: Build Sphinx documentation
working-directory: ./packages/core/python/itkwasm
run: |
hatch run docs:html
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/core/python/itkwasm/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build/
20 changes: 20 additions & 0 deletions packages/core/python/itkwasm/docs/Makefile
Original file line number Diff line number Diff line change
@@ -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 = .
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)
39 changes: 39 additions & 0 deletions packages/core/python/itkwasm/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'itkwasm'
copyright = '2023, NumFOCUS'
author = 'Matt McCormick'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['sphinx.ext.napoleon', 'sphinx.ext.autodoc']

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']

html_theme_options = {
"use_edit_page_button": True,
"github_url": "https://github.com/InsightSoftwareConsortium/itk-wasm",
}

html_context = {
"github_user": "InsightSoftwareConsortium",
"github_repo": "itk-wasm",
"github_version": "main",
"doc_path": "packages/core/python/itkwasm/docs",
}
20 changes: 20 additions & 0 deletions packages/core/python/itkwasm/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. itkwasm documentation master file, created by
sphinx-quickstart on Wed Apr 12 22:41:50 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to itkwasm's documentation!
===================================

.. toctree::
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions packages/core/python/itkwasm/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ test = [
"itk>=5.3.0",
"pytest >=2.7.3",
]
doc = ["sphinx"]

[tool.hatch.envs.docs]
dependencies = [
"sphinx",
"pydata-sphinx-theme",
]

[tool.hatch.envs.docs.scripts]
html = "cd docs && make html"

[tool.hatch.version]
path = "itkwasm/__init__.py"
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 45dc6e2

Please sign in to comment.