Skip to content

Commit c1fd5ab

Browse files
committed
docs: add readthedocs site with notebook landing and api page
1 parent 84eeec1 commit c1fd5ab

6 files changed

Lines changed: 405 additions & 0 deletions

File tree

.readthedocs.yaml

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

docs/_static/custom.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:root {
2+
--pst-color-primary: #155fa0;
3+
--pst-color-secondary: #15806b;
4+
}
5+
6+
.hero {
7+
padding: 1rem 1.25rem;
8+
border: 1px solid var(--pst-color-border);
9+
border-radius: 0.75rem;
10+
background: linear-gradient(120deg, #f2f7fb 0%, #f8fcfb 100%);
11+
margin-bottom: 1.25rem;
12+
}
13+
14+
.hero h1 {
15+
margin-bottom: 0.4rem;
16+
}
17+
18+
.hero p {
19+
margin: 0;
20+
}

docs/api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# API Reference
2+
3+
```{eval-rst}
4+
.. autoclass:: remode.ReMoDe
5+
:members:
6+
:undoc-members:
7+
```
8+
9+
```{eval-rst}
10+
.. autofunction:: remode.perform_fisher_test
11+
```
12+
13+
```{eval-rst}
14+
.. autofunction:: remode.perform_binomial_test
15+
```

docs/conf.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"""Sphinx configuration for ReMoDe docs."""
2+
3+
from __future__ import annotations
4+
5+
from importlib.metadata import PackageNotFoundError, version as pkg_version
6+
from pathlib import Path
7+
import sys
8+
9+
ROOT = Path(__file__).resolve().parents[1]
10+
sys.path.insert(0, str(ROOT))
11+
12+
project = "ReMoDe"
13+
author = "ReMoDe contributors"
14+
15+
try:
16+
release = pkg_version("remode")
17+
except PackageNotFoundError:
18+
release = "0+unknown"
19+
version = release
20+
21+
extensions = [
22+
"myst_nb",
23+
"sphinx.ext.autodoc",
24+
"sphinx.ext.napoleon",
25+
"sphinx_copybutton",
26+
"sphinx_design",
27+
]
28+
29+
templates_path = ["_templates"]
30+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
31+
32+
autodoc_member_order = "bysource"
33+
autodoc_mock_imports = ["numpy", "pandas", "scipy", "matplotlib"]
34+
suppress_warnings = ["myst.header"]
35+
36+
myst_enable_extensions = ["colon_fence", "deflist"]
37+
38+
nb_execution_mode = "off"
39+
nb_execution_show_tb = False
40+
41+
html_theme = "pydata_sphinx_theme"
42+
html_title = "ReMoDe documentation"
43+
html_static_path = ["_static"]
44+
html_css_files = ["custom.css"]
45+
html_theme_options = {
46+
"github_url": "https://github.com/sodascience/remode",
47+
"show_toc_level": 2,
48+
"navigation_with_keys": True,
49+
}

docs/index.ipynb

Lines changed: 297 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ classifiers = [
4040
test = [
4141
"ruff", "pytest", "mypy"
4242
]
43+
docs = [
44+
"sphinx>=7,<9",
45+
"pydata-sphinx-theme>=0.15",
46+
"myst-parser>=2,<5",
47+
"myst-nb>=1,<2",
48+
"sphinx-copybutton>=0.5",
49+
"sphinx-design>=0.6"
50+
]
4351

4452
[tool.setuptools_scm]
4553
write_to = "remode/_version.py"

0 commit comments

Comments
 (0)