Skip to content

Quickstart

Build your first deck and serve it locally.

1. Minimal program

A complete kslides program is just a main() calling the kslides {} DSL:

fun main() {
  kslides {
    presentation {
      markdownSlide {
        content {
          """
          # Hello, kslides!
          A Kotlin DSL for reveal.js.
          """
        }
      }
    }
  }
}

The default output is a static site under docs/ plus a Ktor server on port 8080.

2. Choose where it goes

You can switch off either output, or change the port:

fun staticOutput() {
  kslides {
    output {
      enableFileSystem = true
      enableHttp = false
      // outputDir defaults to "docs"
    }

    presentation {
      path = "index.html"
      markdownSlide { content { "# Static site" } }
    }
  }
}
fun httpOutput() {
  kslides {
    output {
      enableFileSystem = false
      enableHttp = true
      httpPort = 8080
    }

    presentation {
      path = "index.html"
      markdownSlide { content { "# Live server" } }
    }
  }
}

3. Add more presentations

Each presentation { } block becomes its own deck at the given path:

fun multiplePresentations() {
  kslides {
    presentation {
      path = "index.html"
      markdownSlide { content { "# Welcome" } }
    }

    presentation {
      path = "talks/2026.html"
      markdownSlide { content { "# 2026 talk" } }
    }
  }
}

After running, you'll have docs/index.html and docs/talks/2026.html.

4. Mix slide types

You're not limited to Markdown — see the Slides overview for the full picture.

fun dslBasic() {
  kslides {
    presentation {
      dslSlide {
        content {
          h1 { +"Kotlin HTML DSL" }
          p { +"Build slides with kotlinx.html." }
        }
      }
    }
  }
}

Next steps