Lmml. Embed
(Lmml v0.1.0)
View Source
The one abstraction behind both lmml embedding syntaxes.
@name.ext (a reference) and @@@name.ext ... @@@ (an inline embed) are
two different textual renderings of the exact same semantic idea:
"this document contains a named embedded entity called name.ext."
They differ only in where the entity's content actually lives:
{:inline, binary}-- the content is the embed's own text, captured directly from a@@@name.ext ... @@@block. Works in anylmmldocument, including a bare.lmmltext file with no other files.{:external, entry_name}-- the content lives elsewhere, referenced by@entry_nameand resolved against a.lmmlzzip archive's entries. Meaningless (unresolvable) outside a zip container.
Lmml.Pack.pack/2 and Lmml.Pack.inline/2 mechanically convert one
form into the other; nothing about the embed's meaning changes.
Summary
Functions
Builds an external embed (content resolved from a zip entry at read time).
True when the embed's content must be resolved against an external (zip) entry.
Builds an inline embed (content captured directly in the narrative).
True when the embed's content is carried inline in the narrative itself.
Types
Functions
Builds an external embed (content resolved from a zip entry at read time).
entry_name defaults to name itself when omitted or nil, so
external("a.png") and external("a.png", nil) both resolve against
a zip entry literally named "a.png".
True when the embed's content must be resolved against an external (zip) entry.
Builds an inline embed (content captured directly in the narrative).
True when the embed's content is carried inline in the narrative itself.