File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def yaml_to_rst(path):
149149 'sphinxcontrib.programoutput' ,
150150 'exec' ,
151151 'nbsphinx' ,
152- 'numpydoc ' ]
152+ 'napoleon ' ]
153153
154154bibtex_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
616620def initialize_factory () -> None :
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ Jinja2<3.1
77m2r
88mistune == 0.8.4
99nbsphinx
10- numpydoc
1110PyGithub
1211sphinx == 4.0
1312sphinxcontrib-bibtex == 2.4.2
You can’t perform that action at this time.
0 commit comments