From e87e8f7067ed7139728ab79cd5c1bacb09844b2b Mon Sep 17 00:00:00 2001 From: Javier Leon Date: Tue, 25 Oct 2022 01:49:18 -0300 Subject: [PATCH] Add base Docs facility --- docs/Makefile | 20 +++++++++++++++ docs/api.rst | 21 ++++++++++++++++ docs/authors.rst | 13 ++++++++++ docs/changelog.rst | 6 +++++ docs/code-of-conduct.rst | 6 +++++ docs/conf.py | 49 +++++++++++++++++++++++++++++++++++++ docs/config.rst | 21 ++++++++++++++++ docs/index.rst | 53 ++++++++++++++++++++++++++++++++++++++++ docs/make.bat | 35 ++++++++++++++++++++++++++ docs/requirements.txt | 6 +++++ docs/security.rst | 6 +++++ docs/settings.rst | 0 12 files changed, 236 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/api.rst create mode 100644 docs/authors.rst create mode 100644 docs/changelog.rst create mode 100644 docs/code-of-conduct.rst create mode 100644 docs/conf.py create mode 100644 docs/config.rst create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/requirements.txt create mode 100644 docs/security.rst create mode 100644 docs/settings.rst diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /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 = . +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/api.rst b/docs/api.rst new file mode 100644 index 0000000..b6a734f --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,21 @@ +api +======== + +``QClient`` +------------- + +.. autofunction:: qw.client.QClient + + +``QueueServer`` +---------------- + +.. autofunction:: qw.protocols.QueueServer + + +``QWorker`` +-------------- + +.. autofunction:: qw.server.QWorker + + \ No newline at end of file diff --git a/docs/authors.rst b/docs/authors.rst new file mode 100644 index 0000000..538f1f1 --- /dev/null +++ b/docs/authors.rst @@ -0,0 +1,13 @@ +======= +Authors +======= + +Development Lead +----------------- + +* Jesus Lara + +Contributors +------------- + +* Javier Leon diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 0000000..c1f5347 --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1,6 @@ + +Changelog +=========== + +.. include:: ../CODE_OF_CONDUCT.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/code-of-conduct.rst b/docs/code-of-conduct.rst new file mode 100644 index 0000000..555e0f5 --- /dev/null +++ b/docs/code-of-conduct.rst @@ -0,0 +1,6 @@ + +code-of-conduct +================ + +.. include:: ../CODE_OF_CONDUCT.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..9a80786 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,49 @@ +# 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 = 'qworker' +copyright = '2022, Jesus Lara G.' +author = 'Jesus Lara G.' +release = 'Dual License BSD and Apache 2.0' + + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "myst_parser", +] + +source_suffix = { + '.rst': 'restructuredtext', + '.txt': 'markdown', + '.md': 'markdown', +} + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for autodoc ---------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration + +# Automatically extract typehints when specified and place them in +# descriptions of the relevant function/method. +autodoc_typehints = "description" + +# Don't show class signature with the class' name. +autodoc_class_signature = "separated" + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output +html_theme = 'sphinx_rtd_theme' +#html_theme = 'alabaster' +html_static_path = ['_static'] diff --git a/docs/config.rst b/docs/config.rst new file mode 100644 index 0000000..84fbdc5 --- /dev/null +++ b/docs/config.rst @@ -0,0 +1,21 @@ +Config +======== + +``QClient`` +------------- + +.. autofunction:: qw.client.QClient + + +``QueueServer`` +---------------- + +.. autofunction:: qw.protocols.QueueServer + + +``QWorker`` +-------------- + +.. autofunction:: qw.server.QWorker + + \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..459a6f8 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,53 @@ +.. qworker documentation master file, created by + sphinx-quickstart on Fri Sep 16 07:35:11 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to qworker's documentation! +============================================ + + +.. image:: https://img.shields.io/pypi/v/qworker + :target: https://pypi.org/project/qworker/ + :alt: PyPI +.. image:: https://github.com/phenobarbital/qworker/workflows/CI/badge.svg + :target: https://github.com/phenobarbital/qworker/actions?query=workflow%3ACI + :alt: GitHub Actions - CI +.. image:: https://github.com/phenobarbital/qworker/workflows/pre-commit/badge.svg + :target: https://github.com/phenobarbital/qworker/actions?query=workflow%3Apre-commit + :alt: GitHub Actions - pre-commit +.. image:: https://img.shields.io/codecov/c/gh/phenobarbital/qworker + :target: https://app.codecov.io/gh/phenobarbital/qworker + :alt: Codecov + + +.. include:: ../README.md + :parser: myst_parser.sphinx_ + + +License +------- + +This project is licensed under the terms of the BSD v3. and Apache 2 Dual license. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + api + config + security + changelog + code-of-conduct + authors + + + +Indices and tables +================== + + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /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=. +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/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..b1981dd --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,6 @@ +sphinx +sphinx-autobuild +sphinx-rtd-theme +myst-parser +navconfig + diff --git a/docs/security.rst b/docs/security.rst new file mode 100644 index 0000000..91a3ad6 --- /dev/null +++ b/docs/security.rst @@ -0,0 +1,6 @@ + +Security +========= + +.. include:: ../SECURITY.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/settings.rst b/docs/settings.rst new file mode 100644 index 0000000..e69de29