From b27e9c31f0d80be4deb35bbc9429085bb263edb1 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:15:09 +0200 Subject: [PATCH 1/8] build(deps): add sphinx --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index fd6d362..c94920e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,9 @@ black = "^22.10.0" slotscheck = "^0.16.1" ruff = "^0.0.155" pre-commit = "^2.20.0" +sphinx = "^6.1.3" +sphinx-autobuild = "^2021.3.14" +furo = "^2022.12.7" [tool.poetry.group.speedups.dependencies] aiohttp = {extras = ["speedups"], version = "^3.8.3"} From af6f03a74bbbaaf31aa569bc64a35e7010e31d89 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:16:29 +0200 Subject: [PATCH 2/8] feat(docs): setup sphinx --- docs/Makefile | 20 ++++++++++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++++++++++++++ docs/source/conf.py | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..747ffb7 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..caa4ac6 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,37 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'velum' +copyright = '2023, Chromosomologist' +author = 'Chromosomologist' +release = '0.2.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx.ext.viewcode', + 'sphinx.ext.autodoc' +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'furo' +html_theme_options = { + "source_repository": "https://github.com/eludris-community/velum", + "source_branch": "master" +} + +html_static_path = ['_static'] + From 39753600c9881d994e0b5b6f5f9cd8f9b47a3157 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:17:17 +0200 Subject: [PATCH 3/8] feat: document GatewayClient (ish) --- docs/source/client.rst | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/source/client.rst diff --git a/docs/source/client.rst b/docs/source/client.rst new file mode 100644 index 0000000..83a57cb --- /dev/null +++ b/docs/source/client.rst @@ -0,0 +1,8 @@ +.. module:: velum + +Client +====== + +.. autoclass:: GatewayClient + :members: + :inherited-members: From fb86d8dda9b86f0b4db90d86c07412187c4d3de4 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:17:43 +0200 Subject: [PATCH 4/8] feat: document exceptions/errors --- docs/source/exceptions.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/source/exceptions.rst diff --git a/docs/source/exceptions.rst b/docs/source/exceptions.rst new file mode 100644 index 0000000..21858d1 --- /dev/null +++ b/docs/source/exceptions.rst @@ -0,0 +1,23 @@ +.. module:: velum + +Exceptions +========== + +.. autoclass:: VelumError + :members: + +.. autoclass:: GatewayError + :members: + :show-inheritance: + +.. autoclass:: GatewayConnectionError + :members: + :show-inheritance: + +.. autoclass:: GatewayConnectionClosedError + :members: + :show-inheritance: + +.. autoclass:: HTTPError + :members: + :show-inheritance: \ No newline at end of file From 6b1d22c115e7099a583e6a9eee8b580c3033d105 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:18:09 +0200 Subject: [PATCH 5/8] feat: document Message --- docs/source/models.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/source/models.rst diff --git a/docs/source/models.rst b/docs/source/models.rst new file mode 100644 index 0000000..d6335c9 --- /dev/null +++ b/docs/source/models.rst @@ -0,0 +1,7 @@ +Models +====== + + + +.. autoclass:: velum.Message + :members: From 4938e7b23848617927282eff356194be065b8645 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:18:27 +0200 Subject: [PATCH 6/8] feat: add doctree/main file --- docs/source/index.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/source/index.rst diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..c62f85b --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,17 @@ +velum +===== +Velum is an opinionated wrapper for `Eludris `_. API written in Python, very much inspired by `Hikari `_. + +API Reference +------------- +Detailed documentation of all the individual objects, functions and classes provided by velum. + +.. toctree:: + :maxdepth: 2 + :caption: API Reference + + client.rst + events.rst + exceptions.rst + files.rst + models.rst From bbd2bcb9751ee77509b3a0e54c2f2301403249a2 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:18:48 +0200 Subject: [PATCH 7/8] feat: document event classes --- docs/source/events.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/source/events.rst diff --git a/docs/source/events.rst b/docs/source/events.rst new file mode 100644 index 0000000..98dd63a --- /dev/null +++ b/docs/source/events.rst @@ -0,0 +1,20 @@ +.. module:: velum + +Events +====== + +.. autoclass:: ExceptionEvent + :members: + :show-inheritance: + +.. autoclass:: ConnectionEvent + :members: + :show-inheritance: + +.. autoclass:: DisconnectEvent + :members: + :show-inheritance: + +.. autoclass:: MessageCreateEvent + :members: + :show-inheritance: \ No newline at end of file From ea34d13043a1354bc1d83e670bbc50e84c61bf45 Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 11 Jan 2023 13:19:17 +0200 Subject: [PATCH 8/8] feat: partially document files And I MEAN partially. --- docs/source/files.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/source/files.rst diff --git a/docs/source/files.rst b/docs/source/files.rst new file mode 100644 index 0000000..30f2351 --- /dev/null +++ b/docs/source/files.rst @@ -0,0 +1,2 @@ +Files +=====