Setting document titles, YAML Frontmatter, and git hooks
Hi folks!
Firstly, thanks for creating Zettlr; I'm new to both Zettlr and Zettelkasten, and not sure if it'll be for me long-term, but am excited to give it a shot!
Looking at screenshots on https://docs.zettlr.com/en/guides/guide-zettelkasten/ and https://zettlr.com/#, I can see that on the Sidebar the documents are shown with headings, rather than their IDs (with the modified date, ID, and number of tags on the line below).
What is valid syntax for defining a document title such that it appears in the sidebar? Is there any documentation you can point me to about this, or the layout of the sidebar in general? I couldn't find anything as comprehensive as I'd hoped.
Apparently using YAML Frontmatter works, but I wonder if there are alternatives? For example I tried to use a Markdown heading, but that didn't show up in the sidebar.
Related: Is there any documentation abour what YAML Frontmatter is supported by Zettlr?
Is there (or will there be) an ability to have Zettlr automatically commit to git when a file is saved? I've created a git repo in my Zettlr directory, but ideally I'd like to not forget to commit changes, so an auto-commit would be handy.
Comments
Bonjour!
title
is given, that. Nothing else will work, which is partially a conscious decision.title
andkeywords
-properties. If it's not in the docs, feel free to contribute and add the documentation on that!Thanks for your response @hendrik! That clears things up nicely.
I'll see what I can do about documenting (2). I'm actually not really familiar with YAML frontmatter, and only worked out how to do this via the screenshot on the Zettlr homepage, and doing a web search for 'yaml frontmatter' only yields a bunch of other projects that support it, as opposed to any canonical, standardised, or authoritative documentation; it seems to be entirely built on convention!
Nonetheless, I'll try to do some digging and possibly make some updates!
In Pandoc it's called "YAML metadata block", in this section: https://pandoc.org/MANUAL.html#metadata-blocks
The first kind of metadata blocks is not supported, but just scroll down a little bit to see everything you need to know about YAML frontmatters (or, as I said, metadata blocks)!
The internet kind of settled with "YAML frontmatter", so no wonder the Pandoc documentation doesn't yield something
Hah, yeah, that'd be right! Consistency? What's that?
I'm following as I can't get my head around how YAML works with Zettlr, so please let us all know if you get anywhere with documenting this
Basically Zettlr doesn't touch YAML frontmatters, so they work exactly as described in the Pandoc documentation, and there's nothing more to it. Only two things: 1)
keywords
will be parsed by Zettlr and added to the list of tags, 2)title
will be used instead of the filename in various displays, if there is oneThanks @hendrik - that's pretty much what I thought, but I have not been able to implement using the title from a YAML header, it doesn't seem to be included in the search, and isn't appended to internal links.
Are you sure? I've had no problems linking w/ the frontmatter title in the form of
[[12345]] The title from the frontmatter
. Which version are you using?Currently, I'm on 1.7.0-beta.11 but I couldn't get it to work before trying the beta. I haven't logged this anywhere as I'm 100% not confident that I'm not doing something blindingly stupid.
Maybe have a look at the most recent version of the changelog, I'm confident this behaviour was implemented later, and as 1.6 is already almost four months old, this would explain that
Yes, totally that! Working entirely as expected in 1.7.0-beta.13.
Tadaaa ?