(((meta (@ (content . "SHTML Encoding") (name . "title"))) (meta (@ (content . "manual") (name . "role"))) (meta (@ (content . "#api #manual #reference #zettelstore") (name . "tags"))) (meta (@ (content . "zmk") (name . "syntax"))) (meta (@ (content . "00001004051200 00001012920500") (name . "back"))) (meta (@ (content . "00001004051200 00001012920500") (name . "backward"))) (meta (@ (content . "1") (name . "box-number"))) (meta (@ (content . "(c) 2020-present by Detlef Stern ") (name . "copyright"))) (meta (@ (content . "20230316181044") (name . "created"))) (meta (@ (content . "00001012920510 00001012920516 00001012930000") (name . "forward"))) (meta (@ (content . "en") (name . "lang"))) (meta (@ (content . "EUPL-1.2-or-later") (name . "license"))) (meta (@ (content . "20230403150657") (name . "modified"))) (meta (@ (content . "20230403150657") (name . "published"))) (meta (@ (content . "public") (name . "visibility")))) (p "A zettel representation that is a " (a (@ (href . "00001012930000")) "s-expression") ", syntactically similar to the " (a (@ (href . "00001012920516")) "Sz encoding") ", but denotes " (a (@ (href . "00001012920510")) "HTML") " semantics." " " "It is derived from a XML encoding in s-expressions, called " (a (@ (href . "https://en.wikipedia.org/wiki/SXML") (rel . "external")) "SXML") ".") (p "It is (relatively) easy to parse and contains everything to transform it into real HTML." " " "In contrast to HTML, SHTML is easier to parse and to manipulate." " " "For example, take a look at the SHTML encoding of this page, which is available via the " (@L (@H "“") "Info" (@H "”")) " sub-page of this zettel:") (ul (li (a (@ (href . "/z/00001012920525?enc=shtml&part=zettel")) "/z/00001012920525?enc=shtml&part=zettel") ",") (li (a (@ (href . "/z/00001012920525?enc=shtml&part=meta")) "/z/00001012920525?enc=shtml&part=meta") ",") (li (a (@ (href . "/z/00001012920525?enc=shtml&part=content")) "/z/00001012920525?enc=shtml&part=content") ".")) (p "If transferred via HTTP, the content type will be " (kbd "text/plain") ".") (p "Internally, if a zettel should be transformed into HTML, the zettel is translated into the " (a (@ (href . "00001012920516")) "Sz encoding") ", which is transformed into this SHTML encoding to produce the " (a (@ (href . "00001012920510")) "HTML encoding") ".") (h2 (@ (id . "syntax-of-shtml")) "Syntax of SHTML") (p "There are only two types of elements: atoms and lists, similar to the Sz encoding.") (p "A list always starts with the left parenthesis (" (@L (@H "“") (kbd "(") (@H "”")) ", U+0028) and ends with a right parenthesis (" (@L (@H "“") (kbd ")") (@H "”")) ", U+0029)." " " "A list may contain a possibly empty sequence of elements, i.e. lists and / or atoms." " " "Before the last element of a list of at least to elements, a full stop character (" (@L (@H "“") (kbd ".") (@H "”")) ", U+002E) signal a pair as the last two elements." " " "This allows a more space economic storage of data.") (p "An HTML tag like " (code "< a href=\"link\">Text") " is encoded in SHTML with a list, where the first element is a symbol named a the tag." " " "The second element is an optional encoding of the tag's attributes." " " "Further elements are either other tag encodings or a string." " " "The above tag is encoded as " (code "(a (@ (href . \"link\")) \"Text\")") "." " " "Also possible is to encode the attribute without pairs: " (code "(a (@ (href \"link\")) \"Text\")") " (note the missing full stop character)."))