-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Sphinx for documentation instead of mkdocs
- Loading branch information
Showing
16 changed files
with
1,397 additions
and
1,927 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,64 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Build and test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_call: | ||
outputs: | ||
version: | ||
description: "The version retrieved from the pyproject.toml file." | ||
value: ${{ jobs.build-and-test.outputs.version }} | ||
|
||
jobs: | ||
build-and-test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.9'] | ||
outputs: | ||
version: ${{ steps.get_version.outputs.version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Get the version from pyproject.toml | ||
- name: Install toml package | ||
run: pip install toml | ||
- name: Get version from pyproject.toml | ||
id: get_version | ||
run: | | ||
VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])") | ||
echo Version: $VERSION | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install poetry | ||
poetry install | ||
- name: Build the docs # just to see whether the build passes | ||
run: | | ||
poetry run make html --directory docs | ||
- name: Test with pytest | ||
run: | | ||
poetry run pytest | ||
# TODO: run pytype here? | ||
- name: Build the package | ||
run: | | ||
poetry build | ||
- name: Archive build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist/ |
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,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) |
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
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,58 @@ | ||
# 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 = 'tsdf' | ||
copyright = '2024, Netherlands eScience Center' | ||
author = 'Netherlands eScience Center' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
|
||
# General configuration | ||
extensions = [ | ||
"myst_nb", | ||
"autoapi.extension", | ||
'sphinx.ext.napoleon', | ||
'sphinx.ext.viewcode', | ||
] | ||
autoapi_dirs = ['../src'] | ||
autoapi_add_toctree_entry = False | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
# Options for HTML output | ||
html_theme = 'sphinx_rtd_theme' | ||
html_theme_options = { | ||
'canonical_url': 'https://biomarkersparkinson.github.io/tsdf/', | ||
} | ||
|
||
html_static_path = ['_static'] | ||
|
||
# Keep the main TOC always visible | ||
html_sidebars = { | ||
'**': [ | ||
'globaltoc.html', # Add this line | ||
'relations.html', # needs 'show_related': True theme option to display | ||
'sourcelink.html', | ||
'searchbox.html', | ||
] | ||
} | ||
|
||
# Repository settings | ||
html_context = { | ||
"display_github": True, # Integrate GitHub | ||
"github_user": "biomarkersParkinson", # Username | ||
"github_repo": "tsdf", # Repo name | ||
"github_version": "main", # Version | ||
"conf_py_path": "/docs/", # Path in the checkout to the docs root | ||
} | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
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,35 @@ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Getting Started | ||
|
||
introduction | ||
installation | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: The format | ||
|
||
tsdf_fields_table | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Usage | ||
|
||
basic_reading_and_writing_numpy | ||
basic_reading_and_writing_pandas | ||
writing_data_from_scratch | ||
converting_legacy_data | ||
validating_files | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: API Reference | ||
|
||
autoapi/tsdf/index | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: About | ||
|
||
contact |
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
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,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 |
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,3 @@ | ||
myst-nb | ||
sphinx-autoapi | ||
sphinx-rtd-theme |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.