Myk sample command help (#2238)

* add example tool documentation in proposed format

* refine Tools.rst
develop
Myk 2022-07-05 14:05:34 -07:00 committed by myk002
parent f1cb9b9a83
commit 27d7c3acc6
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
4 changed files with 49 additions and 5 deletions

@ -66,11 +66,7 @@ def dfhack_keybind_role_func(role, rawtext, text, lineno, inliner,
"""Custom role parser for DFHack default keybinds.""" """Custom role parser for DFHack default keybinds."""
roles.set_classes(options) roles.set_classes(options)
if text not in KEYBINDS: if text not in KEYBINDS:
msg = inliner.reporter.error( return [], []
'no keybinding for {} in dfhack.init-example'.format(text),
line=lineno)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]
newnode = nodes.paragraph() newnode = nodes.paragraph()
for cmd, key, ctx in KEYBINDS[text]: for cmd, key, ctx in KEYBINDS[text]:
n = nodes.paragraph() n = nodes.paragraph()

@ -0,0 +1,13 @@
.. _tools-index:
############
DFHack Tools
############
These are the DFHack commands you can run.
.. toctree::
:titlesonly:
:glob:
/docs/tools/*

@ -0,0 +1,34 @@
cromulate
=========
Tags: productivity, unit, adventure
:dfhack-keybind:`cromulate`
Collects all widgets into a frobozz electric cromufiler. You might want to do
this if you discover that your widgets have become decromulated. It is safe to
run this command periodically even if you are unsure if that's the case.
Usage::
cromulate [all|here] [<options>]
When run without parameters, it lists all your widgets. Add the ``all`` keyword
to collect all widgets into the cromufiler, or the ``here`` keyword to just
collect those under the cursor.
Options:
:``-d``, ``--destroy``:
Destroy the widgets instead of collecting them into the cromufiler.
:``-q``, ``--quiet``:
Don't display any informational output. Errors will still be printed to the
console.
Examples:
- ``cromulate``
Lists all widgets and their positions
- ``cromlate all``
Gather all widgets into the cromufiler
- ``cromulate here --destroy``
Destroys the widgets under the cursor

@ -32,6 +32,7 @@ User Manual
/docs/Core /docs/Core
/docs/Plugins /docs/Plugins
/docs/Scripts /docs/Scripts
/docs/Tools
/docs/guides/index /docs/guides/index
/docs/index-about /docs/index-about
/docs/index-dev /docs/index-dev