-
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.
Generate API documentation using Sphinx.
- Loading branch information
1 parent
f72525e
commit 09b0a91
Showing
5 changed files
with
128 additions
and
1 deletion.
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,51 @@ | ||
name: Build Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
jobs: | ||
build: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Set up Python | ||
id: setup_python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Cache pip | ||
uses: actions/cache@v3 | ||
id: pip-cache | ||
with: | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
path: ${{ env.pythonLocation }} | ||
if: steps.pip-cache.outputs.cache-hit != 'true' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Build html | ||
run: | | ||
sphinx-apidoc -o doc src | ||
cd doc/ | ||
make html | ||
- name: Upload docs artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'doc/_build/html' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 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 | ||
|
||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath("..")) | ||
|
||
project = 'TF2.4 IVIM MRI Code Collection' | ||
copyright = '2024, OSIPI' | ||
author = 'OSIPI team' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = ["sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx.ext.autodoc"] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['Thumbs.db', '.DS_Store'] | ||
|
||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. | ||
html_show_sphinx = False | ||
|
||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. | ||
html_show_copyright = False | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'sphinx_rtd_theme' | ||
html_static_path = ['_static'] |
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,18 @@ | ||
.. TF2.4 IVIM MRI Code Collection documentation master file, created by | ||
sphinx-quickstart on Wed Mar 6 00:06:13 2024. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to TF2.4 IVIM MRI Code Collection's documentation! | ||
========================================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
modules | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`modindex` |
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 |
---|---|---|
|
@@ -10,4 +10,6 @@ scienceplots | |
cvxpy | ||
zenodo-get | ||
pytest | ||
tqdm | ||
tqdm | ||
sphinx | ||
sphinx_rtd_theme |