Skip to content

Commit

Permalink
Merge pull request #214 from UCL/new-template-style
Browse files Browse the repository at this point in the history
  • Loading branch information
dpshelio authored Oct 4, 2022
2 parents 0a2add1 + 162d6ff commit ee705bc
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 65 deletions.
1 change: 0 additions & 1 deletion .github/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r ../../requirements.txt
git+https://github.com/jakevdp/JSAnimation.git
nbconvert==5.6.1
# https://github.com/jupyter/nbgrader/issues/1373#issuecomment-702798246
jupyter-client==6.1.12
# https://github.com/jupyter/jupyter_client/issues/637
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ default: _site
%.png: %.uml plantuml.jar Makefile
java -Djava.awt.headless=true -jar plantuml.jar -p < $< > $@

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

%.v2.ipynb: %.nbconvert.ipynb
jupyter nbconvert --to notebook --nbformat 2 --stdout $< > $@
Expand All @@ -45,15 +45,15 @@ default: _site
jupyter nbconvert --to notebook --allow-errors --ExecutePreprocessor.timeout=120 --execute --stdout $< > $@

notes.pdf: combined.ipynb $(PNGS) Makefile
jupyter nbconvert --to pdf --template latex.tplx $<
jupyter nbconvert --to pdf --template latex_template $<
mv combined.pdf notes.pdf

combined.ipynb: $(EXECUTED)
python nbmerge.py $^ $@
sed -i -e 's/\.svg/\.png/g' $@

notes.tex: combined.ipynb $(PNGS) Makefile
jupyter nbconvert --to latex --template latex.tplx $<
jupyter nbconvert --to latex --template latex_template $<
mv combined.tex notes.tex

notebooks.zip: ${NBV2}
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/01testingbasics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/02SaskatchewanFields.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -843,10 +843,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/03pytest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/04EnergyExample.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/05Mocks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/06Debugger.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/07CI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch03tests/08DiffusionExample.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70541,10 +70541,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch04packaging/010Installation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch04packaging/01Libraries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch04packaging/025TextFiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch04packaging/02Argparse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch04packaging/03Packaging.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1479,10 +1479,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
4 changes: 0 additions & 4 deletions ch98rubrics/PackagingTreasure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down
6 changes: 6 additions & 0 deletions jekyll_template/conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"base_template": "basic",
"mimetypes": {
"text/html": true
}
}
2 changes: 1 addition & 1 deletion jekyll.tpl → jekyll_template/index.html.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'basic.tpl' -%}
{%- extends 'basic/index.html.j2' -%}
{%- block header -%}
---
title: {% if 'jekyll' in nb['metadata'] %} {{nb['metadata']['jekyll']['display_name']}} {% endif %}
Expand Down
8 changes: 8 additions & 0 deletions latex_template/conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"base_template": "latex",
"mimetypes": {
"text/latex": true,
"text/tex": true,
"application/pdf": true
}
}
2 changes: 1 addition & 1 deletion latex.tplx → latex_template/index.tex.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

% Inherit from the specified cell style.
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
attrs>=17.4.0
jinja2<3.1
nbconvert<6.0.0
nbconvert>=6.0.0
ipython
jupyter
numpy
Expand Down

0 comments on commit ee705bc

Please sign in to comment.