Skip to content

Commit b10146e

Browse files
committed
Onboard sphinx docs
1 parent 18f3e02 commit b10146e

35 files changed

Lines changed: 17302 additions & 21 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ venv
44
temp.py
55
test.py
66
source
7+
doc_gen/_build
8+
doc_gen/_static

.pre-commit-config.yaml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,13 @@ repos:
3131
hooks:
3232
- id: isort
3333

34-
# - repo: local
35-
# hooks:
36-
# -
37-
# id: pytest
38-
# name: pytest
39-
# entry: cd tests pytest
40-
# language: system
41-
# pass_filenames: false
42-
# always_run: true
43-
#
44-
# -
45-
# repo: local
46-
# hooks:
47-
# -
48-
# id: docs
49-
# name: docs
50-
# entry: /bin/bash gen_docs.sh
51-
# language: system
52-
# pass_filenames: false
53-
# always_run: true
34+
-
35+
repo: local
36+
hooks:
37+
-
38+
id: docs
39+
name: docs
40+
entry: /bin/bash pre_commit.sh
41+
language: system
42+
pass_filenames: false
43+
always_run: true

doc_gen/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)

doc_gen/conf.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
# -- Path setup --------------------------------------------------------------
7+
8+
# If extensions (or modules to document with autodoc) are in another directory,
9+
# add these directories to sys.path here. If the directory is relative to the
10+
# documentation root, use os.path.abspath to make it absolute, like shown here.
11+
12+
import os
13+
import sys
14+
15+
sys.path.insert(0, os.path.abspath('..'))
16+
17+
# -- Project information -----------------------------------------------------
18+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
19+
20+
project = 'Stream'
21+
copyright = '2023, Vignesh Rao'
22+
author = 'Vignesh Rao'
23+
24+
# -- General configuration ---------------------------------------------------
25+
26+
# Add any Sphinx extension module names here, as strings. They can be
27+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
28+
# ones.
29+
extensions = [
30+
'sphinx.ext.napoleon', # certain styles of doc strings
31+
'sphinx.ext.autodoc', # generates from doc strings
32+
'recommonmark', # supports markdown integration
33+
]
34+
35+
# https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#configuration
36+
napoleon_google_docstring = True
37+
napoleon_use_param = False
38+
39+
# Add any paths that contain templates here, relative to this directory.
40+
templates_path = ['_templates']
41+
42+
# List of patterns, relative to source directory, that match files and
43+
# directories to ignore when looking for source files.
44+
# This pattern also affects html_static_path and html_extra_path.
45+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
46+
47+
# -- Options for HTML output -------------------------------------------------
48+
49+
# The theme to use for HTML and HTML Help pages. See the documentation for
50+
# a list of builtin themes.
51+
# https://www.sphinx-doc.org/en/master/usage/theming.html#builtin-themes
52+
html_theme = 'classic'
53+
html_theme_options = {
54+
"body_max_width": "80%"
55+
}
56+
57+
# Add any paths that contain custom static files (such as style sheets) here,
58+
# relative to this directory. They are copied after the builtin static files,
59+
# so a file named "default.css" will overwrite the builtin "default.css".
60+
html_static_path = ['_static']
61+
62+
# Include private members of a class
63+
# This can also be achieved by adding a toctree section `:private-members:` in index.rst
64+
# Reference: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options
65+
autodoc_default_options = {
66+
"members": True,
67+
"undoc-members": True,
68+
"private-members": True,
69+
"member-order": "bysource",
70+
}
71+
72+
# Add docstrings from __init__ method
73+
# Reference: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
74+
autoclass_content = 'both'
75+
76+
# Add support to mark down files in sphinx documentation
77+
# Reference: https://www.sphinx-doc.org/en/1.5.3/markdown.html
78+
source_suffix = {
79+
'.rst': 'restructuredtext',
80+
'.txt': 'markdown',
81+
'.md': 'markdown',
82+
}

doc_gen/index.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
.. Stream documentation master file, created by
2+
sphinx-quickstart on Sun Dec 3 20:51:03 2023.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to Stream's documentation!
7+
==================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Read Me:
12+
13+
README
14+
15+
Main Module
16+
===========
17+
18+
.. automodule:: pystream.main
19+
:members:
20+
:undoc-members:
21+
22+
Models
23+
======
24+
Authenticator
25+
=============
26+
27+
.. automodule:: pystream.models.authenticator
28+
:members:
29+
:undoc-members:
30+
31+
Config
32+
======
33+
34+
.. automodule:: pystream.models.config
35+
:members:
36+
:exclude-members: _abc_impl, model_config, model_fields
37+
38+
Filters
39+
=======
40+
41+
.. automodule:: pystream.models.filters
42+
:members:
43+
:undoc-members:
44+
45+
Ngrok
46+
=====
47+
48+
.. automodule:: pystream.models.ngrok
49+
:members:
50+
:undoc-members:
51+
52+
Squire
53+
======
54+
55+
.. automodule:: pystream.models.squire
56+
:members:
57+
:undoc-members:
58+
59+
Stream
60+
======
61+
62+
.. automodule:: pystream.models.stream
63+
:members:
64+
:undoc-members:
65+
66+
Routers
67+
=======
68+
Authentication
69+
==============
70+
71+
.. automodule:: pystream.routers.auth
72+
:members:
73+
:undoc-members:
74+
75+
Basics
76+
======
77+
78+
.. automodule:: pystream.routers.basics
79+
:members:
80+
:undoc-members:
81+
82+
Video
83+
=====
84+
85+
.. automodule:: pystream.routers.video
86+
:members:
87+
:undoc-members:
88+
89+
Indices and tables
90+
==================
91+
92+
* :ref:`genindex`
93+
* :ref:`modindex`
94+
* :ref:`search`

doc_gen/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

docs/.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)