mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 04:58:32 +02:00
Fix YAML export syntax
This commit is contained in:
parent
c155bafa84
commit
78b3561127
2 changed files with 8 additions and 3 deletions
|
@ -410,10 +410,12 @@ Feature: Custom formats
|
||||||
"""
|
"""
|
||||||
And the content of file "2020-08-29_entry-the-first.md" in the cache should be
|
And the content of file "2020-08-29_entry-the-first.md" in the cache should be
|
||||||
"""
|
"""
|
||||||
|
---
|
||||||
title: Entry the first.
|
title: Entry the first.
|
||||||
date: 2020-08-29 11:11
|
date: 2020-08-29 11:11
|
||||||
starred: False
|
starred: False
|
||||||
tags: tagone, ipsum, tagtwo
|
tags: tagone, ipsum, tagtwo
|
||||||
|
...
|
||||||
|
|
||||||
Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
|
Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
|
||||||
quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque
|
quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque
|
||||||
|
@ -458,11 +460,13 @@ Feature: Custom formats
|
||||||
"""
|
"""
|
||||||
And the content of file "2020-09-24_the-third-entry-finally-after-weeks-without-writing.md" in the cache should be
|
And the content of file "2020-09-24_the-third-entry-finally-after-weeks-without-writing.md" in the cache should be
|
||||||
"""
|
"""
|
||||||
|
---
|
||||||
title: The third entry finally after weeks without writing.
|
title: The third entry finally after weeks without writing.
|
||||||
date: 2020-09-24 09:14
|
date: 2020-09-24 09:14
|
||||||
starred: False
|
starred: False
|
||||||
tags: tagone, tagthree
|
tags: tagone, tagthree
|
||||||
|
...
|
||||||
|
|
||||||
I'm so excited about emojis. 💯 🎶 💩
|
I'm so excited about emojis. 💯 🎶 💩
|
||||||
|
|
||||||
Donec semper pellentesque iaculis. Nullam cursus et justo sit amet venenatis.
|
Donec semper pellentesque iaculis. Nullam cursus et justo sit amet venenatis.
|
||||||
|
|
|
@ -113,14 +113,15 @@ class YAMLExporter(TextExporter):
|
||||||
# source directory is entry.journal.config['journal']
|
# source directory is entry.journal.config['journal']
|
||||||
# output directory is...?
|
# output directory is...?
|
||||||
|
|
||||||
return "title: {title}\ndate: {date}\nstarred: {starred}\ntags: {tags}\n{dayone} {body} {space}".format(
|
return "{start}\ntitle: {title}\ndate: {date}\nstarred: {starred}\ntags: {tags}\n{dayone}{end}\n{body}".format(
|
||||||
|
start="---",
|
||||||
date=date_str,
|
date=date_str,
|
||||||
title=entry.title,
|
title=entry.title,
|
||||||
starred=entry.starred,
|
starred=entry.starred,
|
||||||
tags=", ".join([tag[1:] for tag in entry.tags]),
|
tags=", ".join([tag[1:] for tag in entry.tags]),
|
||||||
dayone=dayone_attributes,
|
dayone=dayone_attributes,
|
||||||
body=newbody,
|
body=newbody,
|
||||||
space="",
|
end="...",
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Add table
Reference in a new issue