Skip to content

Output modes

kslides can render to two destinations, independently or together. Both are configured inside output { }.

Static site

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

    presentation {
      path = "index.html"
      markdownSlide { content { "# Static site" } }
    }
  }
}

Files land under outputDir (default docs/) — perfect for pushing to GitHub Pages or Netlify.

When the deck uses playground { }, letsPlot { }, or diagram { }, kslides emits the iframe content as separate HTML files under docs/playground/, docs/letsPlot/, and docs/kroki/ respectively.

HTTP server

fun httpOutput() {
  kslides {
    output {
      enableFileSystem = false
      enableHttp = true
      httpPort = 8080
    }

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

This starts a Ktor server on the chosen port. Iframe content is generated on the fly and cached per session.

Multiple presentations in one program

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

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

Each presentation { } becomes a separate page; nested directories under path map to nested directories on disk.

When to use which

You want… Use
Deploy to GitHub Pages / Netlify enableFileSystem = true
Local preview during development enableHttp = true (default)
Render dynamic data per request HTTP only
Both — preview locally, deploy the static artifact Leave both enabled