Package-level declarations

Types

Link copied to clipboard

Toggle for Kotlin Playground's "open in IDE" crosslink button.

Link copied to clipboard
data class CssFile(val filename: String, val id: String = "")

A CSS file referenced from the generated <head>. The filename may be a relative path (resolved against the reveal.js static root) or an absolute http(s):// URL. The optional id is emitted as the <link>'s id attribute — used internally to tag theme / highlight stylesheets.

Link copied to clipboard
class CssValue(text: String = "", val valid: Boolean = true)

Accumulator for CSS content attached to a com.kslides.KSlides or com.kslides.Presentation. Supports both raw-string and Kotlin CSS-DSL input via +=, and enforces that CSS is only declared at scopes that actually render a <style> tag.

Link copied to clipboard

Receiver for diagram blocks. Extends DiagramConfig so you can override size, style, and output format in the same block that sets source.

Link copied to clipboard

Image format produced by a Kroki com.kslides.diagram call. Not every Kroki diagram type supports every output format — consult the Kroki docs for the specific diagram you are rendering.

Link copied to clipboard
class Dimensions(val width: Int, val height: Int)

A width × height pair. Used primarily for sizing the letsPlot{} render area; construct via the by infix helper (640 by 480) for readability.

Link copied to clipboard
enum Effect : Enum<Effect>

reveal.js fragment effect applied to a progressively-revealed element. Used by com.kslides.fragment to build .fragment class attributes.

Link copied to clipboard

Code-highlighting theme shipped with the reveal.js highlight plugin. Assign to com.kslides.config.PresentationConfig.highlight.

Link copied to clipboard

HTML <a target="..."> value. Used by corner links and com.kslides.listHref to avoid hard-coding the magic strings.

Link copied to clipboard
data class JsFile(val filename: String)

A JavaScript file referenced from the generated <body>. The filename may be a relative path (resolved against the reveal.js static root) or an absolute http(s):// URL.

Link copied to clipboard
class KSlides

Root orchestrator for a set of presentations. Instances are not meant to be constructed directly — use the kslides top-level function instead, which applies the DSL block and then triggers the configured output modes.

Link copied to clipboard
object KSlidesDsl

Internal namespace for the kslides DSL infrastructure. Currently exposes only the shared logger used by free-standing DSL helpers in this file. Public so that DSL extensions defined in the same shape (e.g. letsPlot{}, custom user DSLs) can route their log output through the same channel as built-in helpers; not intended as a stable extension point.

Link copied to clipboard
annotation class KSlidesDslMarker

Marks receiver types that participate in the kslides DSL so that Kotlin's scope-control can prevent unintended nesting (e.g. calling markdownSlide{} directly from inside another slide's content block).

Link copied to clipboard

reveal.js navigation mode. Controls how arrow-key and touch navigation behave across horizontal and vertical slides.

Link copied to clipboard
object Playground

Renderer for Kotlin Playground iframe documents. Builds a self-contained HTML page that boots the Kotlin Playground script (per com.kslides.config.KSlidesConfig.playgroundUrl) against a primary source file plus optional dependency files, applying the supplied CSS to the page head.

Link copied to clipboard

Language/syntax mode the Kotlin Playground editor operates in. Not every mode is executable — some (e.g. GROOVY, XML) only enable syntax highlighting.

Link copied to clipboard

Kotlin Playground editor theme.

Link copied to clipboard
class Presentation(val kslides: KSlides)

A single presentation — the unit that reveal.js renders as one HTML page. Created via KSlides.presentation and populated with slide definitions, per-presentation configuration, and scoped CSS.

Link copied to clipboard

Built-in reveal.js presentation theme. Assign to com.kslides.config.PresentationConfig.theme.

Link copied to clipboard

reveal.js 5.0+ scroll-layout mode.

Link copied to clipboard

Options for reveal.js 5.0+ scrollProgress. Use the config property's Boolean form for on/off.

Link copied to clipboard

reveal.js 5.0+ scroll-snap mode. Use the config property's Boolean form to disable snapping.

Link copied to clipboard
enum Speed : Enum<Speed>

reveal.js transition speed. UNASSIGNED means "inherit from the enclosing scope" and is the default in com.kslides.config.SlideConfig.

Link copied to clipboard
data class StaticRoot(val dirname: String)

A directory under reveal.js's static asset root that kslides should expose when serving over HTTP. Registered on com.kslides.config.KSlidesConfig.httpStaticRoots.

Link copied to clipboard

Kotlin Playground execution target — what runtime the embedded code runs against. Mirrors the Kotlin Playground data-target-platform attribute.

Link copied to clipboard

reveal.js slide-transition style. UNASSIGNED means "inherit" and is the default in com.kslides.config.SlideConfig so that per-slide transitions fall back to the presentation setting.

Link copied to clipboard
object Utils

Internal utility holder — not part of the public API.

Link copied to clipboard

Receiver type for verticalSlides{} blocks. Exposes per-stack id/classes/style attributes plus a slideConfig that applies to every child slide in the stack.

Link copied to clipboard

reveal.js 5.0+ view mode: the default "deck" layout versus the scrolling "doc" layout.

Functions

Link copied to clipboard
fun FlowOrInteractiveOrPhrasingContent.atag(text: String, href: String, newWindow: Boolean = true)

Emit an <a> anchor with the given text and href. By default, opens in a new window (target="_blank").

Link copied to clipboard
fun TBODY.bodyRow(vararg items: TD.() -> Unit)

Emit a <tr> inside a <tbody> where each cell is a TD-builder lambda.

fun TBODY.bodyRow(vararg items: String)

Emit a <tr> inside a <tbody> with one <td> per string in items.

Link copied to clipboard
infix fun Int.by(that: Int): Dimensions

Infix helper for building a Dimensions: 640 by 480.

Link copied to clipboard
fun FlowContent.codeSnippet(block: CodeSnippetConfig.() -> Unit)

Emit a reveal.js-compatible <pre><code> code block with optional line-number highlighting and a copy-to-clipboard button (when the CopyCode plugin is enabled). Call from inside a com.kslides.slide.DslSlide content{} block.

Link copied to clipboard
fun DslSlide.diagram(diagramType: String, diagramBlock: DiagramDescription.() -> Unit)

Embed a Kroki-rendered diagram inside a DslSlide content{} block. The diagram source is POSTed to Kroki; the resulting image is cached by filename so repeated renders of the same presentation do not re-hit Kroki.

Link copied to clipboard
fun fragment(effect: Effect = Effect.NONE, index: Int = 0): String

Emit a reveal.js fragment attribute comment. Attach to a line in Markdown content to reveal it progressively on click.

Link copied to clipboard
fun githubRawUrl(username: String, repoName: String, path: String = "", branchName: String = "master"): String

Build a https://raw.githubusercontent.com/{user}/{repo}/{branch}/{path} URL pointing at the raw contents of a file on GitHub. Useful as the src argument to include.

Link copied to clipboard
fun githubSourceUrl(username: String, repoName: String, path: String = "", branchName: String = "master"): String

Build a https://github.com/{user}/{repo}/blob/{branch}/{path} URL pointing at a source file in the GitHub web UI.

Link copied to clipboard
fun THEAD.headRow(vararg items: TH.() -> Unit)

Emit a <tr> inside a <thead> where each cell is a TH-builder lambda.

fun THEAD.headRow(vararg items: String)

Emit a <tr> inside a <thead> with one <th> per string in items.

Link copied to clipboard
fun include(src: String, linePattern: String = "", beginToken: String = "", endToken: String = "", exclusive: Boolean = true, trimIndent: Boolean = true, indentToken: String = INDENT_TOKEN, escapeHtml: Boolean = true): String

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.

Link copied to clipboard
fun DslSlide.include(src: String, linePattern: String = "", beginToken: String = "", endToken: String = "", exclusive: Boolean = true, trimIndent: Boolean = true): String

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.

fun CODE.include(src: String, linePattern: String = "", beginToken: String = "", endToken: String = "", exclusive: Boolean = true, trimIndent: Boolean = true): String

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.

Link copied to clipboard
fun kslides(block: KSlides.() -> Unit): KSlides

Top-level entry point for defining presentations.

Link copied to clipboard
fun kslidesTest(block: KSlides.() -> Unit): KSlides

Convenience wrapper around kslides for tests: evaluates the DSL with both OutputConfig.enableFileSystem and OutputConfig.enableHttp forced to false so no files are written and no server is started.

Link copied to clipboard
inline fun LI.listHref(url: String, text: String = "", target: HrefTarget = HrefTarget.SELF, classes: String = "", crossinline block: A.() -> Unit = {})

Emit an <a> inside an <li>. Displays text if non-blank, otherwise falls back to the raw url.

Link copied to clipboard
inline fun FlowContent.orderedList(items: List<String>, crossinline block: OL.() -> Unit = {})
inline fun FlowContent.orderedList(vararg items: String, crossinline block: OL.() -> Unit = {})

Emit an <ol> with one <li> per string in items.

inline fun FlowContent.orderedList(vararg items: LI.() -> Unit, crossinline block: OL.() -> Unit = {})

Emit an <ol> where each item is an LI-builder lambda.

Link copied to clipboard
fun <T> List<T>.permuteBy(vararg orders: List<Int>): Sequence<List<T>>

Generate a sequence of list permutations by picking indices from the receiver according to each orders spec. Used by the example deck to build progressive-reveal animations of the same set of items in different orders.

Link copied to clipboard
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.

Link copied to clipboard
fun HTMLTag.rawHtml(html: String)

Write html into the current kotlinx.html tag without escaping. Intended for embedding Markdown or third-party HTML snippets inside a DSL slide.

Link copied to clipboard
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 re-renders on each request. In filesystem mode, the content is written to <path>/<filename> immediately.

Link copied to clipboard

Emit the reveal.js HTML comment that sets a slide's background color. Embed the result verbatim in a Markdown slide's content{} block.

Link copied to clipboard

Parse a reveal.js line-highlight pattern string (e.g. "[1-3|5|*]" or "(1|2|*)") into a list of reveal.js data-line-numbers tokens. * in the input is converted to an empty string (meaning "highlight nothing").

Link copied to clipboard
inline fun FlowContent.unorderedList(items: List<String>, crossinline block: UL.() -> Unit = {})
inline fun FlowContent.unorderedList(vararg items: String, crossinline block: UL.() -> Unit = {})

Emit a <ul> with one <li> per string in items.

inline fun FlowContent.unorderedList(vararg items: LI.() -> Unit, crossinline block: UL.() -> Unit = {})

Emit a <ul> where each item is an LI-builder lambda. Use this form when the list items need nested markup (e.g. links, inline code).