slideDefinition

fun slideDefinition(source: String, token: String, title: String = "Slide Definition", highlightPattern: String = "[]", id: String = "", classes: String = "", language: String = "kotlin", githubAccount: String = "kslides", githubRepo: String = "kslides", githubPath: String = source, githubBranch: String = "master", configBlock: SlideConfig.() -> Unit = {})

Generate a Markdown "meta" slide that embeds a highlighted code excerpt from source between // <token> begin and // <token> end markers, and appends a "GitHub Source" link pointing at the same region on master. Primarily used by the kslides example deck to explain its own DSL.

Parameters

source

path (relative to the repo root) of the source file to excerpt.

token

the begin/end token bracketing the excerpt.

title

heading shown above the code block.

highlightPattern

reveal.js data-line-numbers pattern (e.g. "1-3|5").

id

optional slide id; must be unique across the deck (it becomes the <section> id). To style several definition slides together, use classes instead.

classes

optional CSS class(es) applied to the slide's <section>. Unlike id, a class may be reused across slides, so a single rule (e.g. .big pre { … }) can target them all. Space-separated for multiple classes.

language

syntax-highlighting language for the code fence.

githubAccount

GitHub account/org for the "GitHub Source" link. Defaults to "kslides".

githubRepo

GitHub repository for the link. Defaults to "kslides".

githubPath

repo-relative path the link points at. Defaults to source.

githubBranch

branch the link points at. Defaults to "master".

configBlock

optional per-slide configuration (e.g. codeFontSize) applied to the generated slide.


fun VerticalSlidesContext.slideDefinition(source: String, token: String, title: String = "Slide Definition", highlightPattern: String = "[]", id: String = "", classes: String = "", language: String = "kotlin", githubAccount: String = "kslides", githubRepo: String = "kslides", githubPath: String = source, githubBranch: String = "master", configBlock: SlideConfig.() -> Unit = {})

Vertical-stack variant of slideDefinition. Identical semantics but registers the generated Markdown slide inside the enclosing VerticalSlidesContext.