YAML YAML, Go Away

I have a love-hate relationship with YAML as a metadata format. I love the ability to tag out fields and using dataview to grab them - and the ability to natively use cssclass, tags, and aliases fields.

But… man, I just can’t stand having all that mess at the top of the file. I don’t want to scroll through all the junk to get to the data. I really would love to store the metadata at the end - so much so, that is what I do for now and use a table format for the metadata to make it look beautiful. But I loose the access to the growing number of plugins that honor YAML processing.

Is anyone equally bothered by the YAML at the top requirement - and found a workaround (e.g. a plugin or CSS fragment that will always keep it hidden? a plugin that could preprocess the file to force the yaml to appear at the bottom?)

Or any hint that the YAML at the top requirement will be loosened? YAML front matter

Thank you, thank you

5 Likes

Just in case you didn’t already know - dataview now supports defining key:value pairs outside of the YAML block using ::

Name:: Buffy Summers
Occupation:: Vampire Slayer

2 Likes

Yes, thanks for pointing this out @Spidrax ! Hearing that dataview supports it globally now was the primary impetus for posting here. I’m debating whether to translate all of my existing metadata into “end matter” YAML blocks at the end of the file. Before making the jump I wanted to see if anyone has good workarounds for making YAML work without it clogging the front. I would love to be able to use cssclass: for instance.

Thanks again for responding - really appreciate the active forum volunteers.

One thing to consider is future-proofing your notes. I don’t much like YAML either but it’s commonplace, so using a non-standard schema (including dataview’s inline approach) might not be prudent.

Maybe a plugin that lets us auto-collapse the YMAL frontmatter in edit view so it’s not in the way - that’s something I would appreciate.

10 Likes

Totally agree with @Spidrax here. But I think instead of a plugin, perhaps this should be a feature request since hiding the YAML is already implemented in Obsidian, except it works only in preview. We need a hot key to enable/disable it on the fly in edit mode and it solves all issues.

2 Likes

After enabling the Fold indents in the editor setting tab, open the Command panel and search for Fold All. For me, this folds the YAML frontmatter (using minimal theme).

@Rishi I came to the same conclusion after sleeping on the idea - I’ll make a post in the feature request forum. Thanks!

I’m always loathed to add work to the developers load, but then… they are so fast at development that perhaps they are looking for some new ideas :slight_smile:

1 Like

I added it to the feature request forum.

Also, for other readers, I found an old feature request that discussed (and successfully implemented) removal of YAML in the viewer mode.

2 Likes