Data Encoding

The data encoding represents the zettel as a special symbolic expression. In contrast to the similar-looking sz encoding, a much simpler structure is used.

If transferred via HTTP, the content type will be text/plain; charset=utf-8.

A full zettel, both metadata and content, is encoded by the list

(zettel Metadata Access rights Content encoding Content ).

If you only want to encode the metadata of a zettel, the following format will be used:

(list Metadata Access rights ).

Metadata

Metadata is basically a sequence of key / value pairs:

Metadata = (meta ( Key Value )).

Key = Symbol.

Value = String.

Each Key is a symbol, derivied from the metadata key. The Value is a string containing the value of the corresponding metadata entry.

Access rights

This element encodes access rights of a zettel:

Access rights = (rights Number ).

Content encoding

The content encoding specifies, how the zettel content is encoded. Currently, two values are supported: the empty string and the string "base64".

Content encoding = (encoding "") | (encoding "base64").

The empty string indicates that the content is not encoded and can be used as is. "base64" indicates that the content string is Base64-encoded (typically used for binary content).

Content

The content of a zettel is always encoded as a readable string. For binary content, it is first encoded using Base64.

Content = (content String ).