|
| 1 | +"""Sphinx configuration file for powersensor_local documentation.""" |
| 2 | + |
| 3 | +import sys |
| 4 | +from pathlib import Path |
| 5 | + |
| 6 | +# Add the package to the Python path |
| 7 | +project_root = Path(__file__).parent.parent.parent |
| 8 | +sys.path.insert(0, str(project_root / "src")) |
| 9 | +print(project_root) |
| 10 | + |
| 11 | +# Project information |
| 12 | +project = "powersensor_local" |
| 13 | +copyright = "2025, DiUS" # noqa A001 |
| 14 | +author = "Powersensor Team!" |
| 15 | + |
| 16 | +html_favicon = "_static/powersensor-logo.png" |
| 17 | +html_logo = "_static/powersensor-logo.png" |
| 18 | + |
| 19 | +# The full version, including alpha/beta/rc tags |
| 20 | +try: |
| 21 | + from powersensor_local import __version__ as release |
| 22 | +except ImportError: |
| 23 | + release = "0.1.0" |
| 24 | + |
| 25 | +version = ".".join(release.split(".")[:2]) |
| 26 | + |
| 27 | +# Extensions |
| 28 | +extensions = [ |
| 29 | + "sphinx.ext.autodoc", |
| 30 | + "sphinx.ext.viewcode", |
| 31 | + "sphinx.ext.napoleon", |
| 32 | + "sphinx.ext.intersphinx", |
| 33 | + "sphinx_autodoc_typehints", |
| 34 | + "sphinx.ext.autosummary" |
| 35 | +] |
| 36 | + |
| 37 | +# Napoleon settings (for Google and NumPy style docstrings) |
| 38 | +napoleon_google_docstring = True |
| 39 | +napoleon_numpy_docstring = True |
| 40 | +napoleon_include_init_with_doc = False |
| 41 | +napoleon_include_private_with_doc = False |
| 42 | + |
| 43 | +# Autodoc settings |
| 44 | +autodoc_default_options = { |
| 45 | + "members": True, |
| 46 | + "undoc-members": True, |
| 47 | + "show-inheritance": True, |
| 48 | +} |
| 49 | + |
| 50 | +# Intersphinx mapping |
| 51 | +intersphinx_mapping = { |
| 52 | + "python": ("https://docs.python.org/3", None), |
| 53 | +} |
| 54 | + |
| 55 | +# HTML theme |
| 56 | +html_theme = "sphinx_rtd_theme" |
| 57 | +html_static_path = ["_static"] |
| 58 | +html_css_files = [] |
| 59 | + |
| 60 | + |
| 61 | +# Output file base name for HTML help builder |
| 62 | +htmlhelp_basename = "powersensor_localdoc" |
| 63 | + |
| 64 | +# Options for LaTeX output |
| 65 | +latex_elements = {} |
| 66 | +latex_documents = [ |
| 67 | + ("index", "powersensor_local.tex", "powersensor_local Documentation", "Your Name", "manual"), |
| 68 | +] |
| 69 | + |
| 70 | +# Options for manual page output |
| 71 | +man_pages = [ |
| 72 | + ("index", "powersensor_local", "powersensor_local Documentation", [author], 1) |
| 73 | +] |
| 74 | + |
| 75 | +# Options for Texinfo output |
| 76 | +texinfo_documents = [ |
| 77 | + ( |
| 78 | + "index", |
| 79 | + "powersensor_local", |
| 80 | + "powersensor_local Documentation", |
| 81 | + author, |
| 82 | + "powersensor_local", |
| 83 | + "One line description of project.", |
| 84 | + "Miscellaneous", |
| 85 | + ), |
| 86 | +] |
0 commit comments