rimu-kt is a port of the Rimu Markup language for the Java platform written in Kotlin. It is functionally identical to the canonical TypeScript implementation.
The Rimu Kotlin library package is can be installed from the
JitPack Maven repository.
To use the rimu-kt
library in a Gradle based project you need to
include the JitPack repository and the rimu-kt
dependency in your project's
build.gradle.kts
file e.g.
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
testImplementation(kotlin("test"))
implementation("com.github.srackham:rimu-kt:11.4.0")
}
The above code is taken from the Minimal Rimu Kotlin Application on GitHub.
More examples:
To build from source:
-
Install the Git repository from Github.
git clone https://github.com/srackham/rimu-kotlin-example.git
-
Build and test:
./gradlew clean test
The CLI executable is named rimukt
and is functionally identical to the
rimuc
command.
The Gradle installDist
task builds Rimu CLI command startup scripts: rimukt
(for Linux) and rimukt.bat
(for Windows). These scripts are located in the
./build/install/rimukt/bin
directory:
./gradlew installDist
./build/install/rimukt/bin/rimukt --version
echo '**Hello World!**' | ./build/install/rimukt/bin/rimukt
The last command outputs:
<p>Hello <em>Rimu</em>!</p>
The one-to-one correspondence between the canonical TypeScript code and the Kotlin code eased porting and debugging. This also makes it easier to cross-port new features and bug-fixes.
Both the Kotlin and the TypeScript implementations share the same JSON driven test suites comprising over 300 compatibility checks.