Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef94059ff6 | ||
|
|
1e85e7e768 | ||
|
|
a399ec9454 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
.ipynb_checkpoints/
|
.ipynb_checkpoints/
|
||||||
html/
|
html/
|
||||||
|
eulerbooks.tar.gz
|
||||||
|
|||||||
21
Makefile
21
Makefile
@@ -1,18 +1,27 @@
|
|||||||
.PHONY: all clean
|
.PHONY: all clean dist
|
||||||
|
|
||||||
HTMLS = $(patsubst notebooks/%.ipynb,html/%.html,$(wildcard notebooks/*.ipynb))
|
HTMLS = $(patsubst notebooks/%.ipynb,html/%.html,$(wildcard notebooks/*.ipynb))
|
||||||
|
|
||||||
badmathjax = "file:\/\/\/usr\/share\/javascript\/mathjax\/MathJax.js?config=TeX-AMS_CHTML-full,Safe"
|
|
||||||
goodmathjax = "https:\/\/cdn.jsdelivr.net\/npm\/mathjax@2\/MathJax.js?config=TeX-AMS_CHTML"
|
|
||||||
|
|
||||||
all: $(HTMLS)
|
all: $(HTMLS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -r html
|
rm -r html
|
||||||
|
|
||||||
html/%.html: notebooks/%.ipynb | html
|
html/%.html: notebooks/%.ipynb | html
|
||||||
jupyter nbconvert --to html $< --output $@ --execute --output-dir=.
|
podman run -it --rm -v .:/home/sage/eulerbooks --userns=keep-id sagemath/sagemath:latest jupyter nbconvert --to html eulerbooks/$< --output $@ --output-dir=eulerbooks/
|
||||||
sed -i 's/$(badmathjax)/$(goodmathjax)/' $@
|
|
||||||
|
|
||||||
html:
|
html:
|
||||||
mkdir -p html
|
mkdir -p html
|
||||||
|
|
||||||
|
dist: eulerbooks.tar.gz
|
||||||
|
|
||||||
|
eulerbooks.tar.gz: $(HTMLS) Makefile README.md LICENSE
|
||||||
|
rm -f $@
|
||||||
|
mkdir eulerbooks
|
||||||
|
cp -r html eulerbooks
|
||||||
|
mkdir eulerbooks/notebooks
|
||||||
|
cp notebooks/*.ipynb eulerbooks/notebooks
|
||||||
|
cp -r notebooks/txt eulerbooks/notebooks
|
||||||
|
cp LICENSE Makefile README.md eulerbooks
|
||||||
|
tar -czf $@ eulerbooks
|
||||||
|
rm -r eulerbooks
|
||||||
|
|||||||
Reference in New Issue
Block a user