Skip to content

Commit 73759e3

Browse files
committed
docs: add sphinx docs
1 parent ee2949e commit 73759e3

File tree

6 files changed

+214
-0
lines changed

6 files changed

+214
-0
lines changed

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
formats:
3+
- epub
4+
- pdf
5+
build:
6+
os: ubuntu-lts-latest
7+
tools:
8+
python: "3.12"
9+
sphinx:
10+
configuration: docs/conf.py
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- docs

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
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
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os, sys
7+
8+
# -- Project information -----------------------------------------------------
9+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
10+
11+
project = 'netauth'
12+
copyright = '2024, classabbyamp'
13+
author = 'classabbyamp'
14+
release = '0.0.1'
15+
16+
# -- General configuration ---------------------------------------------------
17+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
18+
19+
extensions = [
20+
'sphinx.ext.autodoc',
21+
'sphinx_autodoc_typehints',
22+
'enum_tools.autoenum',
23+
]
24+
25+
templates_path = ['_templates']
26+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
27+
28+
autodoc_member_order = 'bysource'
29+
autodoc_type_aliases = {
30+
'KVDict': 'dict[str, list[str]]',
31+
}
32+
33+
sys.path.insert(0, os.path.abspath('..'))
34+
35+
# -- Options for HTML output -------------------------------------------------
36+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37+
38+
html_theme = 'sphinx_rtd_theme'
39+
html_static_path = ['_static']
40+
41+
html_logo = "https://www.netauth.org/img/NetAuthLock.png"
42+
html_theme_options = {
43+
'collapse_navigation': False,
44+
'navigation_depth': 2,
45+
}

docs/index.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
NetAuth for Python
2+
==================
3+
4+
A `NetAuth <https://netauth.org>`_ client library for Python.
5+
6+
.. currentmodule:: netauth
7+
8+
.. autoclass:: NetAuth
9+
:members:
10+
11+
Data Types
12+
~~~~~~~~~~
13+
14+
.. autoclass:: EntityMeta
15+
:members:
16+
17+
.. autoclass:: Entity
18+
:members:
19+
20+
.. autoclass:: Group
21+
:members:
22+
23+
.. currentmodule:: netauth.v2
24+
25+
.. autoclass:: SubSystemStatus
26+
:members:
27+
28+
.. autoclass:: ServerStatus
29+
:members:
30+
31+
Enumerations
32+
~~~~~~~~~~~~
33+
34+
.. currentmodule:: netauth
35+
36+
.. autoenum:: Capability
37+
38+
.. autoenum:: ExpansionMode
39+
40+
.. currentmodule:: netauth.v2
41+
42+
.. autoenum:: Action
43+
44+
.. autoenum:: RuleAction
45+
46+
Token Cache
47+
~~~~~~~~~~~
48+
49+
.. currentmodule:: netauth.cache
50+
51+
.. autoclass:: TokenCache
52+
:members:
53+
54+
.. autoclass:: FSTokenCache
55+
:members:
56+
57+
.. autoclass:: MemoryTokenCache
58+
:members:
59+
60+
61+
Exceptions
62+
~~~~~~~~~~
63+
64+
.. currentmodule:: netauth.error
65+
66+
.. autoclass:: NetAuthException
67+
:members:
68+
69+
.. autoclass:: NetAuthRpcError
70+
:members:
71+
72+
.. autoclass:: RequestorUnqualifiedError
73+
:members:
74+
75+
.. autoclass:: MalformedRequestError
76+
:members:
77+
78+
.. autoclass:: InternalError
79+
:members:
80+
81+
.. autoclass:: UnauthenticatedError
82+
:members:
83+
84+
.. autoclass:: ReadOnlyError
85+
:members:
86+
87+
.. autoclass:: ExistsError
88+
:members:
89+
90+
.. autoclass:: DoesNotExistError
91+
:members:

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

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ dependencies = [
2727
dev = [
2828
"grpcio-tools",
2929
]
30+
docs = [
31+
"sphinx",
32+
"sphinx-rtd-theme",
33+
"sphinx-toolbox",
34+
"sphinx-autodoc-typehints",
35+
"enum-tools",
36+
]
3037
ci = [
3138
"ruff",
3239
]

0 commit comments

Comments
 (0)