ZettelGeist / zettelgeist

A less-is-more (distributed) notetaking application. Designed specifically for those who prefer working with the command line and want to do crazy indexing, analysis, and transformation of notes. Aimed at but not limited to scholarly research projects.
Apache License 2.0
30 stars 5 forks source link

newline after the yaml metadata block #25

Closed icornelius closed 2 years ago

icornelius commented 3 years ago

A single blank newline should follow the --- that closes the yaml metadata block. The newline is necessary for recognition of ATX-style headers in pandoc's markdown (as stated here). It's easy enough to key the newline manually if keying document, but an extra step when using the --load-document option.

gkthiruvathukal commented 3 years ago

@icornelius Just to clarify, this issue is only relevant when working with the zettel command. Right?

My inclination is to fix it by only outputting a newline if and only if:

It is clear that the pandoc Markdown had good reasons for this, although I am scratching my head as to why they could not have assumed a newline before processing the document section, since it does NOT affect processing headings or body text in practice. (That is, blank lines are for inter-paragraph spacing.)

Nevertheless, I am happy to support it. I wonder whether we should have a command line option frontmatter-spacing which defaults to \n (newline) and can be overridden if someone does not want a newline between the metadata and the document.

Upon hearing your thoughts, I'll proceed with the appropriate (trivial) fix.

icornelius commented 3 years ago

I stand corrected. Pandoc evidently does assume a newline after a YAML metadata block. I should have tested that before. This issue can be closed.

gkthiruvathukal commented 3 years ago

Ok, @icornelius. I'm going to hold off on closing it until we're 100% sure. I still think there could be value to having an option to add some text between the YAML and Markdown body (even if only for cosmetic reasons).

gkthiruvathukal commented 2 years ago

@icornelius I'm going to go ahead and close this one for now. But feel free to reopen if it needs further investigation.