Skip to content

Commit

Permalink
markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
luto committed Nov 19, 2014
1 parent 04a5ea9 commit b714aeb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ todo:
* audacity
* block
* list: tags missing
* markdown
23 changes: 23 additions & 0 deletions tpls/md.tpl
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit b714aeb

Please sign in to comment.