Allow empty :tags:, give section a name to prevent errors

develop
lethosor 2022-07-27 22:02:08 -04:00
parent d96260556e
commit 89a88e94a9
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 2 additions and 2 deletions

@ -21,7 +21,7 @@ class DFHackToolDirective(sphinx.directives.ObjectDescription):
tool_name = self.get_signatures()[0]
tag_nodes = [nodes.strong(text='Tags: ')]
for tag in self.options['tags']:
for tag in self.options.get('tags', []):
tag_nodes += [
nodes.literal(tag, tag),
nodes.inline(text=' | '),
@ -29,7 +29,7 @@ class DFHackToolDirective(sphinx.directives.ObjectDescription):
tag_nodes.pop()
return [
nodes.section('', nodes.title(text=tool_name)),
nodes.section('', nodes.title(text=tool_name), ids=[tool_name]),
nodes.paragraph('', '', *tag_nodes),
]