@@ -164,17 +164,32 @@ def _read_txt(path):
164
164
return data
165
165
166
166
def generate_report (self ):
167
- boilerplate = None
168
167
logs_path = self .out_dir / 'fmriprep' / 'logs'
168
+
169
+ boilerplate = []
170
+ boiler_idx = 0
171
+
169
172
if (logs_path / 'CITATION.html' ).exists ():
170
- boilerplate = (logs_path / 'CITATION.html' ).read_text ()
171
- boilerplate = re .compile (
173
+ text = (logs_path / 'CITATION.html' ).read_text ()
174
+ text = re .compile (
172
175
'<body>(.*?)</body>' ,
173
- re .DOTALL | re .IGNORECASE ).findall (boilerplate )[0 ].strip ()
174
- boilerplate = '<div class="boiler-text">%s</div>' % boilerplate
175
-
176
- elif (logs_path / 'CITATION.md' ).exists ():
177
- boilerplate = '<pre>%s</pre>' % (logs_path / 'CITATION.md' ).read_text ()
176
+ re .DOTALL | re .IGNORECASE ).findall (text )[0 ].strip ()
177
+ text = '<div class="boiler-text">%s</div>' % text
178
+ boilerplate .append ((boiler_idx , 'HTML' , text ))
179
+ boiler_idx += 1
180
+
181
+ if (logs_path / 'CITATION.md' ).exists ():
182
+ text = '<pre>%s</pre>' % (logs_path / 'CITATION.md' ).read_text ()
183
+ boilerplate .append ((boiler_idx , 'Markdown' , text ))
184
+ boiler_idx += 1
185
+
186
+ if (logs_path / 'CITATION.tex' ).exists ():
187
+ text = '<pre>%s</pre>\n ' % (logs_path / 'CITATION.tex' ).read_text ()
188
+ text += '<h3>Bibliography</h3>\n '
189
+ text += '<pre>%s</pre>' % Path (
190
+ pkgrf ('fmriprep' , 'data/boilerplate.bib' )).read_text ()
191
+ boilerplate .append ((boiler_idx , 'LaTeX' , text ))
192
+ boiler_idx += 1
178
193
179
194
searchpath = pkgrf ('fmriprep' , '/' )
180
195
env = jinja2 .Environment (
0 commit comments