/rimu-kt

Rimu Markup for the JVM

Primary LanguageKotlinMIT LicenseMIT

Rimu Markup for the JVM

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.

Using the Rimu library

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:

Building rimu-kt

To build from source:

  1. Install the Git repository from Github.

     git clone https://github.com/srackham/rimu-kotlin-example.git
    
  2. Build and test:

     ./gradlew clean test
    

rimukt CLI

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>

Implementation

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.