Skip to content

Commit

Permalink
Cleaned up for new stylings
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespjh committed Jul 24, 2015
1 parent be9edd7 commit 0e64c1d
Show file tree
Hide file tree
Showing 155 changed files with 21,115 additions and 20,283 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,24 @@ html/reveal/assets/callgrind.png
html/reveal/assets/coverage.png
html/reveal/assets/jenkins.png
tdd.png
.ipynb_checkpoints
session01/analyzer.py
session01/eight
session01/eight.py
session01/module1/
session01/pretty.py
combined.ipynb
combined_files/
notebooks.zip
notes.pdf
notes.tex
session04/greeter.py
session04/map.png
session04/midvals.yaml
session05/anotherfile.py
session05/config.yaml
session05/context.py
session06/fixed.png
session07/datasource2.yaml
session07/datasource3.yaml
session07/example.yaml
72 changes: 62 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ PANDOCARGS=-t revealjs -s -V theme=night --css=http://lab.hakim.se/reveal-js/css
--css=$(ROOT)/css/ucl_reveal.css --css=$(ROOT)/site-styles/reveal.css \
--default-image-extension=png --highlight-style=zenburn --mathjax -V revealjs-url=http://lab.hakim.se/reveal-js

NOTEBOOKS=$(filter-out %.v2.ipynb %.nbconvert.ipynb,$(wildcard session*/*.ipynb))

HTMLS=$(NOTEBOOKS:.ipynb=.html)

EXECUTED=$(NOTEBOOKS:.ipynb=.nbconvert.ipynb)

NBV2=$(NOTEBOOKS:.ipynb=.v2.ipynb)

default: _site

%/slides.html: %/*.md Makefile
Expand All @@ -21,18 +29,37 @@ default: _site
dot $< -T png -o $@

%.png: %.uml Makefile
plantuml -p < $< > $@
java -Djava.awt.headless=true -jar plantuml.jar -p < $< > $@

%.html: %.nbconvert.ipynb Makefile jekyll.tpl
ipython nbconvert --to html --template jekyll.tpl --stdout $< > $@

%.v2.ipynb: %.nbconvert.ipynb
ipython nbconvert --to notebook --nbformat 2 --stdout $< > $@

%.nbconvert.ipynb: %.ipynb
ipython nbconvert --to notebook --ExecutePreprocessor.timeout=120 --execute --stdout $< > $@

%.html: %.ipynb Makefile jekyll.tpl
ipython nbconvert --to html --template jekyll.tpl --execute --stdout $< > $@
notes.pdf: combined.ipynb Makefile
ipython nbconvert --to pdf --template latex.tplx $<
mv combined.pdf notes.pdf

%.html: %.ipyhtml Makefile
yamlheader
combined.ipynb: $(EXECUTED)
python nbmerge.py $^ $@

notes.tex: combined.ipynb Makefile
ipython nbconvert --to latex --template latex.tplx $<
mv combined.tex notes.tex

notebooks.zip: ${NBV2}
zip -r notebooks $^

master.zip: Makefile
rm -f master.zip
wget https://github.com/UCL-RITS/indigo-jekyll/archive/master.zip

ready: indigo $(HTMLS) notes.pdf notebooks.zip

indigo-jekyll-master: Makefile master.zip
rm -rf indigo-jekyll-master
unzip master.zip
Expand All @@ -47,16 +74,41 @@ indigo: indigo-jekyll-master Makefile
cp -r indigo-jekyll-master/indigo/favicon* .
touch indigo

_site: indigo \
session01/01data.html session01/03control.html session01/04functions.html \
session01/05modules.html session01/00pythons.html session01/02types.html \
session01/06exercise.html
plantuml.jar:
wget http://sourceforge.net/projects/plantuml/files/plantuml.jar/download -O plantuml.jar

.PHONY: ready

_site: ready
jekyll build

preview: ready
jekyll serve

clean:
rm -f session*/generated/*.png
rm -rf session*/*.html
rm -f session*/*.pyc
rm -f index.html
rm -rf _site
rm -rf images js css _includes _layouts favicon* master.zip indigo-jekyll-master

rm -f indigo
rm -f session01/analyzer.py
rm -f session01/eight
rm -f session01/eight.py
rm -rf session01/module1/
rm -f session01/pretty.py
rm -f session*/*.nbconvert.ipynb
rm -rf session*/*.v2.ipynb
rm -rf combined*
rm -f notes.pdf
rm -f notes.tex
rm -f session04/greeter.py
rm -f session04/map.png
rm -f session05/anotherfile.py
rm -f session05/config.yaml
rm -f session05/context.py
rm -f session06/fixed.png
rm -f session07/datasource*.yaml
rm -f session07/example.yaml
rm -f notebooks.zip
72 changes: 0 additions & 72 deletions all.md

This file was deleted.

138 changes: 0 additions & 138 deletions dexy.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions dexyplugin.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion jekyll.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{%- extends 'basic.tpl' -%}
{%- block header -%}
---
title: {{resources['metadata']['name']}}
title: {% if 'jekyll' in nb['metadata'] %} {{nb['metadata']['jekyll']['display_name']}} {% endif %}
nblink: True
---
{{super()}}
{%- endblock header -%}
Expand Down
33 changes: 33 additions & 0 deletions latex.tplx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

% Default to the notebook output style
((* if not cell_style is defined *))
((* set cell_style = 'style_ipython.tplx' *))
((* endif *))

% Inherit from the specified cell style.
((* extends cell_style *))

((* block title *))
\title{An introduction to Python Programming for Research}
((* endblock title *))

((* block author *))
\author{James Hetherington}
((* endblock author *))

%===============================================================================
% Latex Book
%===============================================================================

((* block predoc *))
((( super() )))
((* block tableofcontents *))\tableofcontents((* endblock tableofcontents *))
((* endblock predoc *))

((* block docclass *))
\documentclass{report}
((* endblock docclass *))

((* block markdowncell scoped *))
((( cell.source | citation2latex | strip_files_prefix | markdown2latex(extra_args=["--chapters"]) )))
((* endblock markdowncell *))
Loading

0 comments on commit 0e64c1d

Please sign in to comment.