Skip to content

Commit dd7e36f

Browse files
authored
Merge pull request #5 from SFTtech/milo/sphinx-docs
docs: add initial docs structure using sphinx
2 parents 2ca47fb + 94a8e22 commit dd7e36f

File tree

11 files changed

+662
-1
lines changed

11 files changed

+662
-1
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ jobs:
6161
- name: Run Ruff Format Check
6262
run: uv run ruff format --check
6363

64+
docs:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v5
68+
- name: Set up Python
69+
uses: actions/setup-python@v6
70+
with:
71+
python-version: "3.12"
72+
- name: Install uv
73+
uses: astral-sh/setup-uv@v6
74+
with:
75+
enable-cache: true
76+
- name: Install the project
77+
run: uv sync --locked --all-extras --dev
78+
- name: Run sphinx-build
79+
run: uv run sphinx-build docs docs/_build
80+
6481
unit-tests:
6582
runs-on: ${{ matrix.os }}
6683
strategy:

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,12 @@ Setup:
5656
uv sync
5757
uv run pre-commit install
5858
```
59+
60+
Build the documentation
61+
62+
```bash
63+
# oneshot build
64+
uv run sphinx-build docs docs/_build
65+
# continous serving
66+
uv run sphinx-autobuild docs docs/_build
67+
```

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/_build

docs/conf.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
from datetime import date
9+
10+
project = "debmagic"
11+
copyright = f"{date.today().year}, Debmagic Authors"
12+
author = "Debmagic Authors"
13+
14+
master_doc = "index"
15+
language = "en"
16+
17+
extensions = [
18+
"sphinx_copybutton",
19+
"myst_parser",
20+
]
21+
myst_enable_extensions = [
22+
"colon_fence",
23+
]
24+
25+
templates_path = ["_templates"]
26+
exclude_patterns = ["_build"]
27+
28+
# html settings
29+
30+
html_theme = "sphinx_rtd_theme"
31+
html_static_path = ["_static"]
32+
html_context = {
33+
"display_github": True,
34+
"github_user": "SFTtech",
35+
"github_repo": "debmagic",
36+
"github_version": "main",
37+
"conf_py_path": "/docs/",
38+
}

docs/develop/_changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
```{include} ../../debian/changelog
4+
:relative-docs: docs/
5+
:relative-images:
6+
```

docs/develop/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Contribute
2+
3+
This section covers documentation relevant to developing and maintaining the debmagic
4+
codebase, and some guidelines for how you can contribute.
5+
6+
```{toctree}
7+
```

docs/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# debmagic
2+
3+
```{toctree}
4+
:hidden:
5+
:caption: Usage
6+
7+
usage/getting-started.md
8+
usage/installation.md
9+
```
10+
11+
```{toctree}
12+
:hidden:
13+
:caption: Development
14+
15+
develop/index.md
16+
```
17+
18+
```{toctree}
19+
:hidden:
20+
:caption: 📖 Reference
21+
22+
develop/_changelog.md
23+
```

docs/usage/getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Getting Started
2+

docs/usage/installation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Installation

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,21 @@ requires = ["setuptools>=77.0.0", "setuptools-scm"]
2323
build-backend = "setuptools.build_meta"
2424

2525
[dependency-groups]
26-
dev = ["pytest>=9.0.1", "pytest-cov>=7.0.0", "ruff", "pre-commit", "mypy"]
26+
dev = [
27+
{ include-group = "docs" },
28+
"pytest>=9.0.1",
29+
"pytest-cov>=7.0.0",
30+
"ruff",
31+
"pre-commit",
32+
"mypy",
33+
]
34+
docs = [
35+
"sphinx>=8.2.3,<9",
36+
"myst-parser>=4.0.1",
37+
"sphinx-autobuild>=2025.8.25",
38+
"sphinx-copybutton>=0.5.2",
39+
"sphinx-rtd-theme>=3.0.2",
40+
]
2741

2842
[tool.mypy]
2943
mypy_path = '$MYPY_CONFIG_FILE_DIR/src'

0 commit comments

Comments
 (0)