arrow-kt / arrow-integrations

Λrrow Integrations is part of Λrrow, a functional companion to Kotlin's Standard Library
http://arrow-kt.io
Other
27 stars 6 forks source link

Issue/add readme #56

Closed myuwono closed 3 years ago

myuwono commented 3 years ago

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.

rachelcarmena commented 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:

In this way, we can ensure that the code snippets are up to date with the libraries.

myuwono commented 3 years ago

Thanks @rachelcarmena that works like a charm!! Ank is really awesome.