notes icon indicating copy to clipboard operation
notes copied to clipboard

Correct formatting of Front Matter

Open onemenzel opened this issue 6 years ago • 3 comments

Is your feature request related to a problem? Please describe. Many projects which use markdown to store their content implement "Front Matter" as a way to attach metadata to markdown files. Front Matter stores information either in YAML, JSON or sometimes TOML. The location of Front Matter is – as the name implies – at the beginning of the file and denoted by either a leading and trailing --- (YAML), ;;; (JSON) or +++ (TOML).

I use Front matter in my notes to annotate some meta data in a structured way.

Notes does not support the usage of this syntax.

Describe the solution you'd like While I do not expect Notes to parse and use information from Front Matter (though there may be cases where this could be useful), I'd at least like Notes to render the Front Matter as if its contents were in a code fence.

Describe alternatives you've considered Front matter could also be rendered as if it was normal text, where none of the markdown syntax applies. Right now, it doesn't do this.

Another alternative would be to implement Front Matter in a more sophisticated way and to actually use the metadata. The data could as an example be used for templating the notes filenames. But I consider my proposed solution to be kind of a minimal and quick approach to this problem.

Additional context How it renders right now: grafik How I'd like it to render (but of course with the Front Matter denotion instead): grafik


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

onemenzel avatar Oct 23 '19 21:10 onemenzel

I just realised that this is partly a duplicate of #164

onemenzel avatar Oct 23 '19 21:10 onemenzel

+1 for proper front matter rendering.

timkgh avatar Mar 21 '22 15:03 timkgh

I'd like to add to the proposed solution:

  • In preview mode, the front matter should not be rendered at all because it does not contain document content but metadata.

Now lots of popular markdown editors resort to front matters (and other extensions of the standard), also due to lack of a proper markup for comments / non-content metadata.

Since this issue and all linked ones are not at all new, is there any active consideration? Since Notes uses markdown-it, extending feature support through plugins (like markdown-it-front-matter) seems a minor effort, rather a question of decision taking and testing.

Aerilius avatar Nov 25 '22 10:11 Aerilius