Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rules: refactoring of Sopel's rule system to an object-oriented approach #1873

Merged
merged 20 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions docs/source/plugin.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
================
Plugin structure
================

.. contents::
:local:
:depth: 1

Anatomy of a plugin
===================

A Sopel plugin consists of a Python module containing one or more
``callable``\s. It may optionally also contain ``configure``, ``setup``, and
``shutdown`` hooks.
Expand All @@ -24,7 +32,15 @@ A Sopel plugin consists of a Python module containing one or more
applied for that call.

Note that the name can, and should, be anything - it doesn't need to be
called "callable".
called "callable"::

from sopel import module

@module.commands('hello')
def say_hello(bot, trigger):
"""Reply hello to you."""
bot.reply('Hello!')


.. py:function:: setup(bot)

Expand Down Expand Up @@ -80,11 +96,27 @@ A Sopel plugin consists of a Python module containing one or more

.. versionadded:: 3.0

sopel.module
------------

Callable decorators
===================

.. automodule:: sopel.module
:members:


Internal machinery
==================

.. important::

This section contains modules and classes used by Sopel internally. They are
subject to rapid changes between versions. They are documented here for
completeness, and for the aid of Sopel’s core development.

.. contents::
:local:


sopel.plugins
-------------
.. automodule:: sopel.plugins
Expand All @@ -94,3 +126,27 @@ sopel.plugins.handlers
----------------------
.. automodule:: sopel.plugins.handlers
:members:

sopel.plugins.exceptions
------------------------
.. automodule:: sopel.plugins.exceptions
:members:

sopel.plugins.rules
-------------------
.. automodule:: sopel.plugins.rules
:members:
:show-inheritance:

.. autoclass:: AbstractRule
:members:
:undoc-members:

.. autoclass:: NamedRuleMixin
:members:
:undoc-members:

sopel.loader
------------
.. automodule:: sopel.loader
:members:
Loading