Lmml.Narrative.Syntax (Lmml v0.1.0)

View Source

Builds the Md syntax map used by Lmml.Narrative.Parser: Md.Parser.Syntax's Default syntax module's prose/structure categories, plus lmml's own additions/overrides.

Two additions on top of Default:

  • magnet: "@" is overridden (same category, same prefix key, so Md.Parser.Syntax.merge/2 replaces Default's TwitterHandle transform with ours) to produce an :lmml_ref node instead of a Twitter link.
  • block: "@@@" is added (a new prefix key in the block category, alongside Default's ``` fenced-code entry) to produce an :lmml_embed node for inline embeds, with escape: false so its content is carried through verbatim instead of Md's default HTML-entity escaping (see Md >= 0.12.2's block: escape: property).

Both live in different categories than each other, and Md's engine compiles block clauses before magnet clauses, so a "@@@..." input is tried against the (longer, more specific) block entry first and only falls through to the single-"@" magnet entry when it isn't a "@@@" sequence -- no custom dispatcher needed for this to be unambiguous.

Summary

Functions

Builds the final syntax map: Default plus lmml's overrides/additions.

Functions

build()

Builds the final syntax map: Default plus lmml's overrides/additions.