Skip to content

Commit f04dff7

Browse files
authored
docs: add sphinx docs and rtd site config (#74)
Close #56 - move examples folder from the root to docs/examples/... - setup sphinx configuration with nbsphinx for notebooks - convert notebooks to jupytext light format python scripts - setup readthedocs site configuration
1 parent 236da4b commit f04dff7

88 files changed

Lines changed: 734 additions & 1638 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,19 @@ dmypy.json
140140
uv.lock
141141

142142
# temporary test folders
143-
autotest/temp/**
143+
autotest/temp/**
144+
145+
# notebooks
146+
docs/examples/notebooks/*.ipynb
147+
148+
# autosummary
149+
docs/_autosummary/
150+
151+
# mf6 output files
152+
**/*.lst
153+
**/*.stdout
154+
**/*.cbc
155+
**/*.cbb
156+
**/*.hds
157+
**/*.hed
158+
**/*.grb

.readthedocs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
build:
3+
os: "ubuntu-24.04"
4+
tools:
5+
python: "3.13"
6+
sphinx:
7+
configuration: docs/conf.py
8+
formats:
9+
- pdf
10+
python:
11+
install:
12+
- method: pip
13+
path: .
14+
extra_requirements:
15+
- docs

README.md

Lines changed: 3 additions & 1 deletion

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os
7+
import sys
8+
sys.path.insert(0, os.path.abspath('../'))
9+
10+
# -- Project information -----------------------------------------------------
11+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
12+
project = 'modflowapi'
13+
copyright = '2025, modflowapi developers'
14+
author = 'modflowapi developers'
15+
release = '0.3.0.dev0'
16+
17+
# -- General configuration ---------------------------------------------------
18+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
19+
extensions = [
20+
"sphinx.ext.autodoc",
21+
"sphinx.ext.autosummary",
22+
"myst_parser",
23+
"nbsphinx"
24+
]
25+
templates_path = ['_templates']
26+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**/Extensions.py']
27+
28+
# -- Options for HTML output -------------------------------------------------
29+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
30+
html_theme = 'sphinx_rtd_theme'
31+
html_static_path = ['_static']
32+
33+
# -- nbsphinx configuration -------------------------------------------------
34+
nbsphinx_custom_formats = {
35+
'.py': ['jupytext.reads', {'fmt': 'py:light'}],
36+
}

0 commit comments

Comments
 (0)