Kotlin DSL for HTML
Kotlin Shell Batchfile JavaScript
Latest commit d03abce Jan 17, 2017 @cy6erGn0m cy6erGn0m Fix js packaging mask
Permalink
Failed to load latest commit information.
.mvn/wrapper Add maven wrapper Dec 1, 2015
assembly Bump version to 0.6 Jan 17, 2017
generate Bump version to 0.6 Jan 17, 2017
js Fix js packaging mask Jan 17, 2017
jvm Bump version to 0.6 Jan 17, 2017
shared Bump version to 0.6 Jan 17, 2017
.gitignore Run tests in JavaScript May 26, 2015
README.md Upgrade to Kotlin 1.0.5 Nov 8, 2016
mvnw Add maven wrapper Dec 1, 2015
mvnw.cmd Add maven wrapper Dec 1, 2015
pom.xml Bump version to 0.6 Jan 17, 2017

README.md

Download TeamCity (simple build status) Kotlin GitHub license

kotlinx.html

A kotlinx.html library provides DSL to build HTML to Writer/Appendable or DOM at JVM and browser (or other JavaScript engine) for better Kotlin programming for Web.

Get started

See Getting started page for details how to include the library

DOM

You can build DOM tree with JVM and JS naturally

See example for JavaScript-targeted Kotlin

window.setInterval({
    val myDiv = document.create.div("panel") {
        p { 
            +"Here is "
            a("http://kotlinlang.org") { +"official Kotlin site" } 
        }
    }

    document.getElementById("container")!!.appendChild(myDiv)

    document.getElementById("container")!!.append {
        div {
            +"added it"
        }
    }
}, 1000L)

Stream

You can build HTML directly to Writer (JVM only) or Appendable (both JVM and JS)

System.out.appendHTML().html {
    body {
        div {
            a("http://kotlinlang.org") {
                target = ATarget.blank
                +"Main site"
            }
        }
    }
}

Documentation

See wiki pages

Building

See development page for details

Old version

See https://github.com/kotlinx/kotlinx.html.legacy for older version. We strongly recommend to migrate to latest version.