(((meta (@ (content . "Zettelmarkup: Zettel Transclusion") (name . "title"))) (meta (@ (content . "manual") (name . "role"))) (meta (@ (content . "#manual #zettelmarkup #zettelstore") (name . "tags"))) (meta (@ (content . "zmk") (name . "syntax"))) (meta (@ (content . "00001007031100") (name . "back"))) (meta (@ (content . "00001007031100") (name . "backward"))) (meta (@ (content . "1") (name . "box-number"))) (meta (@ (content . "(c) 2020-present by Detlef Stern ") (name . "copyright"))) (meta (@ (content . "20220809132350") (name . "created"))) (meta (@ (content . "00001004020000 00001006050000 00001007040000 00001007040324 00001007050000") (name . "forward"))) (meta (@ (content . "en") (name . "lang"))) (meta (@ (content . "EUPL-1.2-or-later") (name . "license"))) (meta (@ (content . "20220926183331") (name . "modified"))) (meta (@ (content . "20220926183331") (name . "published"))) (meta (@ (content . "public") (name . "visibility")))) (p "A zettel transclusion is specified by the following sequence, starting at the first position in a line: " (kbd "{{{zettel-identifier}}}") ".") (p "When evaluated, the referenced zettel is read." " " "If it contains some transclusions itself, these will be expanded, recursively." " " "When a recursion is detected, expansion does not take place." " " "Instead an error message replaces the transclude specification.") (p "An error message is also given, if the zettel cannot be read or if too many transclusions are made." " " "The maximum number of transclusion can be controlled by setting the value " (a (@ (href . "00001004020000#max-transclusions")) (kbd "max-transclusions")) " of the runtime configuration zettel.") (p "If everything went well, the referenced, expanded zettel will replace the transclusion element.") (p "For example, to include the text of the Zettel titled " (@L (@H "“") "Zettel identifier" (@H "”")) ", just specify its identifier " (a (@ (href . "00001006050000")) (kbd "00001006050000")) " in the transclude element:") (pre (code (@ (class . "language-zmk")) "{{{00001006050000}}}")) (p "This will result in:") (div (@ (class . "example")) (p "Each zettel is given a unique identifier." " " "To some degree, the zettel identifier is part of the metadata." " " "Basically, the identifier is given by the " (a (@ (href . "00001005000000")) "Zettelstore") " software.") (p "Every zettel identifier consists of 14 digits." " " "They resemble a timestamp: the first four digits could represent the year, the" " " "next two represent the month, following by day, hour, minute, and second.") (p "This allows to order zettel chronologically in a canonical way.") (p "In most cases the zettel identifier is the timestamp when the zettel was created.") (p "However, the Zettelstore software just checks for exactly 14 digits." " " "Anybody is free to assign a " (@L (@H "“") "non-timestamp" (@H "”")) " identifier to a zettel, e.g. with" " " "a month part of " (@L (@H "“") "35" (@H "”")) " or with " (@L (@H "“") "99" (@H "”")) " as the last two digits.") (p "Some zettel identifier are " (a (@ (href . "00001006055000")) "reserved") " and should not be used otherwise." " " "All identifiers of zettel initially provided by an empty Zettelstore begin with " (@L (@H "“") "000000" (@H "”")) ", except the home zettel " (kbd "00010000000000") "." " " "Zettel identifier of this manual have be chosen to begin with " (@L (@H "“") "000010" (@H "”")) ".") (p "A zettel can have any identifier that contains 14 digits and that is not in use" " " "by another zettel managed by the same Zettelstore.")) (p "Please note: if the referenced zettel is changed, all transclusions will also change.") (p "This allows, for example, to create a bigger document just by transcluding smaller zettel.") (p "In addition, if a zettel " (em "z") " transcludes a zettel " (em "t") ", but the current user is not allowed to view zettel " (em "t") " (but zettel " (em "z") "), then the transclusion will not take place." " " "To the current user, it seems that there was no transclusion in zettel " (em "z") "." " " "This allows to create a zettel with content that seems to be changed, depending on the authorization of the current user.") (hr) (p "Any " (a (@ (href . "00001007050000")) "attributes") " added to the transclusion will set/overwrite the appropriate metadata of the included zettel." " " "Of course, this applies only to thoes attribtues, which have a valid name for a metadata key." " " "This allows to control the evaluation of the included zettel, especially for zettel containing a diagram description.") (h2 (@ (id . "see-also")) "See also") (p (a (@ (href . "00001007040324")) "Inline-mode transclusion") " does not work at the paragraph / block level, but is used for " (a (@ (href . "00001007040000")) "inline-structured elements") "."))