Skip to content

Commit e5ed280

Browse files
committed
Lots of docs updates
1 parent a8da612 commit e5ed280

12 files changed

Lines changed: 350 additions & 104 deletions

docs/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Minimal makefile for Sphinx documentation
22
#
33

4-
# You can set these variables from the command line, and also
5-
# from the environment for the first two.
6-
SPHINXOPTS ?=
7-
SPHINXBUILD ?= sphinx-build
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = simpleble
88
SOURCEDIR = source
99
BUILDDIR = build
1010

docs/make.bat

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
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.http://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
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+
set SPHINXPROJ=simpleble
13+
14+
if "%1" == "" goto help
15+
16+
%SPHINXBUILD% >NUL 2>NUL
17+
if errorlevel 9009 (
18+
echo.
19+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20+
echo.installed, then set the SPHINXBUILD environment variable to point
21+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
22+
echo.may add the Sphinx directory to PATH.
23+
echo.
24+
echo.If you don't have Sphinx installed, grab it from
25+
echo.http://sphinx-doc.org/
26+
exit /b 1
27+
)
28+
29+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30+
goto end
31+
32+
:help
33+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34+
35+
:end
36+
popd

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx==7.1.2
22
sphinx-rtd-theme==1.3.0rc1
3+
sphinx-copybutton==0.5.2

docs/source/cli.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Command Line Interface
2+
======================
3+
4+
The **python-thingset** library implements Python client for the `ThingSet <https://thingset.io/>`_
5+
protocol.
6+
7+
.. code-block:: python
8+
:linenos:
9+
10+
from python_thingset import ThingSet
11+
12+
with ThingSet() as ts:
13+
response = ts.get(0xF03)
14+
print(response) # 0x85 (CONTENT): native_posix

docs/source/conf.py

Lines changed: 143 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,162 @@
1+
# -*- coding: utf-8 -*-
2+
#
13
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/stable/config
28

9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
315
import os
416
import sys
5-
sys.path.insert(0, os.path.abspath('../../python_thingset/'))
17+
sys.path.insert(0, os.path.abspath('../..'))
618

7-
# -- Project information
19+
# -- Project information -----------------------------------------------------
820

9-
project = 'python_thingset'
10-
copyright = '2025'
21+
project = 'Python ThingSet'
22+
copyright = '2025, Brill Power'
1123
author = 'Adam Mitchell'
1224

13-
release = '0.1'
14-
version = '0.2.3'
25+
# The short X.Y version
26+
version = '1'
27+
# The full version, including alpha/beta/rc tags
28+
release = '0.0.1'
29+
30+
31+
# -- General configuration ---------------------------------------------------
1532

16-
# -- General configuration
33+
# If your documentation needs a minimal Sphinx version, state it here.
34+
#
35+
# needs_sphinx = '1.0'
1736

37+
# Add any Sphinx extension module names here, as strings. They can be
38+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+
# ones.
1840
extensions = [
19-
'sphinx.ext.duration',
20-
'sphinx.ext.doctest',
2141
'sphinx.ext.autodoc',
22-
'sphinx.ext.autosummary',
23-
'sphinx.ext.intersphinx',
42+
'sphinx.ext.viewcode',
43+
'sphinx.ext.githubpages',
44+
'sphinx.ext.napoleon',
45+
'sphinx_copybutton',
2446
]
2547

26-
intersphinx_mapping = {
27-
'python': ('https://docs.python.org/3/', None),
28-
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
29-
}
30-
intersphinx_disabled_domains = ['std']
31-
48+
# Add any paths that contain templates here, relative to this directory.
3249
templates_path = ['_templates']
3350

34-
# -- Options for HTML output
51+
# The suffix(es) of source filenames.
52+
# You can specify multiple suffix as a list of string:
53+
#
54+
# source_suffix = ['.rst', '.md']
55+
source_suffix = '.rst'
56+
57+
# The master toctree document.
58+
master_doc = 'index'
59+
60+
# The language for content autogenerated by Sphinx. Refer to documentation
61+
# for a list of supported languages.
62+
#
63+
# This is also used if you do content translation via gettext catalogs.
64+
# Usually you set "language" from the command line for these cases.
65+
language = 'en'
66+
67+
# List of patterns, relative to source directory, that match files and
68+
# directories to ignore when looking for source files.
69+
# This pattern also affects html_static_path and html_extra_path .
70+
exclude_patterns = []
71+
72+
# The name of the Pygments (syntax highlighting) style to use.
73+
pygments_style = 'sphinx'
3574

75+
76+
# -- Options for HTML output -------------------------------------------------
77+
78+
# The theme to use for HTML and HTML Help pages. See the documentation for
79+
# a list of builtin themes.
80+
#
3681
html_theme = 'sphinx_rtd_theme'
3782

38-
# -- Options for EPUB output
39-
epub_show_urls = 'footnote'
83+
# Theme options are theme-specific and customize the look and feel of a theme
84+
# further. For a list of options available for each theme, see the
85+
# documentation.
86+
#
87+
# html_theme_options = {}
88+
89+
# Add any paths that contain custom static files (such as style sheets) here,
90+
# relative to this directory. They are copied after the builtin static files,
91+
# so a file named "default.css" will overwrite the builtin "default.css".
92+
html_static_path = ['_static']
93+
94+
# Custom sidebar templates, must be a dictionary that maps document names
95+
# to template names.
96+
#
97+
# The default sidebars (for documents that don't match any pattern) are
98+
# defined by theme itself. Builtin themes are using these templates by
99+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
100+
# 'searchbox.html']``.
101+
#
102+
# html_sidebars = {}
103+
104+
105+
# -- Options for HTMLHelp output ---------------------------------------------
106+
107+
# Output file base name for HTML help builder.
108+
htmlhelp_basename = 'pytsdoc'
109+
110+
111+
# -- Options for LaTeX output ------------------------------------------------
112+
113+
latex_elements = {
114+
# The paper size ('letterpaper' or 'a4paper').
115+
#
116+
# 'papersize': 'letterpaper',
117+
118+
# The font size ('10pt', '11pt' or '12pt').
119+
#
120+
# 'pointsize': '10pt',
121+
122+
# Additional stuff for the LaTeX preamble.
123+
#
124+
# 'preamble': '',
125+
126+
# Latex figure (float) alignment
127+
#
128+
# 'figure_align': 'htbp',
129+
}
130+
131+
# Grouping the document tree into LaTeX files. List of tuples
132+
# (source start file, target name, title,
133+
# author, documentclass [howto, manual, or own class]).
134+
latex_documents = [
135+
(master_doc, 'python_thingset.tex', 'Python ThingSet Documentation',
136+
'Adam Mitchell', 'manual'),
137+
]
138+
139+
140+
# -- Options for manual page output ------------------------------------------
141+
142+
# One entry per manual page. List of tuples
143+
# (source start file, name, description, authors, manual section).
144+
man_pages = [
145+
(master_doc, 'pyts', 'Python ThingSet Documentation',
146+
[author], 1)
147+
]
148+
149+
150+
# -- Options for Texinfo output ----------------------------------------------
151+
152+
# Grouping the document tree into Texinfo files. List of tuples
153+
# (source start file, target name, title, author,
154+
# dir menu entry, description, category)
155+
texinfo_documents = [
156+
(master_doc, 'pyts', 'Python Thingset Documentation',
157+
author, 'pyts', 'ThingSet client for Python.',
158+
'Miscellaneous'),
159+
]
160+
161+
162+
# -- Extension configuration -------------------------------------------------

docs/source/index.rst

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
Python ThingSet
2-
=====================================
1+
python-thingset
2+
===============
33

4-
.. toctree::
5-
:maxdepth: 2
6-
:caption: Contents:
4+
The **python-thingset** library implements Python client for the `ThingSet <https://thingset.io/>`_
5+
protocol. Binary mode is supported when using either the CAN or TCP/IP transports and text mode is
6+
supported when using the Serial transport.
7+
8+
As well as providing an importable Python package, a fully-featured command line tool is included to
9+
enable simple interaction with ThingSet-enabled devices.
710

8-
modules
9-
python_thingset
11+
Below is a brief example showing how to use **python-thingset**. By default, if no arguments are
12+
provided when instantiating a `ThingSet()` object, the Socket transport will be used and will attempt
13+
to connect to a client running on *127.0.0.1*. In this example, a client defines a property containing
14+
the string `native_posix` with the property identifier `0xF03` which is retrieved by the code below.
1015

11-
Indices and tables
12-
==================
16+
.. code-block:: python
17+
:linenos:
1318
14-
* :ref:`genindex`
15-
* :ref:`modindex`
16-
* :ref:`search`
19+
from python_thingset import ThingSet
1720
21+
with ThingSet() as ts:
22+
response = ts.get(0xF03)
23+
print(response) # 0x85 (CONTENT): native_posix
1824
19-
python_thingset module
20-
======================
2125
22-
.. automodule:: python_thingset
23-
:members:
24-
:undoc-members:
25-
:show-inheritance:
26+
.. toctree::
27+
:maxdepth: 2
28+
:caption: Contents:
29+
30+
installation
31+
usage
32+
cli

docs/source/installation.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Installation
2+
============
3+
4+
Installing **python-thingset** is very simple as the package is available on
5+
`PyPI <https://pypi.org/project/python-thingset/>`_.
6+
7+
To install the package:
8+
9+
.. code-block:: shell
10+
:linenos:
11+
12+
pip install python-thingset
13+
14+
To install the optional development dependencies required for linting and running
15+
unit tests (quotation marks (`'...'`) may be required if using a shell like Zsh to
16+
avoid issues whereby the square brackets are misinterpreted):
17+
18+
.. code-block:: shell
19+
:linenos:
20+
21+
pip install 'python-thingset[dev]'
22+
23+
To install the package in editable mode (only possible locally, so it is necessary
24+
to clone the repository):
25+
26+
.. code-block:: shell
27+
:linenos:
28+
29+
cd python-thingset
30+
pip install -e .

0 commit comments

Comments
 (0)