Skip to content

Commit 3247ecb

Browse files
authored
Update build script and docs config to handle newer versions (#58)
Newer versions of Python, Jupyter-nbconvert and Sphinx can now work with the build system.
1 parent a4757b0 commit 3247ecb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

build.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ def convert_file(dst_path, fn, editors, created, modified):
247247

248248
root = tree.getroot()
249249
head = root.find('head')
250-
container, = root.xpath("//div[@id='notebook-container']")
250+
try:
251+
container, = root.xpath("//div[@id='notebook-container']")
252+
except ValueError:
253+
container, = root.xpath("//body[@class='jp-Notebook']")
251254

252255
headers = container.xpath('//h1')
253256
if headers:
@@ -344,18 +347,18 @@ def parse_wiki_legacy_tags():
344347
prev_line = None
345348

346349
for line in f:
347-
if re.match('^====+\s*$', line):
350+
if re.match(r'^====+\s*$', line):
348351
tags[0] = prev_line.strip()
349352
tags[1] = None
350353
tags[2] = None
351354
continue
352355

353-
if re.match('^----+\s*$', line):
356+
if re.match(r'^----+\s*$', line):
354357
tags[1] = prev_line.strip()
355358
tags[2] = None
356359
continue
357360

358-
if re.match('^""""+\s*$', line):
361+
if re.match(r'^""""+\s*$', line):
359362
tags[2] = prev_line.strip()
360363
continue
361364

docs/conf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@
108108
html_theme = 'sphinx_rtd_theme'
109109
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
110110
def setup(app):
111-
app.add_stylesheet('scipy-cookbook.css')
111+
try:
112+
app.add_stylesheet('scipy-cookbook.css')
113+
except AttributeError:
114+
app.add_css_file('scipy-cookbook.css')
112115
else:
113116
html_context = {
114117
'css_files': [

0 commit comments

Comments
 (0)