Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd58158

Browse files
committed
get rid of tool TOC, use genindex
also add a stub role for dfhack-tag
1 parent 9c7731f commit bd58158

5 files changed

Lines changed: 47 additions & 58 deletions

File tree

conf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,18 @@ def dfhack_keybind_role_func(role, rawtext, text, lineno, inliner,
8282
return [newnode], []
8383

8484

85+
# pylint:disable=unused-argument,dangerous-default-value,too-many-arguments
86+
def dfhack_tag_role_func(role, rawtext, text, lineno, inliner,
87+
options={}, content=[]):
88+
"""Custom role parser for DFHack tags."""
89+
roles.set_classes(options)
90+
# TODO: link to generated tag index page
91+
newnode = nodes.inline(text, text)
92+
return [newnode], []
93+
94+
8595
roles.register_canonical_role('dfhack-keybind', dfhack_keybind_role_func)
96+
roles.register_canonical_role('dfhack-tag', dfhack_tag_role_func)
8697

8798
# -- Autodoc for DFhack plugins and scripts -------------------------------
8899

@@ -128,6 +139,7 @@ def write_tool_docs():
128139
footer.
129140
"""
130141
for k in DOC_ALL_DIRS:
142+
header = ':orphan:\n'
131143
label = ('.. _{name}:\n\n').format(name=k[0])
132144
# TODO: can we autogenerate the :dfhack-keybind: line? it would go beneath
133145
# the tool header, which is currently in the middle of the included file.
@@ -143,6 +155,7 @@ def write_tool_docs():
143155
os.makedirs(os.path.join('docs/tools', os.path.dirname(k[0])),
144156
mode=0o755, exist_ok=True)
145157
with open('docs/tools/{}.rst'.format(k[0]), mode) as outfile:
158+
outfile.write(header)
146159
if k[0] != 'search' and k[0] != 'stonesense':
147160
outfile.write(label)
148161
outfile.write(include)

docs/Introduction.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ used by the DFHack console.
5959
* Finally, some commands are persistent once enabled, and will sit in the
6060
background managing or changing some aspect of the game if you `enable` them.
6161

62+
.. note::
63+
In order to avoid user confusion, as a matter of policy all GUI tools
64+
display the word :guilabel:`DFHack` on the screen somewhere while active.
65+
66+
When that is not appropriate because they merely add keybinding hints to
67+
existing DF screens, they deliberately use red instead of green for the key.
6268

6369
Getting help
6470
============

docs/Tags.rst

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
.. _tags:
22

3-
Tags
4-
====
3+
Tool categories
4+
===============
55

6-
This is the list of tags and their descriptions.
6+
Related DFHack tools are grouped by tags to make them easier to find. If you'd
7+
like to see the full list of commands, please refer to the `index <genindex>`.
78

8-
- adventure: Tools relevant to adventure mode
9-
- fort: Tools relevant to fort mode
10-
- legends: Tools relevant to legends mode
11-
- items: Tools that create or modify in-game items
12-
- units: Tools that create or modify units
13-
- jobs: Tools that create or modify jobs
14-
- labors: Tools that deal with labor assignment
15-
- auto: Tools that automatically manage some aspect of your fortress
16-
- map: Map modification
17-
- system: Tools related to working with DFHack commands or the core DFHack library
18-
- productivity: Tools that help you do things that you could do manually, but using the tool is better and faster
19-
- animals: Tools that help you manage animals
20-
- fix: Tools that fix specific bugs
21-
- inspection: Tools that let you inspect game data
22-
- buildings/furniture: Tools that help you work wtih placing or configuring buildings and furniture
23-
- quickfort: Tools that are involved in creating and playing back blueprints
9+
These are the DFHack tool categories. Note that a tool may belong to more than
10+
one category.
11+
12+
- :dfhack-tag:`adventure`: Tools relevant to adventure mode
13+
- :dfhack-tag:`fort`: Tools relevant to fort mode
14+
- :dfhack-tag:`legends`: Tools relevant to legends mode
15+
- :dfhack-tag:`items`: Tools that create or modify in-game items
16+
- :dfhack-tag:`units`: Tools that create or modify units
17+
- :dfhack-tag:`jobs`: Tools that create or modify jobs
18+
- :dfhack-tag:`labors`: Tools that deal with labor assignment
19+
- :dfhack-tag:`auto`: Tools that automatically manage some aspect of your fortress
20+
- :dfhack-tag:`map`: Map modification
21+
- :dfhack-tag:`system`: Tools related to working with DFHack commands or the core DFHack library
22+
- :dfhack-tag:`productivity`: Tools that help you do things that you could do manually, but using the tool is better and faster
23+
- :dfhack-tag:`animals`: Tools that help you manage animals
24+
- :dfhack-tag:`fix`: Tools that fix specific bugs
25+
- :dfhack-tag:`inspection`: Tools that let you inspect game data
26+
- :dfhack-tag:`buildings/furniture`: Tools that help you work wtih placing or configuring buildings and furniture
27+
- :dfhack-tag:`quickfort`: Tools that are involved in creating and playing back blueprints

docs/index-tools.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

index.rst

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ Quick Links
1515

1616
* `Downloads <https://www.github.com/DFHack/dfhack/releases>`_
1717
* `Installation guide <installing>`
18-
* `Source code <https://www.github.com/DFHack/dfhack>`_
19-
(**important:** read `compile` before attempting to build from source)
20-
* `Bay 12 forums thread <https://dfhack.org/bay12>`_
21-
* `Bug tracker <https://www.github.com/DFHack/dfhack/issues>`_
18+
* `Getting help <support>`
19+
* :source:`Source code <>`
20+
(**important:** read `compile` before attempting to build from source.)
2221

2322
User Manual
2423
===========
@@ -30,25 +29,7 @@ User Manual
3029
/docs/Installing
3130
/docs/Support
3231
/docs/Core
32+
/docs/Tags
3333
/docs/guides/index
34-
/docs/index-about
3534
/docs/index-dev
36-
37-
Tools
38-
=====
39-
40-
DFHack commands, plugins, and scripts are grouped by tags to make it easier to
41-
find groups of related tools.
42-
43-
.. note::
44-
In order to avoid user confusion, as a matter of policy all GUI tools
45-
display the word :guilabel:`DFHack` on the screen somewhere while active.
46-
47-
When that is not appropriate because they merely add keybinding hints to
48-
existing DF screens, they deliberately use red instead of green for the key.
49-
50-
.. toctree::
51-
:maxdepth: 1
52-
53-
/docs/Tags
54-
/docs/index-tools
35+
/docs/index-about

0 commit comments

Comments
 (0)