Skip to content

Commit f758f68

Browse files
Docs restructuring (#101)
* General structure revamp * Added missing __init__.py and fixed links in sweep.md * Fixed formatting of data_formats * moved from autoapi into the sphinx supported extensions * Removed old mkdocs.yml * switched action trigger * Added requirements to pyproject.toml * fixing sphinx.yml typo * Fixed failed built due to dependencies
1 parent e799547 commit f758f68

38 files changed

+174
-203
lines changed

.github/workflows/sphinx.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: "Sphinx: Render docs"
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
410

511
jobs:
612
build:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ instance/
7171
# Sphinx documentation
7272
docs/_build/
7373
docs/build/
74-
docs/autoapi/
74+
# These files are generated automatically by autosummary
75+
docs/**/*.rst
76+
docs/**/generated
7577
site/
7678

7779
# PyBuilder

docs/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ BUILDDIR = build
1212
help:
1313
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414

15-
.PHONY: help Makefile
15+
.PHONY: help Makefile clean
16+
17+
# Custom clean target to also remove autosummary-generated files
18+
clean:
19+
rm -rf api/generated/
20+
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1621

1722
# Catch-all target: route all unknown targets to Sphinx using the new
1823
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

docs/api/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# API Reference
2+
3+
Complete API documentation for Labcore, generated from docstrings.
4+
5+
```{eval-rst}
6+
.. autosummary::
7+
:toctree: generated
8+
:recursive:
9+
10+
labcore.data
11+
labcore.measurement
12+
labcore.analysis
13+
labcore.utils
14+
```

docs/conf.py

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2121

2222
extensions = [
23-
'myst_parser', # Markdown support
24-
'sphinx.ext.autodoc', # API documentation from docstrings
25-
'sphinx.ext.napoleon', # Support for NumPy and Google style docstrings
26-
'sphinx.ext.viewcode', # Add links to source code
27-
'autoapi.extension', # Automatic API documentation generation
28-
'nbsphinx', # Jupyter notebook support
23+
'myst_parser', # Markdown support
24+
'sphinx.ext.autodoc', # API documentation from docstrings
25+
'sphinx.ext.autosummary', # Generate summary tables for modules
26+
'sphinx.ext.napoleon', # Support for NumPy and Google style docstrings
27+
'sphinx.ext.viewcode', # Add links to source code
28+
'nbsphinx', # Jupyter notebook support
2929
'sphinx.ext.intersphinx', # Link to other project docs
3030
]
3131

@@ -44,19 +44,22 @@
4444
"tasklist", # Task lists
4545
]
4646

47-
# AutoAPI Configuration (replaces mkdocstrings)
48-
autoapi_type = 'python'
49-
autoapi_dirs = ['../labcore']
50-
autoapi_options = [
51-
'members',
52-
'undoc-members',
53-
'show-inheritance',
54-
'show-module-summary',
55-
'imported-members',
56-
]
57-
autoapi_keep_files = False
58-
autoapi_add_toctree_entry = True
59-
autoapi_python_class_content = 'both' # Include both class and __init__ docstrings
47+
# Allow MyST to parse Sphinx roles and directives
48+
myst_enable_roles = True
49+
50+
# Autosummary configuration (auto-generate API docs)
51+
autosummary_generate = True
52+
autosummary_generate_overwrite = True
53+
54+
# Autodoc configuration (required for proper cross-references)
55+
autodoc_default_options = {
56+
'members': True,
57+
'undoc-members': False,
58+
'show-inheritance': True,
59+
}
60+
61+
# MyST configuration for proper cross-references in Markdown
62+
myst_linkify_fuzzy_links = True
6063

6164
# nbsphinx configuration (for Jupyter notebooks)
6265
nbsphinx_execute = 'never' # Don't execute notebooks during build (safer)
@@ -89,6 +92,7 @@
8992
html_baseurl = 'https://toolsforexperiments.github.io/labcore/'
9093

9194
html_theme_options = {
95+
"show_nav_level": 2,
9296
"logo": {
9397
"text": "Labcore",
9498
},

docs/first_steps/first_analysis.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Basic Analysis
2+
3+
The following will be an introductory guide on how to perform analysis.

docs/first_steps/first_data.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Creating Basic Datasets
2+
3+
Here will go how to create the first datasets with basic sweeps.
4+
5+
File structure in disk.
6+
7+
How to load it and use it.

docs/first_steps/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# First Steps
2+
3+
The following pages will help you get familiar with Labcore's tools. They are not meant to be exhaustive but simply an introduction.
4+
5+
```{toctree}
6+
installation
7+
first_data
8+
first_analysis
9+
```

docs/first_steps/installation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Installation
2+
3+
Here will go the installation details. More to come.

docs/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ Labcore is developed by Physicists for real needs happening inside of our lab.
3737
:maxdepth: 2
3838
:caption: Contents
3939
40-
instruments/index
41-
measurement/index
42-
data/index
43-
about
40+
first_steps/index
41+
user_guide/index
4442
```
4543

4644
## Examples
@@ -60,5 +58,5 @@ The API documentation is automatically generated from the source code.
6058
:maxdepth: 1
6159
:caption: API Reference
6260
63-
autoapi/index
61+
api/index
6462
```

0 commit comments

Comments
 (0)