Skip to content

Commit 5933197

Browse files
author
elwaagaa
committed
Fixed documentation
1 parent 944257a commit 5933197

File tree

2 files changed

+65
-5
lines changed

2 files changed

+65
-5
lines changed

docs/conf.py

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,72 @@
1616

1717

1818
# -- Project information -----------------------------------------------------
19+
import os
20+
import sys
21+
22+
# Add project root to Python path
23+
sys.path.insert(0, os.path.abspath('..'))
1924

2025
project = 'fma_ions'
2126
copyright = '2025, Elias Waagaard'
2227
author = 'Elias Waagaard'
2328

29+
# The full version, including alpha/beta/rc tags
30+
from fma_ions import __version__
31+
release = __version__
32+
version = '.'.join(release.split('.')[:2]) # Short X.Y version
2433

2534
# -- General configuration ---------------------------------------------------
26-
2735
# 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.
36+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3037
extensions = [
38+
'sphinx.ext.autodoc',
39+
'sphinx.ext.napoleon',
40+
'sphinx.ext.mathjax',
41+
'sphinx.ext.viewcode',
42+
'sphinx.ext.intersphinx',
43+
'sphinx.ext.autosummary',
44+
'autoapi.extension',
45+
'sphinx_rtd_theme',
3146
]
3247

48+
# AutoAPI configuration
49+
autoapi_type = 'python'
50+
autoapi_dirs = ['../fma_ions']
51+
autoapi_ignore = ['*/tests/*', '*/data/*']
52+
autoapi_options = [
53+
'members',
54+
'undoc-members',
55+
'show-inheritance',
56+
'show-module-summary',
57+
'special-members',
58+
'imported-members',
59+
]
60+
61+
# Add any paths that contain templates here, relative to this directory.
62+
templates_path = ['_templates']
63+
64+
# List of patterns, relative to source directory, that match files and
65+
# directories to ignore when looking for source files.
66+
# This pattern also affects html_static_path and html_extra_path.
67+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
68+
69+
# -- Options for HTML output -------------------------------------------------
70+
html_theme = 'sphinx_rtd_theme'
71+
72+
# Add any paths that contain custom static files (such as style sheets) here,
73+
# relative to this directory. They are copied after the builtin static files,
74+
# so a file named "default.css" will overwrite the builtin "default.css".
75+
html_static_path = ['_static']
76+
77+
# -- Extension configuration -------------------------------------------------
78+
# Intersphinx configuration
79+
intersphinx_mapping = {
80+
'python': ('https://docs.python.org/3', None),
81+
'numpy': ('https://numpy.org/doc/stable/', None),
82+
'matplotlib': ('https://matplotlib.org/stable/', None),
83+
}
84+
3385
# Add any paths that contain templates here, relative to this directory.
3486
templates_path = ['_templates']
3587

@@ -44,7 +96,8 @@
4496
# The theme to use for HTML and HTML Help pages. See the documentation for
4597
# a list of builtin themes.
4698
#
47-
html_theme = 'alabaster'
99+
html_theme = 'sphinx_rtd_theme'
100+
#'alabaster'
48101

49102
# Add any paths that contain custom static files (such as style sheets) here,
50103
# relative to this directory. They are copied after the builtin static files,

docs/index.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,21 @@ Quick Start
8383
fma.plot_tune_diagram(Qx, Qy, d)
8484
8585
API Reference
86-
------------
86+
============
8787

8888
.. toctree::
8989
:maxdepth: 2
9090
:caption: API Reference
9191

9292
autoapi/index
9393

94+
If the API reference doesn't appear, make sure you have run:
95+
96+
.. code-block:: bash
97+
98+
sphinx-apidoc -o docs/autoapi/ ../fma_ions/
99+
make html
100+
94101
Indices and tables
95102
==================
96103
* :ref:`genindex`

0 commit comments

Comments
 (0)