@@ -67,7 +67,7 @@ def _generate_exclude_pattern(include_api=True, single_doc=None):
67
67
return exclude_patterns
68
68
69
69
70
- def _write_temp_file (classtype , module , function ):
70
+ def _write_temp_file2 (classtype , module , function ):
71
71
72
72
s = """{1}.{2}
73
73
=================================
@@ -80,6 +80,22 @@ def _write_temp_file(classtype, module, function):
80
80
f .write (s )
81
81
82
82
83
+ def _write_temp_file (classtype , module , function ):
84
+
85
+ s = """API docs
86
+ ========
87
+
88
+ .. autosummary::
89
+ :toctree: generated_temp/
90
+
91
+ {0}.{1}
92
+
93
+ """ .format (module , function )
94
+
95
+ with open (os .path .join (SOURCE_PATH , "temp.rst" ), 'w' ) as f :
96
+ f .write (s )
97
+
98
+
83
99
@contextmanager
84
100
def _maybe_exclude_notebooks ():
85
101
"""Skip building the notebooks if pandoc is not installed.
@@ -242,7 +258,8 @@ def build_docstring(self):
242
258
'-Dexclude_patterns={}' .format (self .exclude_patterns ),
243
259
SOURCE_PATH ,
244
260
os .path .join (BUILD_PATH , 'html' ),
245
- os .path .join (SOURCE_PATH , 'temp.rst' )
261
+ os .path .join (SOURCE_PATH , 'temp.rst' ),
262
+ os .path .join (SOURCE_PATH , 'generated_temp/*.rst' ),
246
263
)
247
264
# for some reason it does not work with run_os, but it does if I
248
265
# directly call the joined command
@@ -299,7 +316,7 @@ def main():
299
316
DocBuilder (args .num_jobs , exclude_patterns ).build_docstring ()
300
317
url = "file://" + os .getcwd () + "/build/html/temp.html"
301
318
webbrowser .open (url , new = 2 )
302
- os .remove ('source/temp.rst' )
319
+ # os.remove('source/temp.rst')
303
320
304
321
else :
305
322
_generate_index (not args .no_api , args .single )
0 commit comments