From e8ffa55dfe98ecd8003514eada5531fa30d35c03 Mon Sep 17 00:00:00 2001 From: myk002 Date: Fri, 22 Jul 2022 15:16:57 -0700 Subject: [PATCH] use a label instead of a custom role since I can't seem to figure out how to inject a link to a label via the role processing code --- conf.py | 13 +----------- docs/Categories.rst | 4 ++-- docs/Core.rst | 2 +- docs/Memory-research.rst | 2 +- docs/Tags.rst | 34 ++++++++++++++++---------------- docs/builtins/alias.rst | 2 +- docs/builtins/cls.rst | 2 +- docs/builtins/devel/dump-rpc.rst | 2 +- docs/builtins/die.rst | 2 +- docs/builtins/disable.rst | 2 +- docs/builtins/enable.rst | 2 +- docs/builtins/fpause.rst | 2 +- docs/builtins/help.rst | 2 +- docs/builtins/hide.rst | 2 +- docs/builtins/keybinding.rst | 2 +- docs/builtins/kill-lua.rst | 2 +- docs/builtins/load.rst | 2 +- docs/builtins/ls.rst | 2 +- docs/builtins/plug.rst | 2 +- docs/builtins/reload.rst | 2 +- docs/builtins/sc-script.rst | 2 +- docs/builtins/script.rst | 2 +- docs/builtins/show.rst | 2 +- docs/builtins/tags.rst | 2 +- docs/builtins/type.rst | 2 +- docs/builtins/unload.rst | 2 +- 26 files changed, 43 insertions(+), 54 deletions(-) diff --git a/conf.py b/conf.py index e80b5a027..854693ad0 100644 --- a/conf.py +++ b/conf.py @@ -82,18 +82,7 @@ def dfhack_keybind_role_func(role, rawtext, text, lineno, inliner, return [newnode], [] -# pylint:disable=unused-argument,dangerous-default-value,too-many-arguments -def dfhack_tag_role_func(role, rawtext, text, lineno, inliner, - options={}, content=[]): - """Custom role parser for DFHack tags.""" - roles.set_classes(options) - # TODO: link to generated tag index page - newnode = nodes.inline(text, text) - return [newnode], [] - - roles.register_canonical_role('dfhack-keybind', dfhack_keybind_role_func) -roles.register_canonical_role('dfhack-tag', dfhack_tag_role_func) # -- Autodoc for DFhack plugins and scripts ------------------------------- @@ -129,7 +118,7 @@ DOC_ALL_DIRS = doc_all_dirs() def get_tags(): tags = [] - tag_re = re.compile(r'- :dfhack-tag:`([^`]+)`: (.*)') + tag_re = re.compile(r'- `tag/([^`]+)`: (.*)') with open('docs/Tags.rst') as f: lines = f.readlines() for line in lines: diff --git a/docs/Categories.rst b/docs/Categories.rst index 541f89195..46fc71bdf 100644 --- a/docs/Categories.rst +++ b/docs/Categories.rst @@ -4,8 +4,8 @@ Tool categories =============== DFHack tools are grouped to make them easier to find. Note that a tool can -belong to more than one category. If you'd like to see the full list of tools, -please refer to the `index `. +belong to more than one category. If you'd like to see the full list of tools +in one flat list, please refer to the `index `. .. contents:: Contents :local: diff --git a/docs/Core.rst b/docs/Core.rst index dd00885d0..025e951e6 100644 --- a/docs/Core.rst +++ b/docs/Core.rst @@ -185,7 +185,7 @@ where ``*`` can be any string, including the empty string. A world being loaded can mean a fortress, an adventurer, or legends mode. These files are best used for non-persistent commands, such as setting -a :dfhack-tag:`fix` script to run on `repeat`. +a `tag/fix` script to run on `repeat`. .. _onMapLoad.init: diff --git a/docs/Memory-research.rst b/docs/Memory-research.rst index 091f1c8e7..d9c0833e3 100644 --- a/docs/Memory-research.rst +++ b/docs/Memory-research.rst @@ -63,7 +63,7 @@ are not built by default, but can be built by setting the ``BUILD_DEVEL`` Scripts ~~~~~~~ -Several :dfhack-tag:`development tools ` can be useful for memory research. +Several `development tools ` can be useful for memory research. These include (but are not limited to): - `devel/dump-offsets` diff --git a/docs/Tags.rst b/docs/Tags.rst index 7afbe0a02..432632ba1 100644 --- a/docs/Tags.rst +++ b/docs/Tags.rst @@ -1,19 +1,19 @@ :orphan: -- :dfhack-tag:`adventure`: Tools that are useful while in adventure mode -- :dfhack-tag:`fort`: Tools that are useful while in fort mode -- :dfhack-tag:`legends`: Tools that are useful while in legends mode -- :dfhack-tag:`items`: Tools that create or modify in-game items -- :dfhack-tag:`units`: Tools that create or modify units -- :dfhack-tag:`jobs`: Tools that create or modify jobs -- :dfhack-tag:`labors`: Tools that deal with labor assignment -- :dfhack-tag:`auto`: Tools that automatically manage some aspect of your fortress -- :dfhack-tag:`map`: Map modification -- :dfhack-tag:`system`: Tools related to working with DFHack commands or the core DFHack library -- :dfhack-tag:`productivity`: Tools that help you do things that you could do manually, but using the tool is better and faster -- :dfhack-tag:`animals`: Tools that help you manage animals -- :dfhack-tag:`fix`: Tools that fix specific bugs -- :dfhack-tag:`inspection`: Tools that let you inspect game data -- :dfhack-tag:`buildings`: Tools that help you work wtih placing or configuring buildings and furniture -- :dfhack-tag:`quickfort`: Tools that are involved in creating and playing back blueprints -- :dfhack-tag:`dev`: Tools useful for develpers and modders +- `tag/adventure`: Tools that are useful while in adventure mode +- `tag/fort`: Tools that are useful while in fort mode +- `tag/legends`: Tools that are useful while in legends mode +- `tag/items`: Tools that create or modify in-game items +- `tag/units`: Tools that create or modify units +- `tag/jobs`: Tools that create or modify jobs +- `tag/labors`: Tools that deal with labor assignment +- `tag/auto`: Tools that automatically manage some aspect of your fortress +- `tag/map`: Map modification +- `tag/system`: Tools related to working with DFHack commands or the core DFHack library +- `tag/productivity`: Tools that help you do things that you could do manually, but using the tool is better and faster +- `tag/animals`: Tools that help you manage animals +- `tag/fix`: Tools that fix specific bugs +- `tag/inspection`: Tools that let you inspect game data +- `tag/buildings`: Tools that help you work wtih placing or configuring buildings and furniture +- `tag/quickfort`: Tools that are involved in creating and playing back blueprints +- `tag/dev`: Tools useful for develpers and modders diff --git a/docs/builtins/alias.rst b/docs/builtins/alias.rst index 6de550875..234f8ae4a 100644 --- a/docs/builtins/alias.rst +++ b/docs/builtins/alias.rst @@ -1,7 +1,7 @@ alias ===== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`alias` :index:`Configure helper aliases for other DFHack commands. diff --git a/docs/builtins/cls.rst b/docs/builtins/cls.rst index 5c1189951..2f5387c7f 100644 --- a/docs/builtins/cls.rst +++ b/docs/builtins/cls.rst @@ -1,7 +1,7 @@ cls === -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`cls` :index:`Clear the terminal screen. ` Can also diff --git a/docs/builtins/devel/dump-rpc.rst b/docs/builtins/devel/dump-rpc.rst index 05f1d4e9e..2f798c79e 100644 --- a/docs/builtins/devel/dump-rpc.rst +++ b/docs/builtins/devel/dump-rpc.rst @@ -1,7 +1,7 @@ devel/dump-rpc ============== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`devel/dump-rpc` :index:`Write RPC endpoint information to the specified file. diff --git a/docs/builtins/die.rst b/docs/builtins/die.rst index c2ea083fd..df53c94bd 100644 --- a/docs/builtins/die.rst +++ b/docs/builtins/die.rst @@ -1,7 +1,7 @@ die === -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`die` :index:`Instantly exit DF without saving. diff --git a/docs/builtins/disable.rst b/docs/builtins/disable.rst index 1e2336545..d17706486 100644 --- a/docs/builtins/disable.rst +++ b/docs/builtins/disable.rst @@ -1,7 +1,7 @@ disable ======= -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`disable` :index:`Deactivate a DFHack tool that has some persistent effect. diff --git a/docs/builtins/enable.rst b/docs/builtins/enable.rst index 4630c2004..1a714f602 100644 --- a/docs/builtins/enable.rst +++ b/docs/builtins/enable.rst @@ -1,7 +1,7 @@ enable ====== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`enable` :index:`Activate a DFHack tool that has some persistent effect. diff --git a/docs/builtins/fpause.rst b/docs/builtins/fpause.rst index 927206e8d..f40f6d55c 100644 --- a/docs/builtins/fpause.rst +++ b/docs/builtins/fpause.rst @@ -1,7 +1,7 @@ fpause ====== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`fpause` :index:`Forces DF to pause. ` This is useful when diff --git a/docs/builtins/help.rst b/docs/builtins/help.rst index 6249bdbe9..290d62e4c 100644 --- a/docs/builtins/help.rst +++ b/docs/builtins/help.rst @@ -1,7 +1,7 @@ help ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`help` :index:`Display help about a command or plugin. diff --git a/docs/builtins/hide.rst b/docs/builtins/hide.rst index 3c79f9ff0..e4f91abaa 100644 --- a/docs/builtins/hide.rst +++ b/docs/builtins/hide.rst @@ -1,7 +1,7 @@ hide ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`hide` :index:`Hide the DFHack terminal window. diff --git a/docs/builtins/keybinding.rst b/docs/builtins/keybinding.rst index 27ab86da6..2ad9e1542 100644 --- a/docs/builtins/keybinding.rst +++ b/docs/builtins/keybinding.rst @@ -1,7 +1,7 @@ keybinding ========== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`keybinding` :index:`Create hotkeys that will run DFHack commands. diff --git a/docs/builtins/kill-lua.rst b/docs/builtins/kill-lua.rst index 3f4bbf3c4..4b93b8734 100644 --- a/docs/builtins/kill-lua.rst +++ b/docs/builtins/kill-lua.rst @@ -1,7 +1,7 @@ kill-lua ======== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`kill-lua` :index:`Gracefully stops any currently-running Lua scripts. diff --git a/docs/builtins/load.rst b/docs/builtins/load.rst index 22e8067f3..8e51847dd 100644 --- a/docs/builtins/load.rst +++ b/docs/builtins/load.rst @@ -1,7 +1,7 @@ load ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`load` :index:`Load and register a plugin library. diff --git a/docs/builtins/ls.rst b/docs/builtins/ls.rst index 775ccfc63..e68b740c7 100644 --- a/docs/builtins/ls.rst +++ b/docs/builtins/ls.rst @@ -1,7 +1,7 @@ ls == -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`ls` :index:`List available DFHack commands. ` diff --git a/docs/builtins/plug.rst b/docs/builtins/plug.rst index 7dbbf0115..47efe66b3 100644 --- a/docs/builtins/plug.rst +++ b/docs/builtins/plug.rst @@ -1,7 +1,7 @@ plug ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`plug` :index:`List available plugins and whether they are enabled. diff --git a/docs/builtins/reload.rst b/docs/builtins/reload.rst index a5ab60859..cde113ac8 100644 --- a/docs/builtins/reload.rst +++ b/docs/builtins/reload.rst @@ -1,7 +1,7 @@ reload ====== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`reload` :index:`Reload a loaded plugin. ` Developers diff --git a/docs/builtins/sc-script.rst b/docs/builtins/sc-script.rst index feabe4c6f..bcedb610e 100644 --- a/docs/builtins/sc-script.rst +++ b/docs/builtins/sc-script.rst @@ -1,7 +1,7 @@ sc-script ========= -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`sc-script` :index:`Run commands when game state changes occur. diff --git a/docs/builtins/script.rst b/docs/builtins/script.rst index b83f19171..ef1aab64a 100644 --- a/docs/builtins/script.rst +++ b/docs/builtins/script.rst @@ -1,7 +1,7 @@ script ====== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`script` :index:`Execute a batch file of DFHack commands. diff --git a/docs/builtins/show.rst b/docs/builtins/show.rst index e337bbbb6..b22d4bab9 100644 --- a/docs/builtins/show.rst +++ b/docs/builtins/show.rst @@ -1,7 +1,7 @@ show ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`show` :index:`Unhides the DFHack terminal window. diff --git a/docs/builtins/tags.rst b/docs/builtins/tags.rst index cc5c86a4b..b601a73a1 100644 --- a/docs/builtins/tags.rst +++ b/docs/builtins/tags.rst @@ -1,7 +1,7 @@ tags ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`tags` :index:`List the strings that DFHack tools can be tagged with. diff --git a/docs/builtins/type.rst b/docs/builtins/type.rst index 33ef7562f..755548da9 100644 --- a/docs/builtins/type.rst +++ b/docs/builtins/type.rst @@ -1,7 +1,7 @@ type ==== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`type` :index:`Describe how a command is implemented. diff --git a/docs/builtins/unload.rst b/docs/builtins/unload.rst index 3d1575c20..1fc8c311e 100644 --- a/docs/builtins/unload.rst +++ b/docs/builtins/unload.rst @@ -1,7 +1,7 @@ unload ====== -Tags: :dfhack-tag:`system` +Tags: `tag/system` :dfhack-keybind:`unload` :index:`Unload a plugin from memory. `