Syntax of Metadata

00001006010000 · Info · (manual) · #manual #syntax #zettelstore (all)

The metadata of a zettel is a collection of key-value pairs. The syntax roughly resembles the internal header of an email (RFC5322).

The key is a sequence of alphanumeric characters, a hyphen-minus character (“-”, U+002D) is also allowed. It begins at the first position of a new line. Uppercase letters of a key are translated to their lowercase equivalence.

A key is separated from its value either by

A value is a sequence of printable characters. If the value should be continued in the following line, that following line (“continuation line”) must begin with a non-empty sequence of space characters. The rest of the following line will be interpreted as the next part of the value. There can be more than one continuation line for a value.

A non-continuation line that contains a possibly empty sequence of characters, followed by the percent sign character (“%”) is treated as a comment line. It will be ignored.

Parsing metadata ends, if an empty line is found or if a line with at least three hyphen-minus characters is found.

Some examples:

title1:The Title
 title-2 : Another title
title-3: A wrapped
title-4: A
% A comment line
 % Another comment line.

No metadata anymore, because of the empty line.