Skip to content

Commit

Permalink
Myk sample command help (#2238)
Browse files Browse the repository at this point in the history
* add example tool documentation in proposed format

* refine Tools.rst
  • Loading branch information
myk002 committed Jul 11, 2022
1 parent f1cb9b9 commit 27d7c3a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
6 changes: 1 addition & 5 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ def dfhack_keybind_role_func(role, rawtext, text, lineno, inliner,
"""Custom role parser for DFHack default keybinds."""
roles.set_classes(options)
if text not in KEYBINDS:
msg = inliner.reporter.error(
'no keybinding for {} in dfhack.init-example'.format(text),
line=lineno)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]
return [], []
newnode = nodes.paragraph()
for cmd, key, ctx in KEYBINDS[text]:
n = nodes.paragraph()
Expand Down
13 changes: 13 additions & 0 deletions docs/Tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _tools-index:

############
DFHack Tools
############

These are the DFHack commands you can run.

.. toctree::
:titlesonly:
:glob:

/docs/tools/*
34 changes: 34 additions & 0 deletions docs/tools/cromulate.rst
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ User Manual
/docs/Core
/docs/Plugins
/docs/Scripts
/docs/Tools
/docs/guides/index
/docs/index-about
/docs/index-dev

0 comments on commit 27d7c3a

Please sign in to comment.