Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ def convert_file(dst_path, fn, editors, created, modified):

root = tree.getroot()
head = root.find('head')
container, = root.xpath("//div[@id='notebook-container']")
try:
container, = root.xpath("//div[@id='notebook-container']")
except ValueError:
container, = root.xpath("//body[@class='jp-Notebook']")

headers = container.xpath('//h1')
if headers:
Expand Down Expand Up @@ -344,18 +347,18 @@ def parse_wiki_legacy_tags():
prev_line = None

for line in f:
if re.match('^====+\s*$', line):
if re.match(r'^====+\s*$', line):
tags[0] = prev_line.strip()
tags[1] = None
tags[2] = None
continue

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

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

Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
def setup(app):
app.add_stylesheet('scipy-cookbook.css')
try:
app.add_stylesheet('scipy-cookbook.css')
except AttributeError:
app.add_css_file('scipy-cookbook.css')
else:
html_context = {
'css_files': [
Expand Down