Skip to content

Commit 8220f56

Browse files
authored
Migrate documentation build to mkdocs (#60)
1 parent 7f0b729 commit 8220f56

37 files changed

+1645
-1960
lines changed

.github/workflows/docs.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: docs
2+
permissions:
3+
contents: write
4+
pull-requests: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .pre-commit-config.yaml
12+
- .github/workflows/docs.yml
13+
- '**.py'
14+
- '**.ipynb'
15+
- '**.html'
16+
- '**.js'
17+
- '**.md'
18+
- uv.lock
19+
- pyproject.toml
20+
- mkdocs.yml
21+
- '**.png'
22+
- '**.svg'
23+
pull_request:
24+
branches:
25+
- main
26+
paths:
27+
- .pre-commit-config.yaml
28+
- .github/workflows/docs.yml
29+
- '**.py'
30+
- '**.ipynb'
31+
- '**.js'
32+
- '**.html'
33+
- uv.lock
34+
- pyproject.toml
35+
- '**.md'
36+
- mkdocs.yml
37+
- '**.png'
38+
- '**.svg'
39+
40+
jobs:
41+
build:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/[email protected]
46+
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
49+
with:
50+
version: "0.5.21"
51+
enable-cache: true
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
55+
with:
56+
python-version-file: ".python-version"
57+
58+
- name: Install the project
59+
run: uv sync --all-extras --all-groups
60+
61+
- name: Build docs
62+
run: uv run mkdocs build
63+
64+
- name: Create .nojekyll file
65+
run: touch site/.nojekyll
66+
67+
- name: Upload artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: docs-site
71+
path: site/
72+
retention-days: 1
73+
74+
deploy:
75+
needs: build
76+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Checkout code
80+
uses: actions/[email protected]
81+
82+
- name: Configure Git Credentials
83+
run: |
84+
git config user.name github-actions[bot]
85+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
86+
87+
- name: Download artifact
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: docs-site
91+
path: site
92+
93+
- name: Ensure .nojekyll exists
94+
run: touch site/.nojekyll
95+
96+
- name: Deploy to Github pages
97+
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8
98+
with:
99+
branch: github_pages
100+
folder: site

.github/workflows/docs_build.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/docs_deploy.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ repos:
1212
- id: mixed-line-ending
1313
args: [--fix=lf]
1414
- id: detect-private-key
15+
- id: check-byte-order-marker
16+
- id: check-merge-conflict
17+
- id: check-symlinks
1518
- id: check-yaml
19+
args: [--unsafe]
1620
- id: check-toml
1721

1822
- repo: https://github.com/astral-sh/uv-pre-commit

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/api.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# API Reference
2+
3+
## Top Level Module
4+
5+
::: mmlearn
6+
options:
7+
show_root_heading: true
8+
show_root_full_path: true
9+
10+
## CLI Module
11+
12+
::: mmlearn.cli
13+
options:
14+
show_root_heading: true
15+
show_root_full_path: true
16+
17+
## Configuration Module
18+
19+
::: mmlearn.conf
20+
options:
21+
show_root_heading: true
22+
show_root_full_path: true
23+
24+
## Datasets Module
25+
26+
::: mmlearn.datasets
27+
options:
28+
show_root_heading: true
29+
show_root_full_path: true
30+
31+
### Core Datasets Components
32+
33+
::: mmlearn.datasets.core
34+
options:
35+
show_root_heading: true
36+
show_root_full_path: true
37+
38+
### Dataset Processors
39+
40+
::: mmlearn.datasets.processors
41+
options:
42+
show_root_heading: true
43+
show_root_full_path: true
44+
45+
## Modules
46+
47+
::: mmlearn.modules
48+
options:
49+
show_root_heading: true
50+
show_root_full_path: true
51+
52+
### Encoders
53+
54+
::: mmlearn.modules.encoders
55+
options:
56+
show_root_heading: true
57+
show_root_full_path: true
58+
59+
### Layers
60+
61+
::: mmlearn.modules.layers
62+
options:
63+
show_root_heading: true
64+
show_root_full_path: true
65+
66+
### Losses
67+
68+
::: mmlearn.modules.losses
69+
options:
70+
show_root_heading: true
71+
show_root_full_path: true
72+
73+
### Learning Rate Schedulers
74+
75+
::: mmlearn.modules.lr_schedulers
76+
options:
77+
show_root_heading: true
78+
show_root_full_path: true
79+
80+
### Metrics
81+
82+
::: mmlearn.modules.metrics
83+
options:
84+
show_root_heading: true
85+
show_root_full_path: true
86+
87+
## Tasks
88+
89+
::: mmlearn.tasks
90+
options:
91+
show_root_heading: true
92+
show_root_full_path: true
93+
94+
## Utilities
95+
96+
::: mmlearn.hf_utils
97+
options:
98+
show_root_heading: true
99+
show_root_full_path: true
100+
101+
::: mmlearn.constants
102+
options:
103+
show_root_heading: true
104+
show_root_full_path: true

docs/assets/favicon-48x48.svg

Lines changed: 9 additions & 0 deletions
Loading

docs/assets/favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)