Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Documentation

on:
pull_request:
push:
branches:
- main

jobs:
docs:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"

- name: Install module and doc packages
run: |
python -m pip install --upgrade pip
pip install -e ".[docs]"

- name: Generate documentation
run: sphinx-build -W -b html docs/source docs/build
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ coverage_html_report
# Package build files and folders
*.egg-info/
**/dist/

# Sphinx and documentation auto generated files
docs/build/
docs/source/generated/
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.14"

sphinx:
configuration: docs/source/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pip install -e .

> [!IMPORTANT]
> While every effort is made to maintain a stable API, this module is relatively new so users should not be surprised if there are changes between versions.
> If a breaking change has been introduced, it will always be highlighted in the [CHANGELOG](CHANGELOG.md).
> If a breaking change has been introduced, it will always be highlighted in the [CHANGELOG](https://github.com/php1ic/nuclearmasses/blob/main/CHANGELOG.md).

The combination of AME and NUBASE values from all years is available as a single dataframe
```python
Expand Down
9 changes: 9 additions & 0 deletions docs/source/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# API Reference

```{eval-rst}
.. autosummary::
:toctree: generated
:recursive:

nuclearmasses
```
46 changes: 46 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

from pathlib import Path
import sys
import tomllib

# Get the root path of the project
ROOT = Path(__file__).resolve().parents[2]

sys.path.insert(0, str(ROOT / "src"))

# Project information
with open(ROOT / "pyproject.toml", "rb") as f:
pyproject = tomllib.load(f)

project = pyproject["project"]["name"]
release = pyproject["project"]["version"]
version = release
copyright = "2026, php1ic"
author = "php1ic"

# General configuration
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]

napoleon_numpy_docstring = True
napoleon_google_docstring = False
autosummary_generate = True

exclude_patterns = []

source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}

# Options for HTML output
html_theme = "furo"
2 changes: 2 additions & 0 deletions docs/source/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../README.md
```
11 changes: 11 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# nuclearmasses

Setting up the framework and pipeline. More complete documentation will follow

```{toctree}
:maxdepth: 3

getting_started
api
```

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ dev = [
"ruff"
]

docs = [
"sphinx",
"furo",
"myst-parser",
]

[project.urls]
GitHub = "https://github.com/php1ic/nuclearmasses"
Changelog = "https://github.com/php1ic/nuclearmasses/blob/main/CHANGELOG.md"
Expand Down
Loading