playground

fun DslSlide.playground(srcName: String, vararg otherSrcs: String = emptyArray(), configBlock: PlaygroundConfig.() -> Unit = {})

Embed an interactive Kotlin Playground iframe inside a DslSlide content{} block. The source file referenced by srcName is inlined into the Playground editor; any otherSrcs are attached as hidden <textarea class="hidden-dependency"> elements that Playground loads alongside the main file.

When Playground's dataTargetPlatform is TargetPlatform.JUNIT, the included file must not contain a package declaration.

Parameters

srcName

path or URL of the primary source file shown in the editor.

otherSrcs

additional source files attached as hidden dependencies (supporting classes, JUnit helpers, etc.).

configBlock

optional PlaygroundConfig overrides (iframe size, editor theme, target platform, auto-complete, etc.). Merged with global and presentation-level defaults.

Throws

if called outside a DslSlide content{} block.