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
|
||||
"""
|
||||
---
|
||||
title: Entry the first.
|
||||
date: 2020-08-29 11:11
|
||||
starred: False
|
||||
tags: tagone, ipsum, tagtwo
|
||||
...
|
||||
|
||||
Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
|
||||
quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque
|
||||
|
@ -458,10 +460,12 @@ 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
|
||||
"""
|
||||
---
|
||||
title: The third entry finally after weeks without writing.
|
||||
date: 2020-09-24 09:14
|
||||
starred: False
|
||||
tags: tagone, tagthree
|
||||
...
|
||||
|
||||
I'm so excited about emojis. 💯 🎶 💩
|
||||
|
||||
|
|
|
@ -113,14 +113,15 @@ class YAMLExporter(TextExporter):
|
|||
# source directory is entry.journal.config['journal']
|
||||
# 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,
|
||||
title=entry.title,
|
||||
starred=entry.starred,
|
||||
tags=", ".join([tag[1:] for tag in entry.tags]),
|
||||
dayone=dayone_attributes,
|
||||
body=newbody,
|
||||
space="",
|
||||
end="...",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue