include
include variant for use inside a <code> block. Disables the HTML escape + indent-token behavior (the <code> tag already controls both) and pads the result for reveal.js's line-number display.
include variant for use inside a com.kslides.slide.DslSlide content{} block. Same semantics as CODE.include — HTML escaping and the indent token are turned off.
include variant for a Markdown slide's content{} block, where reveal.js's Markdown renderer escapes its own output. Unlike CODE.include and DslSlide.include the indent token is kept, since Markdown content is re-indented to match the surrounding block.
include variant for an htmlSlide content{} block — the one sink whose content is still parsed as markup, so escaping stays on. Identical to the bare include; it exists so every sink is receiver-resolved, rather than htmlSlide being the one whose behavior comes from the absence of an overload.
Load content from a local file or remote URL. Preferred over embedding code inline in slides because it avoids whitespace-sensitivity issues and lets you keep the source of truth in one place.
Escapes markup so the content renders as text. That is what htmlSlide { content { ... } } needs, and this overload is the one that resolves there. Elsewhere a destination-aware variant wins instead — see IncludeVariants.kt — because a <code> block, a dslSlide, and a markdownSlide each escape their own output, so content escaped here would reach the browser as a visible ". Resolution is by the enclosing receiver, so the choice is not yours to make.
Return
the resolved content, or an empty string if the file/URL cannot be read (an I/O failure, missing file, or failed HTTP fetch — a warning is logged). Authoring errors such as an absent beginToken/endToken or a malformed linePattern are not swallowed; they propagate.
Parameters
local path (relative to the process working directory) or http(s):// URL. Paths containing ../ are rejected.
optional reveal.js-style line range (e.g. "1-3|5") to restrict which lines are returned.
if non-blank, only content after a line containing this token is returned.
if non-blank, only content before a line containing this token is returned.
when true, the begin/end-token lines themselves are excluded from the output.
remove the common leading indentation from all returned lines.
marker string the renderer uses to re-indent included lines to match the surrounding Markdown/HTML; set to "" in code contexts.
escape markup in the returned content so it renders as text rather than being interpreted; disable for kotlinx.html.CODE blocks that already own their escaping.
Throws
if src is a local path containing "../", or if a beginToken/endToken is not found, or if linePattern is malformed.