mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-08 09:06:12 +02:00
Template exporting FTW
This commit is contained in:
parent
ce113af4e0
commit
4b3dc38e05
12 changed files with 164 additions and 90 deletions
|
@ -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
|
18
jrnl/templates/sample.template
Normal file
18
jrnl/templates/sample.template
Normal 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue