diff --git a/README.md b/README.md index 256ac1c..0208705 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,3 @@ todo: * audacity * block * list: tags missing - * markdown diff --git a/tpls/md.tpl b/tpls/md.tpl new file mode 100644 index 0000000..83da4c5 --- /dev/null +++ b/tpls/md.tpl @@ -0,0 +1,23 @@ +{% macro shownote(note) -%} + +{%- if 'chapter' in note.tags %} +## {{note.title | safe}} {% if note.timestamp %}```{{note.timestamp | htime}}```{% endif %} +{%- else -%} + {{ "* "|indent((note.level + 1) * 2, true)|replace("\n", "")|replace(" ", "", 1) }} + {%- if note.url -%} + [{{note.title | safe}}]({{note.url}}) + {%- else -%} + {{note.title | safe}} + {%- endif -%} +{%- endif %} +{% for subnote in note.shownotes -%} + {{ shownote(subnote) }} +{%- endfor -%} + +{%- endmacro %} + + +{%- for note in shownotes -%} + {{ shownote(note) }} +{%- endfor %} +