Skip to content

Commit fa1996f

Browse files
committed
fixup! ♻️ Refactor end-of-code-block
1 parent a16ab10 commit fa1996f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/_sources/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ def format_node_block_docstrings(lines: list) -> None:
593593
insert_herald = True
594594
nevermore = False
595595
for i, line in enumerate(lines):
596+
if re.match(r"\s*{['\"]outputs['\"]:", line):
597+
nevermore = True
596598
if nevermore and not line.strip():
597599
indent = 0
598600
if line.lstrip().startswith("Node Block:"):
@@ -604,12 +606,11 @@ def format_node_block_docstrings(lines: list) -> None:
604606
insert_at = i
605607
indent = 3
606608
lines[i] = f'{" " * indent}{line}'
607-
if re.match(r"\s*{['\"]outputs['\"]:", line):
608-
nevermore = True
609609
if insert_at is not None:
610610
lines.insert(insert_at, '')
611611
lines.insert(insert_at, ".. code-block:: Python")
612612
if insert_herald:
613+
lines.insert(insert_at, '')
613614
lines.insert(insert_at, "Node Block:")
614615
print('\n'.join([f'|{line}|' for line in lines]))
615616

0 commit comments

Comments
 (0)