Template exporting FTW

This commit is contained in:
Manuel Ebert 2016-08-19 23:20:31 +00:00
parent ce113af4e0
commit 4b3dc38e05
12 changed files with 164 additions and 90 deletions

View file

@ -1,33 +0,0 @@
---
extension: json
---
{% block journal %}
{
"tags": {
{% for tag in tags %}
"{{ tag.name }}": {{ tag.count }}{% if not __last_iteration %},{% endif %}
{% endfor %}
},
"entries": [
{% for entry in entries %}
{% include entry %}{% if not __last_iteration %},{% endif %}
{% endfor %}
]
}
{% endblock %}
{% block entry %}
{
"title": "{{ entry.title }}",
"body": "{{ entry.body.replace("\n", "\\n") }}",
"date": "{{ entry.date.strftime('%Y-%m-%d') }}",
"time": "{{ entry.date.strftime('%H:%M') }}",
{% if entry.uuid %}
"uuid": "{{ entry.uuid }}",
{% endif %}
"starred": {{ "true" if entry.starred else "false" }}
}
{% endblock %}
Hey There

View file

@ -0,0 +1,18 @@
---
extension: txt
---
{% block journal %}
{% for entry in entries %}
{% include entry %}
{% endfor %}
{% endblock %}
{% block entry %}
{{ entry.title }}
{{ "-" * len(entry.title) }}
{{ entry.body }}
{% endblock %}