Liking cljdoc? Tell your friends :D
All platforms.

toolnexus.frontmatter


parseclj/s

(parse text)

Parse text into [meta body]. meta has keyword keys and string values. No frontmatter at all => [{} text]. NEVER throws: frontmatter a real YAML parser refuses falls through to the rescue above, and a file the rescue cannot name either yields [{} body] — skill.cljc turns that into a typed skip, which is the only place the distinction is actionable.

Parse `text` into [meta body]. `meta` has keyword keys and string values.
No frontmatter at all => [{} text]. NEVER throws: frontmatter a real YAML
parser refuses falls through to the rescue above, and a file the rescue
cannot name either yields [{} body] — `skill.cljc` turns that into a typed
skip, which is the only place the distinction is actionable.
sourceraw docstring

read-frontmatterclj/s

(read-frontmatter text)

The full result of reading one SKILL.md's frontmatter:

{:data {keyword string} :body string :reason nil|"missing-name"|"malformed-frontmatter" :detail nil|"<the YAML parser's own message>"}

:detail is ADR 0028 decision 2 — the native parser error, carried in a SEPARATE field so the typed :reason stays byte-identical across ports while the message stays native and is never compared for parity.

The lenient rescue runs when the YAML parse THROWS, or yields a NON-MAPPING, or yields a mapping that is structurally wrong in name/description (A10).

The full result of reading one SKILL.md's frontmatter:

  {:data {keyword string} :body string :reason nil|"missing-name"|"malformed-frontmatter"
   :detail nil|"<the YAML parser's own message>"}

`:detail` is ADR 0028 decision 2 — the native parser error, carried in a
SEPARATE field so the typed `:reason` stays byte-identical across ports while
the message stays native and is never compared for parity.

The lenient rescue runs when the YAML parse THROWS, or yields a NON-MAPPING,
or yields a mapping that is structurally wrong in `name`/`description` (A10).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close