Skip to content

Commit 76fb973

Browse files
committed
♻️ Refactor end-of-code-block
1 parent d1892fe commit 76fb973

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

docs/_sources/conf.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,13 @@ def format_node_block_docstrings(lines: list) -> None:
588588
lines : list
589589
modified in-place
590590
"""
591-
first_to_del = None
592591
indent = 0
593592
insert_at = None
594593
insert_herald = True
595594
nevermore = False
596595
for i, line in enumerate(lines):
597596
if nevermore and not line.strip():
598-
first_to_del = i + 1
599-
nevermore = False
597+
indent = 0
600598
if line.lstrip().startswith("Node Block:"):
601599
indent = 3
602600
insert_at = i + 1
@@ -613,8 +611,6 @@ def format_node_block_docstrings(lines: list) -> None:
613611
lines.insert(insert_at, ".. code-block:: Python")
614612
if insert_herald:
615613
lines.insert(insert_at, "Node Block:")
616-
if first_to_del is not None:
617-
del lines[first_to_del:]
618614

619615

620616
def initialize_factory() -> None:

0 commit comments

Comments
 (0)