fix index titles on pdf

develop
myk002 2022-09-23 12:34:50 -07:00
parent 1cd5e8657a
commit 98b6ad4954
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 40 additions and 30 deletions

@ -13,36 +13,36 @@ for the tag assignment spreadsheet.
"when" tags
-----------
- `adventure-tag-index`: Tools that are useful while in adventure mode. Note that some tools only tagged with "fort" might also work in adventure mode, but not always in expected ways. Feel free to experiment, though!
- `dfhack-tag-index`: Tools that you use to run DFHack commands or interact with the DFHack library. This tag also includes tools that help you manage the DF game itself (e.g. settings, saving, etc.)
- `embark-tag-index`: Tools that are useful while on the fort embark screen or while creating an adventurer.
- `fort-tag-index`: Tools that are useful while in fort mode.
- `legends-tag-index`: Tools that are useful while in legends mode.
- `adventure <adventure-tag-index>`: Tools that are useful while in adventure mode. Note that some tools only tagged with "fort" might also work in adventure mode, but not always in expected ways. Feel free to experiment, though!
- `dfhack <dfhack-tag-index>`: Tools that you use to run DFHack commands or interact with the DFHack library. This tag also includes tools that help you manage the DF game itself (e.g. settings, saving, etc.)
- `embark <embark-tag-index>`: Tools that are useful while on the fort embark screen or while creating an adventurer.
- `fort <fort-tag-index>`: Tools that are useful while in fort mode.
- `legends <legends-tag-index>`: Tools that are useful while in legends mode.
"why" tags
----------
- `armok-tag-index`: Tools that give you complete control over an aspect of the game or provide access to information that the game intentionally keeps hidden.
- `auto-tag-index`: Tools that run in the background and automatically manage routine, toilsome aspects of your fortress.
- `bugfix-tag-index`: Tools that fix specific bugs, either permanently or on-demand.
- `design-tag-index`: Tools that help you design your fort.
- `dev-tag-index`: Tools that are useful when developing scripts or mods.
- `fps-tag-index`: Tools that help you manage FPS drop.
- `gameplay-tag-index`: Tools that introduce new gameplay elements.
- `inspection-tag-index`: Tools that let you view information that is otherwise difficult to find.
- `productivity-tag-index`: Tools that help you do things that you could do manually, but using the tool is better and faster.
- `armok <armok-tag-index>`: Tools that give you complete control over an aspect of the game or provide access to information that the game intentionally keeps hidden.
- `auto <auto-tag-index>`: Tools that run in the background and automatically manage routine, toilsome aspects of your fortress.
- `bugfix <bugfix-tag-index>`: Tools that fix specific bugs, either permanently or on-demand.
- `design <design-tag-index>`: Tools that help you design your fort.
- `dev <dev-tag-index>`: Tools that are useful when developing scripts or mods.
- `fps <fps-tag-index>`: Tools that help you manage FPS drop.
- `gameplay <gameplay-tag-index>`: Tools that introduce new gameplay elements.
- `inspection <inspection-tag-index>`: Tools that let you view information that is otherwise difficult to find.
- `productivity <productivity-tag-index>`: Tools that help you do things that you could do manually, but using the tool is better and faster.
"what" tags
-----------
- `animals-tag-index`: Tools that interact with animals.
- `buildings-tag-index`: Tools that interact with buildings and furniture.
- `graphics-tag-index`: Tools that interact with game graphics.
- `interface-tag-index`: Tools that interact with or extend the DF user interface.
- `items-tag-index`: Tools that interact with in-game items.
- `jobs-tag-index`: Tools that interact with jobs.
- `labors-tag-index`: Tools that deal with labor assignment.
- `map-tag-index`: Tools that interact with the game map.
- `military-tag-index`: Tools that interact with the military.
- `plants-tag-index`: Tools that interact with trees, shrubs, and crops.
- `stockpiles-tag-index`: Tools that interact wtih stockpiles.
- `units-tag-index`: Tools that interact with units.
- `workorders-tag-index`: Tools that interact with workorders.
- `animals <animals-tag-index>`: Tools that interact with animals.
- `buildings <buildings-tag-index>`: Tools that interact with buildings and furniture.
- `graphics <graphics-tag-index>`: Tools that interact with game graphics.
- `interface <interface-tag-index>`: Tools that interact with or extend the DF user interface.
- `items <items-tag-index>`: Tools that interact with in-game items.
- `jobs <jobs-tag-index>`: Tools that interact with jobs.
- `labors <labors-tag-index>`: Tools that deal with labor assignment.
- `map <map-tag-index>`: Tools that interact with the game map.
- `military <military-tag-index>`: Tools that interact with the military.
- `plants <plants-tag-index>`: Tools that interact with trees, shrubs, and crops.
- `stockpiles <stockpiles-tag-index>`: Tools that interact wtih stockpiles.
- `units <units-tag-index>`: Tools that interact with units.
- `workorders <workorders-tag-index>`: Tools that interact with workorders.

@ -216,7 +216,7 @@ class TagRepoDomain(Domain):
def get_tags():
groups = {}
group_re = re.compile(r'"([^"]+)"')
tag_re = re.compile(r'- `([^`]+)-tag-index`: (.*)')
tag_re = re.compile(r'- `([^ ]+) <[^>]+>`: (.*)')
with open('docs/Tags.rst') as f:
lines = f.readlines()
for line in lines:
@ -282,15 +282,25 @@ def init_tag_indices(app):
tag, desc = tag_tuple[0], tag_tuple[1]
topidx.write(('- `{name} <{name}-tag-index>`\n').format(name=tag))
topidx.write((' {desc}\n').format(desc=desc))
register_index(app, tag, '%s<h4>%s</h4>' % (tag, desc))
register_index(app, tag, desc)
def update_index_titles(app):
for domain in app.env.domains.values():
for index in domain.indices:
if index.shortname == 'all':
continue
if app.builder.format == 'html':
index.localname = '"%s" tag index<h4>%s</h4>' % (index.shortname, index.localname)
else:
index.localname = '%s tag index - %s' % (index.shortname, index.localname)
def register(app):
app.add_directive('dfhack-tool', DFHackToolDirective)
app.add_directive('dfhack-command', DFHackCommandDirective)
update_index_titles(app)
_KEYBINDS.update(scan_all_keybinds(os.path.join(dfhack.util.DFHACK_ROOT, 'data', 'init')))
def setup(app):
app.connect('builder-inited', register)