Make the plugin list a definition-list instead of the raw toctree

to show a short description of each plugin, instead of just
the long list of names.
This commit is contained in:
Valentin Lorentz 2021-04-17 17:58:47 +02:00
parent ab99fac88d
commit 008b183f28
2 changed files with 19 additions and 1 deletions

View File

@ -19,7 +19,7 @@ You should also be somewhat familiar with the
.. note:: .. note::
This document is a work in progress and is still incomplete. This document is a work in progress and is still incomplete.
As usually, feel free to ask any questions in #limnoria @ freenode. As usual, feel free to ask any questions in #limnoria @ freenode.
Main loop and drivers Main loop and drivers
===================== =====================

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import importlib
import os import os
import pkgutil import pkgutil
import subprocess import subprocess
@ -40,8 +41,25 @@ with open(os.path.join(OUTPUT_DIR, "index.rst"), "w") as fd:
.. _Limnoria.net's plugin page: https://limnoria.net/plugins.xhtml .. _Limnoria.net's plugin page: https://limnoria.net/plugins.xhtml
"""
)
)
for plugin in plugins:
if plugin == "Alias":
# Deprecated
continue
plugin_module = importlib.import_module(f"supybot.plugins.{plugin}")
fd.write(f":doc:`{plugin} <{plugin}>`\n")
fd.write(textwrap.indent(plugin_module.__doc__, " "))
fd.write("\n")
fd.write(
textwrap.dedent(
"""
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
:hidden:
""" """
) )