From 7651d301d244033fc392eafef2985f245e9e4dd5 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 7 Aug 2022 01:51:38 -0400 Subject: [PATCH] Remove extra paragraph around keybindings --- docs/sphinx_extensions/dfhack/tool_docs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sphinx_extensions/dfhack/tool_docs.py b/docs/sphinx_extensions/dfhack/tool_docs.py index d1bdec8bf..920bef98e 100644 --- a/docs/sphinx_extensions/dfhack/tool_docs.py +++ b/docs/sphinx_extensions/dfhack/tool_docs.py @@ -45,12 +45,11 @@ def scan_all_keybinds(root_dir): def render_dfhack_keybind(command) -> List[nodes.paragraph]: + out = [] if command not in _KEYBINDS: - return [] - newnode = nodes.paragraph() + return out for keycmd, key, ctx in _KEYBINDS[command]: n = nodes.paragraph() - newnode += n n += nodes.strong('Keybinding:', 'Keybinding:') n += nodes.inline(' ', ' ') for k in key: @@ -61,7 +60,8 @@ def render_dfhack_keybind(command) -> List[nodes.paragraph]: if ctx: n += nodes.inline(' in ', ' in ') n += nodes.literal(ctx, ctx) - return [newnode] + out.append(n) + return out # pylint:disable=unused-argument,dangerous-default-value,too-many-arguments