recordIframeContent

fun recordIframeContent(useHttp: Boolean, staticContent: Boolean, kslides: KSlides, path: String, filename: String, contentBlock: () -> String)

Record iframe content for later retrieval. In HTTP mode, the content is cached (by filename) either as a materialized string (when staticContent is true) or as a lambda that is re-invoked per request. In filesystem mode, the content is written to <path>/<filename> immediately.

Used internally by com.kslides.playground and the letsPlot{} DSL; exposed publicly so custom extension DSLs in the same shape can reuse the caching pipeline.

Parameters

useHttp

true when serving via Ktor, false when writing static files.

staticContent

when useHttp is true, true caches the rendered string once; false caches the lambda and re-invokes it per request. Note the lambda's captured inputs (config, CSS, figure/source) are frozen at build time, so re-invocation reproduces identical output unless the lambda itself reads mutable external state (e.g. a file re-read via com.kslides.include).

kslides

owning KSlides instance (provides the shared iframe caches).

path

output directory for filesystem mode.

filename

file / cache key for the iframe content.

contentBlock

produces the HTML payload for the iframe.