Skip to content

Commit 87eccc5

Browse files
committed
some formatting changes adding some docs
1 parent 26ba16a commit 87eccc5

24 files changed

Lines changed: 594 additions & 266 deletions

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

docs/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Minimal makefile for Sphinx documentation
2+
3+
SPHINXOPTS ?=
4+
SPHINXBUILD ?= sphinx-build
5+
SOURCEDIR = source
6+
BUILDDIR = build
7+
8+
help:
9+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10+
11+
.PHONY: help Makefile
12+
13+
%: Makefile
14+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

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=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://sphinx-doc.org/
25+
exit /b 1
26+
)
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
3.67 KB
Loading

docs/source/api.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
API Reference
2+
=============
3+
4+
.. automodule:: powersensor_local
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
9+
Submodules
10+
__________
11+
12+
.. autosummary::
13+
:toctree: submodules
14+
:recursive:
15+
16+
devices
17+
listener

docs/source/conf.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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"
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__
22+
release = __version__
23+
except ImportError:
24+
release = "0.1.0"
25+
26+
version = ".".join(release.split(".")[:2])
27+
28+
# Extensions
29+
extensions = [
30+
"sphinx.ext.autodoc",
31+
"sphinx.ext.viewcode",
32+
"sphinx.ext.napoleon",
33+
"sphinx.ext.intersphinx",
34+
"sphinx_autodoc_typehints",
35+
"sphinx.ext.autosummary"
36+
]
37+
38+
# Napoleon settings (for Google and NumPy style docstrings)
39+
napoleon_google_docstring = True
40+
napoleon_numpy_docstring = True
41+
napoleon_include_init_with_doc = False
42+
napoleon_include_private_with_doc = False
43+
44+
# Autodoc settings
45+
autodoc_default_options = {
46+
"members": True,
47+
"undoc-members": True,
48+
"show-inheritance": True,
49+
}
50+
51+
# Intersphinx mapping
52+
intersphinx_mapping = {
53+
"python": ("https://docs.python.org/3", None),
54+
}
55+
56+
# HTML theme
57+
html_theme = "sphinx_rtd_theme"
58+
html_static_path = ["_static"]
59+
html_css_files = []
60+
61+
62+
# Output file base name for HTML help builder
63+
htmlhelp_basename = "powersensor_localdoc"
64+
65+
# Options for LaTeX output
66+
latex_elements = {}
67+
latex_documents = [
68+
("index", "powersensor_local.tex", "powersensor_local Documentation", "Your Name", "manual"),
69+
]
70+
71+
# Options for manual page output
72+
man_pages = [
73+
("index", "powersensor_local", "powersensor_local Documentation", [author], 1)
74+
]
75+
76+
# Options for Texinfo output
77+
texinfo_documents = [
78+
(
79+
"index",
80+
"powersensor_local",
81+
"powersensor_local Documentation",
82+
author,
83+
"powersensor_local",
84+
"One line description of project.",
85+
"Miscellaneous",
86+
),
87+
]

docs/source/contributing.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Contributing
2+
============
3+
4+
We welcome contributions! Here's how you can help:
5+
6+
Development Setup
7+
-----------------
8+
9+
1. Fork the repository
10+
2. Clone your fork:
11+
12+
.. code-block:: bash
13+
14+
git clone https://github.com/yourusername/powersensor_local.git
15+
16+
3. Install development dependencies:
17+
18+
.. code-block:: bash
19+
20+
pip install -e ".[docs]"
21+
22+
23+
Building Documentation
24+
----------------------
25+
26+
.. code-block:: bash
27+
28+
cd docs
29+
make html
30+
31+
The documentation will be built in `docs/build/html/`.
32+
33+
Submitting Changes
34+
------------------
35+
36+
1. Create a new branch for your changes
37+
2. Make your changes and add tests
38+
3. Submit a pull request

docs/source/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Welcome to powersensor_local's documentation!
2+
=================================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
installation
9+
usage
10+
api
11+
contributing
12+
13+
Indices and tables
14+
==================
15+
16+
* :ref:`genindex`
17+
* :ref:`modindex`
18+
* :ref:`search`

docs/source/installation.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Installation
2+
============
3+
4+
From PyPI
5+
---------
6+
7+
.. code-block:: bash
8+
9+
pip install powersensor_local
10+
11+
From Source
12+
-----------
13+
14+
.. code-block:: bash
15+
16+
git clone https://github.com/yourusername/powersensor_local.git
17+
cd powersensor_local
18+
pip install -e .
19+
20+
Development Installation
21+
------------------------
22+
23+
.. code-block:: bash
24+
25+
git clone https://github.com/yourusername/powersensor_local.git
26+
cd powersensor_local
27+
pip install -e ".[docs]"

docs/source/usage.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Usage
2+
=====
3+
4+
Basic Usage
5+
-----------
6+
7+
Here's a simple example of how to use powersensor_local:
8+
9+
.. code-block:: python
10+
11+
import powersensor_local
12+
13+
# Add your usage examples here
14+
15+
Advanced Usage
16+
--------------
17+
18+
More detailed examples and advanced features will be documented here.

0 commit comments

Comments
 (0)