Skip to content

Commit 41c072e

Browse files
authored
Merge pull request #30 from BlockScience/docs
Docs
2 parents b8ea375 + 5786664 commit 41c072e

85 files changed

Lines changed: 1191 additions & 27 deletions

File tree

Some content is hidden

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

.github/workflows/docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
name: Build Sphinx docs
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.x"
28+
29+
- name: Install project with docs dependencies
30+
run: pip install -e ".[docs]"
31+
32+
- name: Build docs
33+
run: sphinx-build -b html docs docs/_build/html
34+
35+
- name: Upload pages artifact
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: docs/_build/html
39+
40+
deploy:
41+
name: Deploy to GitHub Pages
42+
needs: build
43+
runs-on: ubuntu-latest
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deploy.outputs.page_url }}
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deploy
50+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ __pycache__/
33
/.venv/
44
/build/
55
/dist/
6-
/docs/
76
/tests/
87
/prototypes/
98
.rid_cache/
@@ -12,3 +11,5 @@ __pycache__/
1211
*.yaml
1312
*.egg-info
1413
*.ndjson*
14+
docs/_build/
15+
docs/build/

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# KOI-net
22

3+
[![PyPI](https://img.shields.io/pypi/v/koi-net)](https://pypi.org/project/koi-net/)
4+
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://blockscience.github.io/koi-net/index.html)
5+
36
*This specification is the result of several iterations of KOI research, [read more here](https://github.com/BlockScience/koi).*
47

58
### Jump to Sections:

docs/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Building the docs
2+
3+
Install docs dependencies (if not already):
4+
5+
```bash
6+
uv sync --extra docs
7+
```
8+
9+
Build HTML:
10+
11+
```bash
12+
uv run sphinx-build -b html docs docs/_build/html
13+
```
14+
15+
Then open `docs/_build/html/index.html` in a browser. The **API Reference** page is generated by `sphinx.ext.autodoc`; if you see docstrings for `koi_net.core`, `koi_net.exceptions`, and `koi_net.components.cache`, autodoc is working.

docs/_static/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Sphinx leaves this directory in the tree; keep for version control.

docs/api.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
API Reference
2+
=============
3+
4+
This page is generated by ``sphinx.ext.autodoc``. If you see module and
5+
member docstrings below, autodoc is working.
6+
7+
Components
8+
----------
9+
10+
.. autosummary::
11+
:toctree: generated
12+
:recursive:
13+
:nosignatures:
14+
15+
koi_net

docs/conf.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
# See https://www.sphinx-doc.org/en/master/usage/configuration.html
3+
4+
import os
5+
import sys
6+
7+
# Add project src so koi_net is importable for autodoc
8+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
9+
10+
project = "koi-net"
11+
copyright = "Block Science"
12+
author = "Luke Miller"
13+
release = "1.3.0-beta.9"
14+
15+
extensions = [
16+
"sphinx.ext.autodoc",
17+
"sphinx.ext.autosummary",
18+
"sphinx.ext.viewcode",
19+
"sphinx_autodoc_typehints",
20+
]
21+
22+
templates_path = ["_templates"]
23+
exclude_patterns = []
24+
25+
html_theme = "sphinx_rtd_theme"
26+
html_static_path = ["_static"]
27+
28+
# Autodoc settings
29+
autodoc_default_options = {
30+
"members": True,
31+
"undoc-members": True,
32+
"show-inheritance": True,
33+
}
34+
autodoc_typehints = "description"
35+
autosummary_generate = True

docs/generated/koi_net.base.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
koi\_net.base
2+
=============
3+
4+
.. automodule:: koi_net.base
5+
6+
7+
.. rubric:: Classes
8+
9+
.. autosummary::
10+
11+
BaseAssembly
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
koi\_net.components.cache
2+
=========================
3+
4+
.. automodule:: koi_net.components.cache
5+
6+
7+
.. rubric:: Classes
8+
9+
.. autosummary::
10+
11+
Cache
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
koi\_net.components.config\_provider
2+
====================================
3+
4+
.. automodule:: koi_net.components.config_provider
5+
6+
7+
.. rubric:: Classes
8+
9+
.. autosummary::
10+
11+
ConfigProvider
12+

0 commit comments

Comments
 (0)