Skip to content

Commit

Permalink
Update fixme to remove fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamrick committed Apr 12, 2014
1 parent 8808f23 commit bbe0d5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.PHONY: serve clean
.PHONY: serve clean pdf
SOURCES=images custom.css reveal.js

pycon-2014.slides.html: pycon-2014.ipynb
pycon-2014.slides.html: pycon-2014.ipynb reveal.tpl
ipython nbconvert --RevealHelpTransformer.url_prefix=reveal.js --to slides --template reveal.tpl pycon-2014.ipynb

pdf: pycon-2014.slides.html fixme.py
python fixme.py

clean:
Expand Down
5 changes: 5 additions & 0 deletions fixme.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#-----------------------------------------------------------------------------

import io
import re

notebook = 'pycon-2014.ipynb'
path = notebook[:-6] + '.slides.html'
Expand All @@ -19,6 +20,10 @@
for i, line in enumerate(data):
if line[:64] == flag:
data[i] = data[i].replace('color:#000 !important;', '')
data[i] = re.sub('data-fragment-index="[0-9]+"', "", data[i])
data[i] = re.sub('class="[0-9]+"', "", data[i])
data[i] = data[i].replace('class="fragment', 'class="')
data[i] = data[i].replace('class=""', '')

with io.open(path, 'w') as out_file:
out_file.writelines(data)
Expand Down

0 comments on commit bbe0d5d

Please sign in to comment.