include
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.
Intended for use inside markdownSlide { content { ... } } and htmlSlide { content { ... } } blocks. For com.kslides.slide.DslSlide use the include variant defined on DslSlide or kotlinx.html.CODE; those variants disable HTML escaping and the indentation token since the enclosing <code> tag handles both.
Return
the resolved content, or an empty string if reading fails (a warning is logged).
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.
HTML-escape the returned content; disable for kotlinx.html.CODE blocks that already own their escaping.
Throws
if src is a local path containing "../".
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.