Closed myuwono closed 3 years ago
@myuwono , Ank validation could be used for the code snippets in the README file meanwhile:
README.md
-```kotlin
+```kotlin:ank
(...)
-```kotlin
+```kotlin:ank
arrow-docs/build.gradle
dependencies {
- compileOnly "io.arrow-kt:arrow-optics:$ARROW_VERSION"
- compileOnly "io.arrow-kt:arrow-ui:$ARROW_VERSION"
- compileOnly "io.arrow-kt:arrow-fx:$ARROW_VERSION"
- compileOnly "io.arrow-kt:arrow-fx-rx2:$ARROW_VERSION"
- compileOnly "io.arrow-kt:arrow-fx-reactor:$ARROW_VERSION"
- compileOnly "io.arrow-kt:arrow-fx-kotlinx-coroutines:$ARROW_VERSION"
+ runtimeOnly project(':arrow-integrations-jackson-module')
}
(...)
ank {
- source = file("${rootDir}/build/apidocs")
- target = file("${rootDir}/build/_apidocs")
+ source = file("${rootDir}/build/documentation")
+ target = file("${rootDir}/build/_documentation")
classpath = sourceSets.main.runtimeClasspath
}
+
+task copyREADME(type: Copy) {
+ from "${rootDir}/README.md"
+ into "${rootDir}/build/documentation"
+}
+
+afterEvaluate {
+ runAnk.dependsOn 'copyREADME'
+ runAnk.mustRunAfter 'copyREADME'
+}
Then, run:
./gradlew :arrow-docs:runAnk
and errors will raise:
import
statements.arrow-docs/build.gradle
(runtimeOnly
configuration).In this way, we can ensure that the code snippets are up to date with the libraries.
Thanks @rachelcarmena that works like a charm!! Ank is really awesome.
fixes #55
@rachelcarmena i'm still trying to figure out what's the general strategy around documentation in Arrow. PS: I noticed there's a docs module.