arrow-kt / ank

ΛNK: Compile time docs verification and evaluation for Kotlin and Java (Temporarily moved to Arrow-kt)
https://github.com/arrow-kt/arrow/tree/master/modules/ank
Apache License 2.0
53 stars 3 forks source link

ANK Draft impl #3

Closed raulraja closed 7 years ago

raulraja commented 7 years ago

Includes an implementation of Ank based on Kategory's Free monads. @Guardiola31337 I'm not sure where a good place to put a sample project with some docs is. Could you wire the code in this branch to the plugin etc.?

I'm my test project I was using this to invoke Ank:

task ank(type: JavaExec) {
    classpath sourceSets.main.runtimeClasspath
    main = "ank.MainKt"
    args "/home/raulraja/Documents/workspace/anktest/src/main/docs",
            "/home/raulraja/Documents/workspace/anktest/build/site",
            "-classpath", "${sourceSets.main.runtimeClasspath.join(":")}"
}

Here is a sample file it can be used for testing assuming is placed in src/main/docs in the sample project:

doc1.md

Welcome to doc one

Text before x

import kategory.*
val x : Try<Int> = Try { 0 }

Text before y

val y : Try<Int> = Try { 1 }

Text before z


val z : Try<Int> = Try { 2 }
raulraja commented 7 years ago

Code included in #7