on the use of YAML and its (possible) relation to wikilinks (with Zettlr)
Hello,
This is my third iteration at creating a digital zettelkasten (I abandoned either because my system was too complicated or by lack of time).
I am working with Zettlr on PC. I want a clear, simple, and efficient set up. I am not an expert at programming, but I am curious and learning
I have a question with regard to YAML frontmatter:
what is the advantage of having one in my notes?
For the moment, I use for my filenames a few keywords and the UID at the end.
In the note, I have a title (I use the level 1 header) with the same keywords (from the filename) but often elaborated as a short sentence.
What is the advantage of repeating the title in my YAML frontmatter?
Sorry, if this is not very clear, I try to understand the importance of a YAML frontmatter and what use it could have in the future, or for the immediat management of my zettelkasten.
Many thanks for your thoughts and clarifications,
Cheers!
Howdy, Stranger!
Comments
I don't use YAML, either.
Benefits of YAML include very wide-spread tooling to read YAML. So people use YAML because many people before used YAML and the metadata blocks can be stripped from the content easily.
Downsides of YAML frontmatter include that you need to suffer through technical frontmatter before you can get to the actual content
With consistent file naming schemes (like e.g. Denote's) you can pack a lot of info into filenames, too. They can become prohibitively long, though, so you benefit if your note-taking tool of choice can display e.g. the first heading from the content instead of the filename in your notes list.
Author at Zettelkasten.de • https://christiantietze.de/
I don't use Zettlr so I'm not sure if there's anything that make YAML specifically useful in that environment, but in general I don't think using YAML is for note-taking. In software, YAML is mostly used to store configuration metadata, e.g., numbers, booleans, short texts, etc. It's not an optimal format for storing relatively long text.
It seems to me that for note-taking you at least need to ensure the data format is writing-oriented (i.e., to store text documents, with ability to keep auxiliary metadata) and hyperlinking mechanism. Markdown took off because it's perhaps the most minimalistic implementation for that purpose.
@zettelsan said:
@zettelsan: The original post is talking about YAML frontmatter, which is widely used to store metadata at the start of Markdown files. The body of a Markdown file (with a note's content) comes after the YAML frontmatter. Some standard YAML variables are translated directly to metadata tags in the head section of an HTML document when a static site generator generates a website from Markdown files. The GitHub Docs page about it (see first list item below) says that the use of YAML frontmatter was popularized by the static site generator Jekyll. Further information:
I'm a big fan of metadata, but I agree with @ctietze that it is best kept hidden until you need it in note-taking software.
@oryal: The usual reason for including a title variable in YAML frontmatter is because the formal meaning of that element is different from the meaning of an H1 element. When translating Markdown to HTML with standard tools, the title variable becomes the HTML file's title tag, and the H1 element becomes an H1 element in HTML.
I'm in the YAML lover's camp. YAML is essential for writing once and outputting in multiple formats using Marked2 or Pandoc. Static site generators require YAML if you want to publish notes to the web. Most of my notes have a simple YAML header generated by templating actions. Because it is everywhere, it has become nondistracting. I don't usually include the title in the YAML. Here are two examples.
I use this one for export from The Archive to http://willsimpson.netlify.app/
Will Simpson
My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Thanks for the clarification. I just misread the intent of the OP, it seems. Sorry for adding noise.
It's a bit unfortunate that Markdown keeps solving its limitation by extending to partially implement features from other formats. Like allowing YAML frontmatter and HTML within the body. It reminds me of the mess that we had to deal with in the early days of HTML/CSS/JavaScript.
@zettelsan said:
Why unfortunate? (I would ask, "What's the alternative?", but there are alternative metadata formats for Markdown.) Remember that editing Markdown is like editing source code, not like viewing a rendered document, so everything that's in the head section of an HTML document that you don't see when viewing an HTML file in a web browser is right there in your face when viewing a Markdown file unless your software hides it from you.
In Pandoc, you can turn off support for various Markdown features, including YAML frontmatter and HTML in the body, and there is a way to explicitly indicate blocks of non-Markdown content.
It's not a big deal, but the reason why Markdown has become so popular is its minimalism and simplicity. Not being able to embed even the most basic metadata is an obvious shortcoming, and its understandable that people look for ways to add the feature.
But then people start arguing about why YAML and not Unix-like config or Windows-style INI. If a simple key-value section is all that is needed, Markdown probably should have a standardized way to do it, and not rely on (potentially proprietary) extensions. Not doing so reminds me of the state of web standards in the browser war era. Coding for web front-end wasn't very fun then, and that was unfortunate.
In any case, I just added a noise to the thread by misreading the OP, so I'm not inclined to argue further on this minutia.
@zettelsan, yeah, Markdown across implementations is unfortunate in being so unstandardized. But I've been pretty happy using Pandoc Markdown, which was engineered by a bunch of people who are smarter than me!
@oryal, I worked in my zettelkasten for a couple of years before I began implementing YAML front matter. Adding YAML front matter to old notes using a few Python scripts was easy. I suggest avoiding overthinking YAML and instead focusing on capturing ideas. You may never need YAML. It is suitable for certain publishing goals and is helpful in some programming situations.
Will Simpson
My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Thanks a lot to all of you for your comments!
I started thinking about the benefits of YAML after reading some posts from @Will .
I do have a question then - but this might belong to a new post -: is the use of YAML be useful, or problematic, if I decide to change from Zettlr to The Archive?
My computer won't last long and I might have to change for a Mac.
I really wish my system to be simple, efficient and timeproof as possible.
For the time being, my notes are saved as: short-title-UID.md
My notes start with a level 1 header and below this header the note's UID.
From what I read, the use of YAML frontmatter gives me the possibility to have a title that can be changed if needed without altering the filename nor the note's links. My YAML frontmatter would be:
I think what interest me is the possibility to change a title without breaking the note's link. Hence my curiosity for YAML frontmatter.
Thanks again
Edit @ctietze: Fixed formatting
I am sorry! I am not yelling in bold
! I wrote my YAML frontmatter example and it did..this! All my apologies!
Fixed it for you
Author at Zettelkasten.de • https://christiantietze.de/