Skip to content

Commit 944257a

Browse files
author
elwaagaa
committed
Fixed sphinx documentation
1 parent 0eec2c2 commit 944257a

File tree

2 files changed

+60
-81
lines changed

2 files changed

+60
-81
lines changed

docs/conf.py

Lines changed: 25 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,52 @@
11
# Configuration file for the Sphinx documentation builder.
22
#
3-
# For the full list of built-in configuration values, see the documentation:
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
45
# https://www.sphinx-doc.org/en/master/usage/configuration.html
56

6-
import os
7-
import sys
8-
from datetime import datetime
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
916

10-
# Add project root to Python path
11-
sys.path.insert(0, os.path.abspath('..'))
1217

1318
# -- Project information -----------------------------------------------------
14-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1519

1620
project = 'fma_ions'
17-
copyright = f'{datetime.now().year}, {author}'
21+
copyright = '2025, Elias Waagaard'
1822
author = 'Elias Waagaard'
1923

20-
# The full version, including alpha/beta/rc tags
21-
from fma_ions import __version__
22-
release = __version__
23-
version = '.'.join(release.split('.')[:2]) # Short X.Y version
2424

2525
# -- General configuration ---------------------------------------------------
26-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2726

27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
2830
extensions = [
29-
'sphinx.ext.autodoc',
30-
'sphinx.ext.napoleon',
31-
'sphinx.ext.mathjax',
32-
'sphinx.ext.todo',
33-
'sphinx.ext.viewcode',
34-
'sphinx.ext.intersphinx',
35-
'sphinx_copybutton',
36-
'myst_parser',
37-
'autoapi.extension',
38-
]
39-
40-
# AutoAPI configuration
41-
autoapi_type = 'python'
42-
autoapi_dirs = ['../fma_ions']
43-
autoapi_ignore = ['*/tests/*', '*/data/*']
44-
autoapi_options = [
45-
'members',
46-
'undoc-members',
47-
'show-inheritance',
48-
'show-module-summary',
49-
'special-members',
50-
'imported-members',
51-
]
52-
53-
# MyST configuration
54-
myst_enable_extensions = [
55-
'dollarmath',
56-
'amsmath',
57-
'colon_fence',
5831
]
5932

33+
# Add any paths that contain templates here, relative to this directory.
6034
templates_path = ['_templates']
61-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
6235

63-
# The suffix of source filenames.
64-
source_suffix = {
65-
'.rst': 'restructuredtext',
66-
'.md': 'markdown',
67-
}
36+
# List of patterns, relative to source directory, that match files and
37+
# directories to ignore when looking for source files.
38+
# This pattern also affects html_static_path and html_extra_path.
39+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
6840

69-
# The master toctree document.
70-
master_doc = 'index'
7141

7242
# -- Options for HTML output -------------------------------------------------
73-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
7443

75-
html_theme = 'sphinx_rtd_theme'
76-
html_static_path = ['_static']
77-
html_theme_options = {
78-
'navigation_depth': 4,
79-
'collapse_navigation': False,
80-
'sticky_navigation': True,
81-
}
44+
# The theme to use for HTML and HTML Help pages. See the documentation for
45+
# a list of builtin themes.
46+
#
47+
html_theme = 'alabaster'
8248

8349
# Add any paths that contain custom static files (such as style sheets) here,
8450
# relative to this directory. They are copied after the builtin static files,
8551
# so a file named "default.css" will overwrite the builtin "default.css".
86-
html_static_path = ['_static']
87-
88-
# -- Options for todo extension ----------------------------------------------
89-
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration
90-
91-
todo_include_todos = True
92-
93-
# -- Extension configuration -------------------------------------------------
94-
95-
# Add any paths that contain templates here, relative to this directory.
96-
templates_path = ['_templates']
97-
98-
# The language for content autogenerated by Sphinx. Refer to documentation
99-
# for a list of supported languages.
100-
language = 'en'
101-
102-
# -- Options for intersphinx extension ---------------------------------------
103-
# Example configuration for intersphinx: refer to the Python standard library.
104-
intersphinx_mapping = {
105-
'python': ('https://docs.python.org/3', None),
106-
'numpy': ('https://numpy.org/doc/stable/', None),
107-
'matplotlib': ('https://matplotlib.org/stable/', None),
108-
}
52+
html_static_path = ['_static']

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)