Skip to content

Commit d1892fe

Browse files
committed
➖ Switch from numpydocnapoleon
1 parent cfd32b5 commit d1892fe

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/_sources/conf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def yaml_to_rst(path):
149149
'sphinxcontrib.programoutput',
150150
'exec',
151151
'nbsphinx',
152-
'numpydoc']
152+
'napoleon']
153153

154154
bibtex_bibfiles = [f'references/{bib}' for bib in os.listdir('references') if
155155
bib.endswith('.bib')]
@@ -588,29 +588,33 @@ def format_node_block_docstrings(lines: list) -> None:
588588
lines : list
589589
modified in-place
590590
"""
591+
first_to_del = None
591592
indent = 0
592593
insert_at = None
593-
first_to_del = None
594+
insert_herald = True
594595
nevermore = False
595596
for i, line in enumerate(lines):
596597
if nevermore and not line.strip():
597598
first_to_del = i + 1
598599
nevermore = False
599600
if line.lstrip().startswith("Node Block:"):
600-
insert_at = i + 1
601601
indent = 3
602+
insert_at = i + 1
603+
insert_herald = False
602604
else:
603605
if indent == 0 and re.match(r"\s*{['\"]name['\"]:", line):
604606
insert_at = i
605607
indent = 3
606608
lines[i] = f'{" " * indent}{line}'
607609
if re.match(r"\s*{['\"]outputs['\"]:", line):
608610
nevermore = True
609-
if first_to_del is not None:
610-
del lines[first_to_del:]
611611
if insert_at is not None:
612612
lines.insert(insert_at, '')
613613
lines.insert(insert_at, ".. code-block:: Python")
614+
if insert_herald:
615+
lines.insert(insert_at, "Node Block:")
616+
if first_to_del is not None:
617+
del lines[first_to_del:]
614618

615619

616620
def initialize_factory() -> None:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Jinja2<3.1
77
m2r
88
mistune==0.8.4
99
nbsphinx
10-
numpydoc
1110
PyGithub
1211
sphinx==4.0
1312
sphinxcontrib-bibtex==2.4.2

0 commit comments

Comments
 (0)