Skip to content

Commit f0304d8

Browse files
committed
render from output file
1 parent 47a54f5 commit f0304d8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ travis: run_nb render
1010
echo "Done"
1111

1212
render:
13-
python render.py
13+
python render.py "ggplot vs Python Plotting.$(GIT_COMMIT).ipynb"
1414

1515
s3_upload:
1616
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type --no-mime-magic --no-preserve

render.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/local/bin/python
22
# encoding=utf8
33

4+
import sys
45
import json
56
from jinja2 import Environment, FileSystemLoader
67
from collections import defaultdict
@@ -80,8 +81,8 @@ def order_plots(plots):
8081
return meta
8182

8283

83-
def extract_cells():
84-
with open("./ggplot vs Python Plotting.ipynb", 'r') as f:
84+
def extract_cells(path):
85+
with open(path, 'r') as f:
8586
nb = json.load(f)
8687
cells = nb['cells']
8788
tags = {i: tags_from_cell(c) for i, c in enumerate(cells)}
@@ -111,7 +112,7 @@ def get_git_revision_short_hash():
111112

112113

113114
if __name__ == '__main__':
114-
plots = extract_cells()
115+
plots = extract_cells(sys.argv[1])
115116

116117
env = Environment(loader=FileSystemLoader('web'), extensions=['jinja2_highlight.HighlightExtension'])
117118
template = env.get_template('t_index.html')

0 commit comments

Comments
 (0)