1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Autodocumentation improvements

This commit is contained in:
Steffo 2019-12-10 17:39:11 +01:00
parent b5f4f17103
commit f193f94eef
4 changed files with 85 additions and 4 deletions

View file

@ -24,5 +24,29 @@
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings> </formatting-settings>
</DBN-SQL> </DBN-SQL>
<DBN-PSQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme> </code_scheme>
</component> </component>

View file

@ -9,7 +9,7 @@
<excludeFolder url="file://$MODULE_DIR$/docs" /> <excludeFolder url="file://$MODULE_DIR$/docs" />
<excludeFolder url="file://$MODULE_DIR$/royalnet.egg-info" /> <excludeFolder url="file://$MODULE_DIR$/royalnet.egg-info" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.8 (royalnet-Yo3bJ6Dg-py3.8)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.8 (royalnet-1MWM6-kd-py3.8)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="TestRunnerService"> <component name="TestRunnerService">

View file

@ -1,3 +1,40 @@
# `backpack` <!--This documentation was autogenerated with `python -m royalnet.generate -f markdown`.-->
# `royalnet.backpack`
A Pack that is imported by default by all Royalnet instances.
Keep things here to a minimum!
## Commands
### `version`
Display the current Royalnet version.
### `exception`
Raise an exception in the command.
### `excevent`
Call an event that raises an exception.
## Events
### `exception`
## Page Stars
### `/api/royalnet/version`
## Exception Stars
## Tables
### `telegram`
### `discord`
### `users`
A Pack that is imported by default by all `royalnet` instances.

View file

@ -42,10 +42,15 @@ def run(config_filename, file_format):
p(line) p(line)
elif file_format == "markdown": elif file_format == "markdown":
p("<!--This documentation was autogenerated with `python -m royalnet.generate -f markdown`.-->")
p("")
for pack_name in packs: for pack_name in packs:
pack = packs[pack_name] pack = packs[pack_name]
p(f"# {pack_name}") p(f"# `{pack_name}`")
p("") p("")
if pack.__doc__:
p(f"{pack.__doc__}")
p("")
try: try:
commands = pack.available_commands commands = pack.available_commands
@ -59,6 +64,9 @@ def run(config_filename, file_format):
p("") p("")
p(f"{command.description}") p(f"{command.description}")
p("") p("")
if command.__doc__:
p(f"{command.__doc__}")
p("")
if len(command.aliases) > 0: if len(command.aliases) > 0:
p(f"> Aliases: {''.join(['`' + alias + '` ' for alias in command.aliases])}") p(f"> Aliases: {''.join(['`' + alias + '` ' for alias in command.aliases])}")
p("") p("")
@ -73,6 +81,9 @@ def run(config_filename, file_format):
for event in events: for event in events:
p(f"### `{event.name}`") p(f"### `{event.name}`")
p("") p("")
if event.__doc__:
p(f"{event.__doc__}")
p("")
try: try:
page_stars = pack.available_page_stars page_stars = pack.available_page_stars
@ -84,6 +95,9 @@ def run(config_filename, file_format):
for page_star in page_stars: for page_star in page_stars:
p(f"### `{page_star.path}`") p(f"### `{page_star.path}`")
p("") p("")
if page_star.__doc__:
p(f"{page_star.__doc__}")
p("")
try: try:
exc_stars = pack.available_exception_stars exc_stars = pack.available_exception_stars
@ -95,6 +109,9 @@ def run(config_filename, file_format):
for exc_star in exc_stars: for exc_star in exc_stars:
p(f"### `{exc_star.error}`") p(f"### `{exc_star.error}`")
p("") p("")
if exc_star.__doc__:
p(f"{exc_star.__doc__}")
p("")
try: try:
tables = pack.available_tables tables = pack.available_tables
@ -107,6 +124,9 @@ def run(config_filename, file_format):
p(f"### `{table.__tablename__}`") p(f"### `{table.__tablename__}`")
p("") p("")
# TODO: list columns # TODO: list columns
if table.__doc__:
p(f"{table.__doc__}")
p("")
else: else:
raise click.ClickException("Unknown format") raise click.ClickException("Unknown format")