Skip to content

Commit cff5dcc

Browse files
committed
Documentación con napoleon
1 parent 2ed5b0b commit cff5dcc

File tree

12 files changed

+161
-142
lines changed

12 files changed

+161
-142
lines changed

docs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8-
SOURCEDIR = .
9-
BUILDDIR = _build
8+
SOURCEDIR = source
9+
BUILDDIR = build
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:

docs/conf.py

Lines changed: 0 additions & 61 deletions
This file was deleted.

docs/index.rst

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/make.bat

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +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-
if "%1" == "" goto help
14-
15-
%SPHINXBUILD% >NUL 2>NUL
16-
if errorlevel 9009 (
17-
echo.
18-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19-
echo.installed, then set the SPHINXBUILD environment variable to point
20-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21-
echo.may add the Sphinx directory to PATH.
22-
echo.
23-
echo.If you don't have Sphinx installed, grab it from
24-
echo.https://www.sphinx-doc.org/
25-
exit /b 1
26-
)
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
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=source
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/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
sphinx==4.3.1
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ Comandos básicos
66
- ``/start``: Sirve para comenzar la interacción con el bot
77

88
Comandos de Administrador
9-
-------------------------
10-
- ``/su <password>``: Reclama permisos de admin, la contraseña es la usada en la variable de entorno ``PYCAMP_BOT_MASTER_KEY``.
11-
- ``/agregar_pycamp <pycamp_name>``: Crea el PyCamp en la DB.
12-
- ``/activar_pycamp <pycamp_name>``: Activa un Pycamp.
13-
- ``/empezar_pycamp``: Setea la fecha de inicio del pycamp activo.
14-
- ``/empezar_carga_proyectos``: Habilita la carga de los proyectos. En este punto los pycampistas pueden cargar sus proyectos, enviandole al bot el comando ``/cargar_proyecto``.
15-
- ``/terminar_carga_proyectos``: Termina carga proyectos.
16-
- ``/empezar_votacion``: Activa la votacion (a partir de ahora los pycampistas pueden votar con ``/votar``).
17-
- ``/terminar_votacion``: Termina la votacion.
18-
- ``/cronogramear``: Pregunta los dias y slot por día para poder crear el cronograma.
19-
- ``/cambiar_slot``: Toma un nombre de proyecto y un slot; y te cambia ese proyecto a ese slot.
9+
-------------------------
2010

11+
- ``/su <password>``: Reclama permisos de admin, la contraseña es la usada en la variable de entorno ``PYCAMP_BOT_MASTER_KEY``.
12+
- ``/agregar_pycamp <pycamp_name>``: Crea el PyCamp en la DB.
13+
- ``/activar_pycamp <pycamp_name>``: Activa un Pycamp.
14+
- ``/empezar_pycamp``: Setea la fecha de inicio del pycamp activo.
15+
- ``/empezar_carga_proyectos``: Habilita la carga de los proyectos. En este punto los pycampistas pueden cargar sus proyectos, enviandole al bot el comando ``/cargar_proyecto``.
16+
- ``/terminar_carga_proyectos``: Termina carga proyectos.
17+
- ``/empezar_votacion``: Activa la votacion (a partir de ahora los pycampistas pueden votar con ``/votar``).
18+
- ``/terminar_votacion``: Termina la votacion.
19+
- ``/cronogramear``: Pregunta los dias y slot por día para poder crear el cronograma.
20+
- ``/cambiar_slot``: Toma un nombre de proyecto y un slot; y te cambia ese proyecto a ese slot.
2121

2222
Compandos Pycampista
2323
--------------------
24-
- ``/cargar_proyecto``: Carga un proyecto (si está habilitada la carga).
25-
- ``/votar``: Envia opciones para votar (si está habilitada la votacion).
26-
- ``/ver_cronograma``: Te muestra el cronograma!.
24+
25+
- ``/cargar_proyecto``: Carga un proyecto (si está habilitada la carga).
26+
- ``/votar``: Envia opciones para votar (si está habilitada la votacion).
27+
- ``/ver_cronograma``: Te muestra el cronograma!.

docs/source/conf.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import os
2+
import sys
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# For the full list of built-in configuration values, see the documentation:
6+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
7+
8+
# -- Project information -----------------------------------------------------
9+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
10+
11+
project = 'Pycamp Bot'
12+
copyright = '2021, PyAr'
13+
author = 'PyAr'
14+
release = '3.0.0'
15+
16+
# -- Path setup --------------------------------------------------------------
17+
18+
sys.path.insert(0, f'{os.path.dirname(__file__)}/../..')
19+
20+
# -- General configuration ---------------------------------------------------
21+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
22+
23+
extensions = [
24+
'sphinx.ext.autodoc',
25+
'sphinx.ext.napoleon',
26+
'sphinx.ext.viewcode',
27+
]
28+
29+
templates_path = ['_templates']
30+
exclude_patterns = []
31+
32+
language = 'es'
33+
34+
# -- Options for HTML output -------------------------------------------------
35+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
36+
37+
html_theme = 'sphinx_rtd_theme'
38+
html_static_path = ['_static']
39+
# html_favicon = '_static/img/icon.svg'
40+
# html_logo = '_static/img/logo.png'
41+
42+
# -- Options for autodoc -----------------------------------------------------
43+
44+
autodoc_default_options = {
45+
'members': True,
46+
'undoc-members': True,
47+
'special-members': '__init__',
48+
'show-inheritance': True,
49+
}
50+
51+
# -- Options for napoleon ----------------------------------------------------
52+
53+
napoleon_include_init_with_doc = True
54+
napoleon_include_private_with_doc = False
55+
napoleon_include_special_with_doc = True
56+
napoleon_use_ivar = True
57+
napoleon_use_param = True
58+
napoleon_use_rtype = True
59+
napoleon_preprocess_types = True
60+
napoleon_attr_annotations = True
61+
napoleon_custom_sections = [('Returns', 'params_style')]

docs/source/index.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
##############################################
2+
Bienvenido a la documentación de Pycamp Bot's!
3+
##############################################
4+
5+
Contenido
6+
=========
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
:caption: Contenido:
11+
12+
instalacion_entorno
13+
comandos_bot
14+
15+
.. toctree::
16+
:caption: API
17+
:hidden:
18+
19+
pycamp_bot
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
Instalación del entorno de desarrollo
22
=====================================
3+
34
Para poder colaborar con este desarrollo vas a necesitar 4 cosas:
45

56
- Obtener el token de telegram
67
- Setear las variables de entorno
78
- Instalar las dependencias
89
- Ejecutar el bot
910

10-
1111
Obtención del token de telegram
1212
-------------------------------
13+
1314
Hace click en `este link <https://telegram.me/BotFather>`_ para hablar con **BotFather** y seguí los pasos:
1415

1516
- ``/start``
@@ -18,17 +19,16 @@ Hace click en `este link <https://telegram.me/BotFather>`_ para hablar con **Bot
1819
- Dale un username
1920
- Copia el token de acceso
2021

21-
2222
Variables de entorno
2323
--------------------
2424
===================== ======= ========= =======
2525
Variable Ejemplo Requerida Default
2626
===================== ======= ========= =======
27-
TOKEN {TOKEN} True
28-
PYCAMP_BOT_MASTER_KEY {KEY} True
27+
TOKEN {TOKEN} True
28+
PYCAMP_BOT_MASTER_KEY {KEY} True
2929
===================== ======= ========= =======
3030

31-
El ``PYCAMP_BOT_MASTER_KEY`` es una clave que tenes que inventar para poder ser admin con el bot.
31+
El ``PYCAMP_BOT_MASTER_KEY`` es una clave que tenes que inventar para poder ser admin con el bot.
3232

3333
Instalación de dependencias
3434
---------------------------
@@ -37,16 +37,15 @@ Instalación de dependencias
3737
3838
python setup.py install
3939
40-
4140
Ejecutar el bot
4241
---------------
43-
Para correr el bot ejecutá:
42+
43+
Para correr el bot ejecutá:
4444

4545
.. code-block:: bash
4646
4747
TOKEN='TOKEN_PERSONAL' PYCAMP_BOT_MASTER_KEY='KEY' python bin/run_bot.py
4848
49-
5049
Y listo! Tu bot está corriendo en tu máquina, esperando que alguien le escriba por telegram.
5150
Para probarlo buscalo en telegram y mandale el comando `/start`
5251

docs/source/pycamp_bot.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
##########
2+
Pycamp bot
3+
##########
4+
5+
Archivos
6+
========
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
pycamp_bot/db_schemma
12+
pycamp_bot/models

0 commit comments

Comments
 (0)