-
-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add delimiters in YAML format #1150
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking this one on!
I think there was a little confusion with the description in the ticket, so I left some clarifying comments inline.
@@ -410,10 +410,12 @@ Feature: Custom formats | |||
""" | |||
And the content of file "2020-08-29_entry-the-first.md" in the cache should be | |||
""" | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the example in #1065 meant the dashes here as a placeholder for content earlier in the file (not actual dashes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, hey, these dashes actually part of the yaml spec. My mistake!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the example was supposed to be actual dashes and dots based on Pandoc documentation that was linked in the ticket. https://pandoc.org/MANUAL.html#metadata-blocks
"A YAML metadata block is a valid YAML object, delimited by a line of three hyphens (---) at the top and a line of three hyphens (---) or three dots (...) at the bottom."
Didn't refresh and just saw your second comment. My bad
title: Entry the first. | ||
date: 2020-08-29 11:11 | ||
starred: False | ||
tags: tagone, ipsum, tagtwo | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the example in #1065 meant the dots here as a placeholder for content later in the file (not actual dots).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, hey, these dots actually part of the yaml spec. My mistake!
@@ -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 | |||
""" | |||
--- | |||
title: The third entry finally after weeks without writing. | |||
date: 2020-09-24 09:14 | |||
starred: False | |||
tags: tagone, tagthree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the body: |
part of the description in #1065. This is the main part of the yaml exporter than needs fixing. The body
key needs to be output (followed by : |
), then the body of the entry should follow on the next line, and be indented evenly, and indented farther than the body
key.
I've added in the body section for the YAML export and updated the feature tests accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
* Fix YAML export syntax * Fix YAML body block indentation (cherry picked from commit 5c0a2d4)
This is an intended fix for issue #1065. The yaml export now functions as shown in the "Expected Behavior" described in that bug report.
Example Output:
Checklist
for the same issue.