1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Improve documentation

This commit is contained in:
Steffo 2020-03-11 16:23:08 +01:00
parent b4036f9f11
commit d61d5c001a
3 changed files with 26 additions and 8 deletions

View file

@ -4,7 +4,7 @@ Royalnet
Welcome to the documentation of Royalnet! Welcome to the documentation of Royalnet!
.. toctree:: .. toctree::
:maxdepth: 5 :maxdepth: 1
packs/pack packs/pack
randomdiscoveries randomdiscoveries

View file

@ -62,7 +62,19 @@ To send a message in the chat the command was called in, you can use the :meth:`
async def run(self, args: rc.CommandArgs, data: rc.CommandData): async def run(self, args: rc.CommandArgs, data: rc.CommandData):
await data.reply("🍝") await data.reply("🍝")
And... it's done! The command is ready to be :doc:`added to your pack <pack>`! Finally, open the ``commands/__init__.py`` file, and import your command there, then add a reference to your imported
command to the ``available_commands`` list: ::
# Imports go here!
from .spaghetti import SpaghettiCommand
# Enter the commands of your Pack here!
available_commands = [
SpaghettiCommand,
]
# Don't change this, it should automatically generate __all__
__all__ = [command.__name__ for command in available_commands]
Command arguments Command arguments
------------------------------------ ------------------------------------
@ -348,8 +360,3 @@ Running repeating jobs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section is not documented yet. This section is not documented yet.
Adding the command to __init__.py
---------------------------------------------
This section is not documented yet.

View file

@ -13,6 +13,8 @@ Creating the repository
To create a new pack, create a new repository based on the `Royalnet Pack template <https://github.com/Steffo99/royalnet-pack-template>`_ To create a new pack, create a new repository based on the `Royalnet Pack template <https://github.com/Steffo99/royalnet-pack-template>`_
and clone it to your workspace. and clone it to your workspace.
After cloning the template, run ``poetry install`` to install the dependencies for the pack, creating the ``poetry.lock`` file.
pyproject.toml pyproject.toml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -103,7 +105,16 @@ Its contents **can be imported anywhere** in the Pack, including the ``tables``
However, its files are **forbidden from importing anything else** from the rest of the pack! However, its files are **forbidden from importing anything else** from the rest of the pack!
Adding new dependencies to the Pack
------------------------------------
As the Pack is actually a Python package, you can use ``poetry`` (or ``pip``) to add new dependencies!
Use ``poetry add packagename`` to add and install a new dependency from the PyPI.
Publishing the pack Publishing the pack
------------------------------------ ------------------------------------
This section is not documented yet. To publish your Pack on the PyPI, run ``poetry build``, then ``poetry publish``.
Poetry will build your Pack and upload it to the PyPI for you.