From addcbab3a6e5708e085e17db0cca8051cddc3a97 Mon Sep 17 00:00:00 2001 From: Alistair-Afton Date: Wed, 16 Sep 2026 02:28:55 +0200 Subject: [PATCH 1/2] docs: rename the stockpiles tag to stockpile The tag shares its name with the stockpiles plugin, so opening help for the tool in gui/launcher lists all tools carrying the tag instead of showing the plugin's entry and related tools. Fixes #5843 --- docs/Tags.rst | 2 +- docs/changelog.txt | 1 + docs/dev/Documentation.rst | 2 +- docs/plugins/blueprint.rst | 2 +- docs/plugins/logistics.rst | 2 +- docs/plugins/stockpiles.rst | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/Tags.rst b/docs/Tags.rst index 55bfde977b..788520f3a2 100644 --- a/docs/Tags.rst +++ b/docs/Tags.rst @@ -43,7 +43,7 @@ for the tag assignment spreadsheet. - `map `: Tools that interact with the game map. - `military `: Tools that interact with the military. - `plants `: Tools that interact with grass, trees, shrubs, and crops. -- `stockpiles `: Tools that interact with stockpiles. +- `stockpile `: Tools that interact with stockpiles. - `units `: Tools that interact with units. - `workorders `: Tools that interact with workorders. diff --git a/docs/changelog.txt b/docs/changelog.txt index 8730c9c446..3a5bcae5bf 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -65,6 +65,7 @@ Template for new versions: - `aquifer`: make ``--skip-top`` and top-relative ``--levels`` take effect for the ``drain``, ``convert``, and ``add`` actions instead of being silently ignored - `autodump`: ``destroy`` no longer leaves the contents of destroyed containers in limbo or crashes when destroying unit-held items - `timestream`: deal properly with units who have breathing difficulties +- rename the ``stockpiles`` tool tag to ``stockpile`` so it no longer collides with the `stockpiles` plugin in `gui/launcher` ## Misc Improvements - Added ``Coord2d`` and ``Coord3d`` C++ templates, providing a standard set operations for 2-tuples and 3-tuples of any numeric type diff --git a/docs/dev/Documentation.rst b/docs/dev/Documentation.rst index 0ba61c404d..efd2e9885f 100644 --- a/docs/dev/Documentation.rst +++ b/docs/dev/Documentation.rst @@ -163,7 +163,7 @@ And documentation for the ``autodump`` plugin might look like:: .. dfhack-tool:: :summary: Automatically set items in a stockpile to be dumped. - :tags: fort armok fps productivity items stockpiles + :tags: fort armok fps productivity items stockpile :no-command: .. dfhack-command:: autodump diff --git a/docs/plugins/blueprint.rst b/docs/plugins/blueprint.rst index 2d84a7ca69..3ec8d9c435 100644 --- a/docs/plugins/blueprint.rst +++ b/docs/plugins/blueprint.rst @@ -3,7 +3,7 @@ blueprint .. dfhack-tool:: :summary: Record a live game map in a quickfort blueprint. - :tags: fort design buildings map stockpiles + :tags: fort design buildings map stockpile With ``blueprint``, you can export the structure of a portion of your fortress in a blueprint file that you (or anyone else) can later play back with diff --git a/docs/plugins/logistics.rst b/docs/plugins/logistics.rst index 5a6fc9254c..4b3605f428 100644 --- a/docs/plugins/logistics.rst +++ b/docs/plugins/logistics.rst @@ -3,7 +3,7 @@ logistics .. dfhack-tool:: :summary: Automatically mark and route items in monitored stockpiles. - :tags: fort auto animals items stockpiles + :tags: fort auto animals items stockpile Commands act upon the stockpile selected in the UI unless another stockpile identifier is specified on the commandline. diff --git a/docs/plugins/stockpiles.rst b/docs/plugins/stockpiles.rst index 506b9d783c..c9b5f96bd4 100644 --- a/docs/plugins/stockpiles.rst +++ b/docs/plugins/stockpiles.rst @@ -3,7 +3,7 @@ stockpiles .. dfhack-tool:: :summary: Import, export, or modify stockpile settings. - :tags: fort design productivity stockpiles + :tags: fort design productivity stockpile Commands act upon the stockpile selected in the UI unless another stockpile identifier is specified on the commandline. From ccff22bddd79c80d822da4a34b71e16d0e4566ee Mon Sep 17 00:00:00 2001 From: Alistair-Afton Date: Wed, 16 Sep 2026 03:02:40 +0200 Subject: [PATCH 2/2] docs: tolerate tool tags that are not registered in Tags.rst Tool docs live in both dfhack and the scripts submodule, but tags are registered only from dfhack's Tags.rst. A tag rename lands in each repo separately while the submodule pin lags, so a build can see :tags: that no registered domain exists for. Skip unregistered tags instead of failing with a KeyError; they render as plain text and still get logged. --- docs/sphinx_extensions/dfhack/tool_docs.py | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/sphinx_extensions/dfhack/tool_docs.py b/docs/sphinx_extensions/dfhack/tool_docs.py index 6c65e5918d..3d385d8656 100644 --- a/docs/sphinx_extensions/dfhack/tool_docs.py +++ b/docs/sphinx_extensions/dfhack/tool_docs.py @@ -143,7 +143,12 @@ def add_index_entries(self, name) -> None: if 'unavailable' not in tags: self.env.domaindata['all']['objects'].append(indexdata) for tag in tags: - self.env.domaindata[tag]['objects'].append(indexdata) + # tolerate tags missing from Tags.rst: the scripts submodule pin + # can lag behind tag renames in either repo + if tag in self.env.domaindata: + self.env.domaindata[tag]['objects'].append(indexdata) + else: + logger.info('%s: ignoring unregistered tag: %s', docname, tag) @staticmethod def wrap_box(*children: List[nodes.Node]) -> nodes.Admonition: @@ -173,16 +178,22 @@ def render_content(self) -> List[nodes.Node]: tags = self.options.get('tags', []) self.env.domaindata['tag-repo']['doctags'][self.env.docname] = tags for tag in tags: - tag_paragraph += [ - addnodes.pending_xref(tag, nodes.inline(text=tag), **{ - 'reftype': 'ref', - 'refdomain': 'std', - 'reftarget': tag + '-tag-index', - 'refexplicit': True, - 'refwarn': True, - }), - nodes.inline(text=' | '), - ] + # link only tags registered in Tags.rst; the scripts submodule + # pin can lag behind tag renames in either repo + if tag in self.env.domaindata: + tag_paragraph += addnodes.pending_xref(tag, + nodes.inline(text=tag), **{ + 'reftype': 'ref', + 'refdomain': 'std', + 'reftarget': tag + '-tag-index', + 'refexplicit': True, + 'refwarn': True, + }) + else: + logger.info('%s: ignoring unregistered tag: %s', + self.env.docname, tag) + tag_paragraph += nodes.inline(text=tag) + tag_paragraph += nodes.inline(text=' | ') tag_paragraph.pop() ret_nodes = [tag_paragraph]