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/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: 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'] + 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 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 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 +===== 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 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: diff --git a/pyproject.toml b/pyproject.toml index f163b50..6d7629d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,9 @@ black = "^23.3.0" slotscheck = "^0.16.1" ruff = "^0.0.269" 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" }