diff --git a/.gitignore b/.gitignore index e2bc744..7219663 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,8 @@ testMain.py #VS Code .vscode/ .DS_Store + +# documentation +_build/ +_static/ +_templates/ 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/source/async_version/index.rst b/docs/source/async_version/index.rst new file mode 100644 index 0000000..6b53c6a --- /dev/null +++ b/docs/source/async_version/index.rst @@ -0,0 +1,51 @@ +==================== +AsyncTeleBot +==================== + +AsyncTeleBot methods +-------------------- + +.. automodule:: telebot.async_telebot + :members: + :undoc-members: + :show-inheritance: + + + +Asyncio filters +--------------- + +.. automodule:: telebot.asyncio_filters + :members: + :undoc-members: + :show-inheritance: + +Asynchronous storage for states +------------------------------- + +.. automodule:: telebot.asyncio_storage + :members: + :undoc-members: + :show-inheritance: + +asyncio_helper file +------------------- + +.. automodule:: telebot.asyncio_helper + :members: + :undoc-members: + :show-inheritance: + + +Asyncio handler backends +------------------------ + + + +.. automodule:: telebot.asyncio_handler_backends + :members: + :undoc-members: + :show-inheritance: + + + diff --git a/docs/source/calldata.rst b/docs/source/calldata.rst new file mode 100644 index 0000000..4919c9d --- /dev/null +++ b/docs/source/calldata.rst @@ -0,0 +1,13 @@ + +===================== +Callback data factory +===================== + + +callback\_data file +----------------------------- + +.. automodule:: telebot.callback_data + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..8a9f739 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,66 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'pyTelegramBotAPI' +copyright = '2022, coder2020official' +author = 'coder2020official' + +# The full version, including alpha/beta/rc tags +release = '1.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx_rtd_theme', + 'sphinx.ext.autosectionlabel', + 'sphinx.ext.autodoc', + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] +html_logo = 'logo.png' +html_theme_options = { + 'logo_only': True, + 'display_version': False, +} diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..a7ad1e1 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,36 @@ +.. pyTelegramBotAPI documentation master file, created by + sphinx-quickstart on Fri Feb 18 20:58:37 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + + +Welcome to pyTelegramBotAPI's documentation! +============================================ + +======= +TeleBot +======= + +Contents +-------- +.. toctree:: + + install + quick_start + types + sync_version/index + async_version/index + calldata + util + + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + + \ No newline at end of file diff --git a/docs/source/install.rst b/docs/source/install.rst new file mode 100644 index 0000000..f195a43 --- /dev/null +++ b/docs/source/install.rst @@ -0,0 +1,41 @@ +================== +Installation Guide +================== + + +:toctree + +Using PIP +---------- +.. code-block:: bash + + $ pip install pyTelegramBotAPI + +Using pipenv +------------ +.. code-block:: bash + + $ pipenv install pyTelegramBotAPI + +By cloning repository +--------------------- +.. code-block:: bash + + $ git clone https://github.com/eternnoir/pyTelegramBotAPI.git + $ cd pyTelegramBotAPI + $ python setup.py install + +Directly using pip +------------------ +.. code-block:: bash + $ pip install git+https://github.com/eternnoir/pyTelegramBotAPI.git + +It is generally recommended to use the first option. + +While the API is production-ready, it is still under development and it has regular updates, do not forget to update it regularly by calling: + +.. code-block:: bash + + $ pip install pytelegrambotapi --upgrade + + diff --git a/docs/source/logo.png b/docs/source/logo.png new file mode 100644 index 0000000..b80632a Binary files /dev/null and b/docs/source/logo.png differ diff --git a/docs/source/quick_start.rst b/docs/source/quick_start.rst new file mode 100644 index 0000000..b422b20 --- /dev/null +++ b/docs/source/quick_start.rst @@ -0,0 +1,16 @@ + +=========== +Quick start +=========== + +Synchronous TeleBot +------------------- +.. literalinclude:: ../examples/echo_bot.py + :language: python + +Asynchronous TeleBot +-------------------- +.. literalinclude:: ../examples/asynchronous_telebot/echo_bot.py + :language: python + + diff --git a/docs/source/sync_version/index.rst b/docs/source/sync_version/index.rst new file mode 100644 index 0000000..84e490d --- /dev/null +++ b/docs/source/sync_version/index.rst @@ -0,0 +1,43 @@ +=============== +TeleBot version +=============== + +TeleBot methods +--------------- +.. automodule:: telebot + :members: + :undoc-members: + :show-inheritance: + +custom_filters file +------------------------------ + +.. automodule:: telebot.custom_filters + :members: + :undoc-members: + :show-inheritance: + +Synchronous storage for states +------------------------------- + +.. automodule:: telebot.storage + :members: + :undoc-members: + :show-inheritance: + +handler_backends file +-------------------------------- + +.. automodule:: telebot.handler_backends + :members: + :undoc-members: + :show-inheritance: + +apihelper +------------------------ + +.. automodule:: telebot.apihelper + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/source/types.rst b/docs/source/types.rst new file mode 100644 index 0000000..074b12a --- /dev/null +++ b/docs/source/types.rst @@ -0,0 +1,10 @@ +============ +Types of API +============ + + + +.. automodule:: telebot.types + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/util.rst b/docs/source/util.rst new file mode 100644 index 0000000..027dfe7 --- /dev/null +++ b/docs/source/util.rst @@ -0,0 +1,12 @@ +============ +Utils +============ + + +util file +------------------- + +.. automodule:: telebot.util + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file