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