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
develop
myk002 2022-07-22 15:16:57 -07:00
parent 6752025848
commit e8ffa55dfe
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
26 changed files with 43 additions and 54 deletions

@ -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:

@ -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 <genindex>`.
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 <genindex>`.
.. contents:: Contents
:local:

@ -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:

@ -63,7 +63,7 @@ are not built by default, but can be built by setting the ``BUILD_DEVEL``
Scripts
~~~~~~~
Several :dfhack-tag:`development tools <dev>` can be useful for memory research.
Several `development tools <tag/dev>` can be useful for memory research.
These include (but are not limited to):
- `devel/dump-offsets`

@ -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

@ -1,7 +1,7 @@
alias
=====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`alias`
:index:`Configure helper aliases for other DFHack commands.

@ -1,7 +1,7 @@
cls
===
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`cls`
:index:`Clear the terminal screen. <cls; Clear the terminal screen.>` Can also

@ -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.

@ -1,7 +1,7 @@
die
===
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`die`
:index:`Instantly exit DF without saving.

@ -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.

@ -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.

@ -1,7 +1,7 @@
fpause
======
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`fpause`
:index:`Forces DF to pause. <fpause; Forces DF to pause.>` This is useful when

@ -1,7 +1,7 @@
help
====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`help`
:index:`Display help about a command or plugin.

@ -1,7 +1,7 @@
hide
====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`hide`
:index:`Hide the DFHack terminal window.

@ -1,7 +1,7 @@
keybinding
==========
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`keybinding`
:index:`Create hotkeys that will run DFHack commands.

@ -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.

@ -1,7 +1,7 @@
load
====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`load`
:index:`Load and register a plugin library.

@ -1,7 +1,7 @@
ls
==
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`ls`
:index:`List available DFHack commands. <ls; List available DFHack commands.>`

@ -1,7 +1,7 @@
plug
====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`plug`
:index:`List available plugins and whether they are enabled.

@ -1,7 +1,7 @@
reload
======
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`reload`
:index:`Reload a loaded plugin. <reload; Reload a loaded plugin.>` Developers

@ -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.

@ -1,7 +1,7 @@
script
======
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`script`
:index:`Execute a batch file of DFHack commands.

@ -1,7 +1,7 @@
show
====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`show`
:index:`Unhides the DFHack terminal window.

@ -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.

@ -1,7 +1,7 @@
type
====
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`type`
:index:`Describe how a command is implemented.

@ -1,7 +1,7 @@
unload
======
Tags: :dfhack-tag:`system`
Tags: `tag/system`
:dfhack-keybind:`unload`
:index:`Unload a plugin from memory. <unload; Unload a plugin from memory.>`