(zettel (meta (backward "00001012920516 00001012931400 00001012931600") (box-number "1") (created "20230403153903") (forward "00001006020000 00001007030000 00001007040000 00001007050000 00001012920516 00001012930000 00001012931200 00001012931400 00001012931600 00001012931800") (modified "20240123120319") (published "20240123120319") (role "manual") (syntax "zmk") (tags "#api #manual #reference #zettelstore") (title "Encoding of Sz")) (rights 4) (encoding "") (content "Zettel in a [[Sz encoding|00001012920516]] are represented as a [[symbolic expression|00001012930000]].\nTo process these symbolic expressions, you need to know, how a specific part of a zettel is represented by a symbolic expression.\n\nBasically, each part of a zettel is represented as a list, often a nested list.\nThe first element of that list is always an unique symbol, which denotes that part.\nThe meaning / semantic of all other elements depend on that symbol.\n\n=== Zettel\nA full zettel is represented by a list of two elements.\nThe first elements represents the metadata, the second element represents the zettel content.\n\n:::syntax\n__Zettel__ **=** ''('' [[__Metadata__|#metadata]] [[__Content__|#content]] '')''.\n:::\n\n=== Metadata\n\nMetadata is represented by a list, where the first element is the symbol ''META''.\nFollowing elements represent each metadatum[^\"\"Metadatum\"\" is used as the singular form of metadata.] of a zettel in standard order.\n\nStandard order is: [[Title|00001006020000#title]], [[Role|00001006020000#role]], [[Tags|00001006020000#tags]], [[Syntax|00001006020000#syntax]], all other [[keys|00001006020000]] in alphabetic order.\n\n:::syntax\n__Metadata__ **=** ''(META'' [[__Metadatum__|00001012931200]] … '')''.\n:::\n=== Content\n\nZettel content is represented by a block.\n:::syntax\n__Content__ **=** [[__Block__|#block]].\n:::\n\n==== Block\nA block is represented by a list with the symbol ''BLOCK'' as the first element.\nAll following elements represent a nested [[block-structured element|00001007030000]].\n\n:::syntax\n[!block|__Block__] **=** ''(BLOCK'' [[__BlockElement__|00001012931400]] … '')''.\n:::\n\n==== Inline\nBoth block-structured elements and some metadata values may contain [[inline-structured elements|00001007040000]].\nSimilar, inline-structured elements are represented as follows:\n\n:::syntax\n__Inline__ **=** ''(INLINE'' [[__InlineElement__|00001012931600]] … '')''.\n:::\n\n==== Attribute\n[[Attributes|00001007050000]] may be specified for both block- and inline- structured elements.\nAttributes are represented by the following schema.\n\n:::syntax\n__Attribute__ **=** ''('' **[** [[__AttributeKeyValue__|00001012931800]] … **]** ')'.\n:::\n\nEither, there are no attributes.\nThese are specified by the empty list ''()''.\nOr there are attributes.\nIn this case, the first element of the list must be the symbol ''quote'': ''(quote'' ''('' A,,1,, A,,2,, … A,,n,, '')'''')''.\n\n=== Other\nA list with ''UNKNOWN'' as its first element signals an internal error during transforming a zettel into the Sz encoding.\nIt may be ignored, or it may produce an error.\n\n:::syntax\n__Unknown__ **=** ''(UNKNOWN'' Object … '')''.\n:::\n\nThe list may only contain the symbol ''UNKNOWN'', or additionally an unlimited amount of other objects.\n\nSimilar, any symbol with the pattern ''**xyz:NOT-FOUND**'', where ''xyz'' is any string, signals an internal error."))