Structure that reads naturally
Give objects names, group related values, and repeat blocks for collections.
A configuration language with named objects, familiar values, optional schemas, and support for the editor you already use.
// Each vehicles block adds a vehicle.
Fleet {
name = "Northstar"
active = true
vehicles {
model = "Comet"
range = 420
}
vehicles {
model = "Atlas"
range = 510
}
}
Open the fleet example in your editor.
Fleet names the root object. Inside its braces, name holds a string and each
vehicles block adds one item to a list. Change a model name, then use the converter
below to see your edit in JSON.
Give objects names, group related values, and repeat blocks for collections.
Strings, numbers, booleans, lists, and null look the way you expect.
Add comments and documentation where the next reader will need them.
Same data, different ways to write it. Select a format to see how it compares with KON.
name: "Northstar"
active: true
vehicles:
- model: "Comet"
range: 420
- model: "Atlas"
range: 510
Fleet {
name = "Northstar"
active = true
vehicles {
model = "Comet"
range = 420
}
vehicles {
model = "Atlas"
range = 510
}
}
The same values shown in each format. KON’s named root supplies context in the source.
Define a vehicle in one schema, then give it an electric field in another. Both schemas are ordinary KON files.
Schema {
type {
name = "Fleet"
fields {
name = "vehicles"
type = "List<Fleet.Car>"
}
type {
name = "Car"
fields {
name = "model"
type = "String"
}
}
}
}
Schema {
type {
fqn = "Fleet.Car"
fields {
name = "electric"
type = "Boolean"
}
}
}
Use schema directives at the top of an instance file to load both definitions. Your editor can then check the result as you work. Keep all three files in the same directory.
Download electric-fleet.kon// schema: fleet.schema.kon
// schema: electric.schema.kon
Fleet {
vehicles {
model = "Comet"
electric = true
}
}
Run the Gradle commands from the project root to build editor support locally.
Syntax highlighting and live diagnostics. Build with ./gradlew -p intellij-plugin
buildPlugin and install the ZIP from disk.
Highlighting, diagnostics, hover, completion, and formatting. Package with ./gradlew
vscodePackage and install the VSIX.
Bring KON support to editors that speak LSP. Build with ./gradlew :lsp:installDist.
Convert KON to JSON, YAML, or TOML from the command line.
Download konvertAdd the public development repository
to settings.gradle.kts.
dependencyResolutionManagement {
repositories {
mavenCentral()
maven("https://repo.sellmair.dev/") {
content { includeGroup("dev.sellmair") }
}
}
}In your module’s build.gradle.kts, add the library to dependencies.
For Kotlin Multiplatform, use commonMain.dependencies.
implementation("dev.sellmair:kon:0.0.1")Choose the ZIP for your operating system and processor.
Extract the ZIP into the same directory as fleet.kon.
On macOS or Linux, run ./konvert -f json fleet.kon.
In Windows PowerShell, run .\konvert.exe -f json fleet.kon.
The project includes implementations in Kotlin, Python, and Rust, alongside the language specification and editor tools.
Explore the language