Skip to content

Commit b39ed96

Browse files
authored
chore: add docs build to ci (#1582)
* chore: add docs build to ci * docs: add info to CHANGES * docs: fix docstring formatting warnings * docs: fix formatting in administration * docs: fix formatting in plugin sections * docs: fix pypi url references * docs: remove Google+ meta reference * docs: fix formatting/warnings for plugin dev section * docs: fix broken links * docs: use image syntax for screenshots * fix: add missing doc build deps
1 parent 4383dc9 commit b39ed96

26 files changed

+166
-126
lines changed

.github/workflows/python-package.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ jobs:
5959
if: ${{ matrix.python-version == '3.9' }}
6060
run: |
6161
tox -e security
62+
63+
- name: Docs
64+
if: ${{ matrix.python-version == '3.9' }}
65+
run: |
66+
tox -e docs

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fixes:
88
- chore: bump actions/setup-python version (#1575)
99
- backend/telegram: fix missing imports (#1574)
1010
- chore: ci improvements (#1577, #1583)
11+
- chore: add docs build to ci (#1582)
1112

1213

1314
v6.1.9 (2022-06-11)

docs/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Publishing to Read the Docs
3232
Read the Docs should rebuild the site automatically when new commits are pushed.
3333
When new project releases are made, it may be necessary to add the new version
3434
and remove older versions (to prevent clutter in the version drop-down).
35-
This can be done at https://readthedocs.org/dashboard/errbot/versions/.
35+
This can be done at https://readthedocs.org/projects/errbot/versions/.
3636

3737

3838
.. _Sphinx: http://sphinx-doc.org/

docs/features.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ Extensive plugin framework
7373
.. _VK: https://vk.com/
7474
.. _Zulip: https://zulipchat.com/
7575
.. _`logged to Sentry`: https://github.com/errbotio/errbot/wiki/Logging-with-Sentry
76-
.. _irc: https://pypi.python.org/pypi/irc/
76+
.. _irc: https://pypi.org/project/irc/
7777
.. _jabberbot: http://thp.io/2007/python-jabberbot/
7878
.. _jinja2: http://jinja.pocoo.org/
79-
.. _six: https://pypi.python.org/pypi/six/
79+
.. _six: https://pypi.org/project/six/
8080
.. _slixmpp: https://slixmpp.readthedocs.io/

docs/index.rst

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,19 @@ The goal of the project is to make it easy for you to write your own plugins so
88
can make it do whatever you want: a deployment, retrieving some information online,
99
trigger a tool via an API, troll a co-worker,...
1010

11-
Errbot is being used in a lot of different contexts: chatops (tools for devops),
12-
online gaming chatrooms like EVE, video streaming chatrooms like `livecoding.tv <http://livecoding.tv>`_,
13-
home security, etc.
11+
Errbot is being used in a lot of different contexts: chatops (tools for devops), chatroom engagement,
12+
home security, socials platform (such as Slack, Discord, IRC), etc.
1413

1514
Screenshots
1615
-----------
1716

18-
.. raw:: html
17+
.. image:: _static/screenshots/thumb_slack.png
18+
:target: _static/screenshots/slack.png
19+
:alt: Showing output of the built-in help command in Slack
1920

20-
<div class="screenshots">
21-
<a href="_static/screenshots/slack.png" class="fancybox" title="Showing output of the built-in help command in Slack">
22-
<img src="_static/screenshots/thumb_slack.png" width="170" height="150" alt="Showing output of the built-in help command in Slack" />
23-
</a>
24-
<a href="_static/screenshots/telegram.png" class="fancybox" title="Errbot running on Telegram showing the !help command">
25-
<img src="_static/screenshots/thumb_telegram.png" width="180" height= "150" alt="Errbot running on Telegram showing the !help command" />
26-
</a>
27-
</div>
21+
.. image:: _static/screenshots/thumb_telegram.png
22+
:target: _static/screenshots/telegram.png
23+
:alt: Errbot running on Telegram showing the !help command
2824

2925
Simple to build upon
3026
--------------------
@@ -131,7 +127,6 @@ License
131127
Errbot is free software, available under the GPL-3 license. Please refer to the
132128
:download:`full license text <gpl-3.0.txt>` for more details.
133129

134-
.. _`Google plus community`: https://plus.google.com/communities/117050256560830486288
135130
.. _`GitHub page`: http://github.com/errbotio/errbot/
136131
.. _`plugin list`: https://github.com/errbotio/errbot/wiki
137132
.. _`open an issue`: https://github.com/errbotio/errbot/issues

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pyfire
99
python-telegram-bot
1010
slackclient
1111
hypchat
12+
pytest

docs/user_guide/administration.rst

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -126,52 +126,54 @@ More advanced access controls can be set up using the `ACCESS_CONTROLS` and `ACC
126126

127127
Access controls, allowing commands to be restricted to specific users/rooms.
128128
Available filters (you can omit a filter or set it to None to disable it):
129-
`allowusers`: Allow command from these users only
130-
`denyusers`: Deny command from these users
131-
`allowrooms`: Allow command only in these rooms (and direct messages)
132-
`denyrooms`: Deny command in these rooms
133-
`allowargs`: Allow a command's argument from these users only
134-
`denyargs`: Deny a command's argument from these users
135-
`allowprivate`: Allow command from direct messages to the bot
136-
`allowmuc`: Allow command inside rooms
129+
130+
* `allowusers`: Allow command from these users only
131+
* `denyusers`: Deny command from these users
132+
* `allowrooms`: Allow command only in these rooms (and direct messages)
133+
* `denyrooms`: Deny command in these rooms
134+
* `allowargs`: Allow a command's argument from these users only
135+
* `denyargs`: Deny a command's argument from these users
136+
* `allowprivate`: Allow command from direct messages to the bot
137+
* `allowmuc`: Allow command inside rooms
137138

138139
Rules listed in `ACCESS_CONTROLS_DEFAULT` are applied by default and merged with any commands found in `ACCESS_CONTROLS`.
139140

140141
The options allowusers, denyusers, allowrooms and denyrooms, allowargs, denyargs support unix-style globbing similar to `BOT_ADMINS`.
141142

142143
Command names also support unix-style globs and can optionally be restricted to a specific plugin by prefixing the command with the name of a plugin, separated by a colon. For example, `Health:status` will match the `!status` command of the `Health` plugin and `Health:*` will match all commands defined by the `Health` plugin.
143144

144-
Please note that the first command match found will be used so if you have overlapping patterns you must used an OrderedDict instead of a regular dict: https://docs.python.org/3/library/collections.html#collections.OrderedDict
145-
146-
Example:
147-
```
148-
ACCESS_CONTROLS_DEFAULT = {} # Allow everyone access by default
149-
ACCESS_CONTROLS = {
150-
"status": {
151-
"allowrooms": ("[email protected]",)
152-
},
153-
"about": {
154-
"denyusers": ("*@evilhost",),
155-
156-
},
157-
"uptime": {"allowusers": BOT_ADMINS},
158-
"help": {"allowmuc": False},
159-
"ChatRoom:*": {"allowusers": BOT_ADMINS},
160-
}
161-
```
145+
.. note::
146+
The first command match found will be used so if you have overlapping patterns you must used an OrderedDict instead of a regular dict: https://docs.python.org/3/library/collections.html#collections.OrderedDict
147+
148+
Example::
149+
150+
ACCESS_CONTROLS_DEFAULT = {} # Allow everyone access by default
151+
ACCESS_CONTROLS = {
152+
"status": {
153+
"allowrooms": ("[email protected]",)
154+
},
155+
"about": {
156+
"denyusers": ("*@evilhost",),
157+
158+
},
159+
"uptime": {"allowusers": BOT_ADMINS},
160+
"help": {"allowmuc": False},
161+
"ChatRoom:*": {"allowusers": BOT_ADMINS},
162+
}
162163

163164
The example :download:`config.py <config-template.py>` file contains this information about the format of these options.
164165

165166
If you don't like encoding access controls into the config file, a member of the errbot community has also created a `dynamic ACL module <https://github.com/shengis/err-profiles>`_ which can be administered through chat commands instead.
166-
Another community solution allows LDAP groups to be checked for membership before allowing the command to be executed. `LDAP ACL module <https://github.com/marksull/err-ldap>` is practical for managing large groups. This module functions by decorating bot commands directly in the plugin code, which differs from configuration based ACLs.
167+
168+
Another community solution allows LDAP groups to be checked for membership before allowing the command to be executed. `LDAP ACL module <https://github.com/marksull/err-ldap>`_ is practical for managing large groups. This module functions by decorating bot commands directly in the plugin code, which differs from configuration based ACLs.
167169

168170
.. note::
169171
Different backends have different formats to identify users.
170172
Refer to the backend-specific notes at the end of the :ref:`configuration <configuration>` chapter to see which format you should use.
171173

172174

173175
Command filters
174-
^^^^^^^^^^^^^^^
176+
---------------
175177

176178
If our built-in access controls don't fit your needs, you can always create your own easily using *command filters*.
177179
Command filters are functions which are called automatically by errbot whenever a user executes a command.
@@ -185,7 +187,7 @@ Any method in your plugin which is decorated by :func:`~errbot.cmdfilter` will t
185187

186188

187189
Overriding CommandNotFoundFilter
188-
--------------------------------
190+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189191

190192
In some cases, it may be necessary to run other filters before the `CommandNotFoundFilter`. Since the `CommandNotFoundFilter` is part of the core plugin list loaded by errbot, it can not be directly overridden from another plugin.
191193
Instead, to prevent `CommandNotFoundFilter` from being called before other filters, exclude the `CommandNotFoundFilter` plugin in the `CORE_PLUGINS` setting in `config.py` and explicitly call the `CommandNotFoundFilter` function from the overriding filter.

docs/user_guide/configuration/discord.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Discord Backend
22
===============
33

4-
`Discord <http://discordapp.com>`_ backend for [Errbot](http://errbot.io). It allows you to use Errbot from Discord to execute commands.
4+
`Discord <http://discordapp.com>`_ backend for `Errbot <http://errbot.io>`_. It allows you to use Errbot from Discord to execute commands.
55

6-
.. Note:
6+
.. note::
77
⚠️ This backend uses the `discord.py <https://github.com/Rapptz/discord.py>`_ python module which has been discontinued. Support of this backend will continue on a best effort basis.
88

99
Installation
1010
------------
11-
An Errbot instance is required to install the discord back-end. See the Errbot installation `documentation <http://errbot.io/en/latest/user_guide/setup.html#option-2-installing-errbot-in-a-virtualenv-preferred>`_ for details.
11+
An Errbot instance is required to install the discord back-end. See the Errbot installation `documentation <http://errbot.io/en/latest/user_guide/setup.html#option-2-installing-errbot-in-a-virtualenv-preferred>`_ for details.
1212

1313
Requirements
1414
------------
@@ -17,38 +17,44 @@ Requirements
1717

1818
Virtual Environment
1919
-------------------
20-
The steps below are to install the discord back-end in Errbot's virtual environment. In the examples below, the virtual environment was set to `/opt/errbot/virtualenv` and Errbot initialised in `/opt/errbot`. The "extra" back-end directory is set to `/opt/errbot/backend`.
20+
The steps below are to install the discord backend in Errbot's virtual environment. In the examples below, the virtual environment was set to `/opt/errbot/virtualenv` and Errbot initialised in `/opt/errbot`. The "extra" back-end directory is set to `/opt/errbot/backend`.
2121

2222
1. If not already set, set Errbot's `BOT_EXTRA_BACKEND_DIR` variable in `/opt/errbot/config.py` to the directory you will use to place additional back-ends.
23-
.. code: none
23+
.. code::
24+
2425
BOT_EXTRA_BACKEND_DIR=/opt/errbot/backend
2526
2627
2. Set the back-end to use `Discord`.
27-
.. code: none
28+
.. code::
29+
2830
BACKEND = "Discord"
2931
3032
3. Clone repository to your Errbot back-end directory.
31-
.. code: none
33+
.. code::
34+
3235
cd /opt/errbot/backend
33-
git clone https://github.com/gbin/err-backend-discord.git
36+
git clone https://github.com/errbotio/err-backend-discord.git
3437
3538
4. Install back-end dependencies (Errbot's virtual environment must be activated to install the dependencies into it).
36-
.. code: none
39+
.. code::
40+
3741
source /opt/errbot/virtualenv/bin/activate
3842
cd err-backend-discord
3943
pip install -r requirements.txt
4044
deactivate
4145
42-
5. Set the bot's token (see _Create a discord application_ for information on how to get the token).
43-
.. code: none
46+
5. Set the bot's token (see _Create a discord application for information on how to get the token).
47+
.. code::
48+
4449
BOT_IDENTITY = {
4550
"token" : "changeme"
4651
}
47-
6. Enable *SERVER MEMBERS INTENT* for your bot on the Discord website. See `here <https://discordpy.readthedocs.io/en/latest/intents.html?highlight=intents#privileged-intents>_ for the required steps.
52+
53+
6. Enable *SERVER MEMBERS INTENT* for your bot on the Discord website. See `here <https://discordpy.readthedocs.io/en/latest/intents.html?highlight=intents#privileged-intents>_` for the required steps.
4854

4955
Create a discord application
5056
----------------------------
51-
For further information about getting a bot user into a server please see: https://discordapp.com/developers/docs/topics/oauth2. You can use [this tool](https://discordapi.com/permissions.html) to generate a proper invitation link.
57+
For further information about getting a bot user into a server please see: https://discordapp.com/developers/docs/topics/oauth2. You can use `this tool <https://discordapi.com/permissions.html>`_ to generate a proper invitation link.
5258
The reactiflux community have written a quick start guide to `creating a discord bot and getting a token <https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token>`_
5359

5460
Acknowledgements

docs/user_guide/configuration/gitter.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ Gitter Backend
44
This is a backend for `Gitter <http://gitter.im>`_ for errbot.
55
The source code is hosted on `github <https://github.com/errbotio/err-backend-gitter>`_.
66

7-
`Screenshot <https://raw.githubusercontent.com/errbotio/err-backend-gitter/master/screenshot.png>`_.
7+
.. image:: https://raw.githubusercontent.com/errbotio/err-backend-gitter/master/screenshot.png
8+
:width: 586px
9+
:height: 330px
10+
:scale: 75%
11+
:alt: Gitter backend screenshot
812

913
Requirements
1014
------------
@@ -17,12 +21,14 @@ Installation
1721

1822
Checkout the backend using git:
1923

20-
.. codeblock:: bash
24+
.. code::
25+
2126
git checkout https://github.com/errbotio/err-backend-gitter
2227
23-
Edit errbot's configuration file (``config.py``) and set the backend and backend directory variables:
28+
Edit errbot's configuration file (`config.py`) and set the backend and backend directory variables:
29+
30+
.. code::
2431
25-
.. codeblock:: none
2632
BACKEND = 'Gitter'
2733
BOT_EXTRA_BACKEND_DIR = '/path_to/backend'
2834
@@ -33,15 +39,16 @@ From there you have can either add an application or use a personal token from a
3339
Adding an application, workflow for auth
3440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3541
1. pip install bottle requests
36-
2. execute the script: ./oauth.py and it will guide you
42+
2. execute the script: `./oauth.py`` and it will guide you
3743

3844
Adding as a real user
3945
~~~~~~~~~~~~~~~~~~~~~
4046
1. authenticate as the bot user (new incognito window helps ;) )
4147
2. go visit https://developer.gitter.im/apps
4248
3. use directly the token like this in you config.py
4349

44-
.. codeblock:: none
50+
.. code::
51+
4552
BOT_IDENTITY = {
4653
'token' : '54537fa855b9a7bbbbbbbbbc568ea7c069d8c34d'
4754
}

docs/user_guide/configuration/slack.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ by setting up `BOT_IDENTITY` as follows::
3535
Proxy setup
3636
-------------
3737

38-
In case you need to use a Proxy to connect to Slack,
38+
In case you need to use a Proxy to connect to Slack,
3939
you can set the proxies with the token config.
4040

4141
BOT_IDENTITY = {
@@ -81,10 +81,10 @@ then you can set `CHATROOM_PRESENCE` to a list of channels and groups to join.
8181
Message size limit
8282
------------------
8383

84-
As of the 12th August 2018 the Slack API has a message limit size of 40,000 characters. Messages
85-
larger than 40,000 will be truncated by Slack's API. Errbot includes the functionality to split
86-
messages larger than 40,000 characters into multiple parts. To reduce the message limit size, set the
87-
`MESSAGE_SIZE_LIMIT` variable in the configuration file. Errbot will use the smallest value between
84+
As of the 12th August 2018 the Slack API has a message limit size of 40,000 characters. Messages
85+
larger than 40,000 will be truncated by Slack's API. Errbot includes the functionality to split
86+
messages larger than 40,000 characters into multiple parts. To reduce the message limit size, set the
87+
`MESSAGE_SIZE_LIMIT` variable in the configuration file. Errbot will use the smallest value between
8888
the default 40,000 and `MESSAGE_SIZE_LIMIT`.
8989

9090
#MESSAGE_SIZE_LIMIT = 1000

0 commit comments

Comments
 (0)