Metadata standard

I’ve seen a little discussion, but please excuse me if I missed something…

Is there an accepted “standard” for Note metadata?

Are we putting a YAML block at the top?

Just using tags (that doesn’t really cover it) - I would like the ability to deal with custom metadata.

Obviously I can (and will) include it in my note manually, but didn’t know if there were thoughts in this direction.

Thanks!

9 Likes

YAML is pretty common.

2 Likes

No Obsidian standard yet, but I suspect it will be YAML

2 Likes

As others said, there’s no “standard”, but YAML is the most popular and the most likely, yes.

6 Likes

A few YAML-related issues:

  • There are potential conflicts between the YAML spec and Obsidian. # is a reserved character for comments, and [] are reserved characters for flow styles. What does that mean for including tags and links?
  • There is a bug in edit mode where in YAML front-matter bounded by ---, tags and links are not clickable - https://forum.obsidian.md/t/cannot-follow-links-or-tags-in-front-matter-in-edit-view/1144. This may be related to the issue above.
  • In preview mode, YAML front matter bounded by --- without blank lines are rendered as <h2>.

So at least out-of-the-box, there are problems with CodeMirror and YAML front-matter in Obsidian. I understand this was not intentional.

Not sure where to go from here on this issue, but I am hoping for some metadata guidance soon, even if there are no related features for awhile.

4 Likes

I use YAML because it exists and is commonly used. Would be equally happy with alternative.

2 Likes

A couple of points.

  1. --- above and below text/data is not recognised in Obsidian as Yaml; in e.g. Typora it is, I believe it’s normal markdown, if I am not mistaken.

  2. I have noticed that a Yaml code block can be created with, on an empty line, 3 backticks and the word yaml, then, on the next line(s) text/data, then, on the last line, 3 more backticks.

  3. I have have metadata for each note, and have put it as regular text in the note, but cordoned off with a line from the main body of text. Is there a compelling reason to put it in a Yaml block?

1 Like

By definition YAML isn’t markdown, but many programs accept it for the utility of the Front Matter conventions. The — fences are a simple visual cue - most people prefer it to counting backticks.

For some uses I prefer to have Metadata parsed as part of the main text, but usually I want it excluded and not rendered. And it’s nice when it works the same in other programs and the YAML solution is the only way that does that.

There’s huge inconsistency in implementations of comments in markdown. Some work in Obsidian, others don’t, but none are a commonly accepted way of indicating a Metadata block.

And some people prefer to have their YAML block at the end rather than the beginning, but still refer to it as Front Matter.

Personally, I’d most like the developers to decide soon. I’d rather implement a method than not, but it’s off-putting to be aware it might have to be changed.

2 Likes

Thanks for that.

By definition YAML isn’t markdown, but many programs accept it for the utility of the Front Matter conventions.

OK, sorry for that mistake.

Personally, I’d most like the developers to decide soon . I’d rather implement a method than not, but it’s off-putting to be aware it might have to be changed.

True. The thing is the devs are working full speed at many things that need to be “decided soon”, so I guess we’ll just have to wait till they decide it’s time to decide.

2 Likes

MultiMarkdown officially supports YAML frontmatter for metadata. This is also used by several online blogs that take raw markdown submissions for articles. It’s also used by several static site generators - like Hugo and Jekyl. It seems to be the de facto standard if we want to extend markdown documents with metadata.

10 Likes

YAML front matter is very important, used already by all major markdown editors, and is standard in MultiMarkDown. if it gets properly managed by Obsidian, we could in the future write plugins to read/write/manage the metadata and it’ll be awesome!

5 Likes

we have YAML now.

3 Likes

Thanks for keeping us up to date, @WhiteNoise ! :slight_smile:

I am kinda confused with how Obsidian handles YAML front-matter though. If I understand correctly, the YAML front-matter is reserved for plugins to read and write metadata after the public API is released. If so, what are the best practices if I want to use YAML to add custom, user-generated metadata? Should I add a second YAML block after the one reserved for plugins?

The concept of YAML is very new to me so thanks in advance for your patience and help!

1 Like

Noted, thanks!