Skip to content

Commit 63b6e80

Browse files
committed
add:ipynb_template.tpl
1 parent ceaba93 commit 63b6e80

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

articles/ipynb_template.tpl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% extends 'markdown/index.md.j2' %}
2+
3+
{% block markdowncell %}
4+
{% for line in cell.source.splitlines() %}
5+
{% if line.startswith('# ') %}
6+
##{{ line[1:] }}
7+
{% elif line.startswith('## ') %}
8+
###{{ line[2:] }}
9+
{% elif line.startswith('### ') %}
10+
####{{ line[3:] }}
11+
{% elif line.startswith('#### ') %}
12+
#####{{ line[4:] }}
13+
{% elif line.startswith('##### ') %}
14+
######{{ line[5:] }}
15+
{% elif line.startswith('###### ') %}
16+
{{ line[6:] }}
17+
{% else %}
18+
{{ line }}
19+
{% endif %}
20+
{% endfor %}
21+
{% endblock markdowncell %}
22+
23+
{% block output %}
24+
{% endblock output %}

convert.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ getNotebooksInDir() {
2323

2424
notebook2Markdown() {
2525
local file=$1
26-
jupyter-nbconvert --to markdown --template "$IPYNB_TEMPLATE" "$file" &>/dev/null
26+
jupyter-nbconvert --to markdown --template "$IPYNB_TEMPLATE" "$file"
2727
}
2828

2929
main() {

0 commit comments

Comments
 (0)