Skip to content

Commit

Permalink
Updating website (#2477)
Browse files Browse the repository at this point in the history
Co-authored-by: Israel Pérez González <israel.perez.glez@gmail.com>
Co-authored-by: Rachel M. Carmena <rachelcarmena@users.noreply.github.com>
Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
Co-authored-by: Raúl Raja Martínez <raulraja@gmail.com>
  • Loading branch information
5 people authored Sep 15, 2021
1 parent b5dcf46 commit 8be2997
Show file tree
Hide file tree
Showing 105 changed files with 3,678 additions and 440 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ public val interpreter: AnkOps = object : AnkOps {
snippets.second.mapIndexed { i, snip ->
val result = try {
if (snip.isPlaygroundExtension) ""
else engineCache.getOrElse(snip.lang) {
else engineCache.getOrElse(snip.lang.trim { it == '`' }) {
throw CompilationException(
path = snippets.first,
snippet = snip,
underlying = IllegalStateException("No engine configured for `${snip.lang}`"),
msg = colored(ANSI_RED, "ΛNK compilation failed [ ${snippets.first} ]")
msg = colored(ANSI_RED, "ΛNK compilation failed - No engine configured for `${snip.lang}` [ ${snippets.first} ]")
)
}.eval(snip.code)
} catch (e: Exception) {
Expand Down
23 changes: 17 additions & 6 deletions arrow-libs/ank/arrow-ank/src/main/kotlin/arrow/ank/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ import java.nio.file.Paths
public suspend fun main(vararg args: String): Unit =
when {
args.size > 1 -> {
ank(
Paths.get(args[0]),
Paths.get(args[1]),
args.drop(2),
interpreter
)
println("####################################################################################################################")
println("####################################################################################################################")
println("####################################################################################################################")
println("####################################################################################################################")
println("####################################################################################################################")
println("####################################################################################################################")
try {
ank(
Paths.get(args[0]),
Paths.get(args[1]),
args.drop(2),
interpreter
)
} catch (e: Throwable) {
println("####################################################################################################################")
e.printStackTrace()
}
}
else -> throw IllegalArgumentException("Required first 2 args as directory paths in this order: <required: source> <required: destination> <optional: classpath entries, one per arg..>")
}
3 changes: 3 additions & 0 deletions arrow-libs/ank/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ include 'arrow-fx-coroutines-test'

project(":arrow-fx-coroutines").projectDir = file("../fx/arrow-fx-coroutines")
project(":arrow-fx-coroutines-test").projectDir = file("../fx/arrow-fx-coroutines-test")

include 'jekyll'
project(":jekyll").projectDir = file("dokka/jekyll")
6 changes: 5 additions & 1 deletion arrow-libs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {
apply from: "gradle/$ROOT_PROJECT"

task generateDoc(type: Exec) {
commandLine "sh", "gradlew", "dokkaJekyll"
commandLine "sh", "gradlew", "dokkaGfm"
}

task runValidation(type: Exec) {
Expand All @@ -38,3 +38,7 @@ task buildDoc {
}

runValidation.mustRunAfter generateDoc

apiValidation {
ignoredProjects += ["jekyll"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import kotlin.jvm.JvmStatic
* println(left)
* }
* ```
*
* Because `Either` is right-biased, it is possible to define a Monad instance for it.
*
* Since we only ever want the computation to continue in the case of `Right` (as captured by the right-bias nature),
Expand Down Expand Up @@ -1196,25 +1197,21 @@ public inline fun <A, B> Either<A, B>.filterOrElse(predicate: (B) -> Boolean, de
*
* Example:
*
* {: data-executable='true'}
* ```kotlin:ank
* ```kotlin:ank:playground
* import arrow.core.*
* import arrow.core.Either.Right
*
* Right(12).filterOrOther({ it > 10 }, { -1 })
* ```
*
* {: data-executable='true'}
* ```kotlin:ank
* Right(7).filterOrOther({ it > 10 }, { "Value '$it' not greater than 10" })
* ```
* suspend fun main(): Unit {
* //sampleStart
* Either.Right(7).filterOrOther({ it == 10 }, { "Value '$it' is not equal to 10" })
* .let(::println) // Either.Left(Value '7' is not equal to 10")
*
* {: data-executable='true'}
* ```kotlin:ank
* import arrow.core.Either.Left
* Either.Right(10).filterOrOther({ it == 10 }, { "Value '$it' is not equal to 10" })
* .let(::println) // Either.Right(10)
*
* val left: Either<Int, Int> = Left(12)
* left.filterOrOther({ it > 10 }, { -1 })
* Either.Left(12).filterOrOther({ str: String -> str.contains("impossible") }, { -1 })
* .let(::println) // Either.Left(12)
* //sampleEnd
* }
* ```
*/
public inline fun <A, B> Either<A, B>.filterOrOther(predicate: (B) -> Boolean, default: (B) -> A): Either<A, B> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import kotlin.coroutines.cancellation.CancellationException
* val nonFatal: Either<Throwable, String> =
* //sampleStart
* try {
* Right(unsafeFunction(1))
* Either.Right(unsafeFunction(1))
* } catch (t: Throwable) {
* if (NonFatal(t)) {
* Left(t)
* Either.Left(t)
* } else {
* throw t
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ package arrow.core
* val nonFatal: Either<Throwable, String> =
* //sampleStart
* try {
* Right(unsafeFunction(1))
* Either.Right(unsafeFunction(1))
* } catch (t: Throwable) {
* Left(t.nonFatalOrThrow())
* Either.Left(t.nonFatalOrThrow())
* }
* //sampleEnd
* println(nonFatal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {
id "org.jlleitschuh.gradle.ktlint"
}

apply from: "../$DOC_CREATION"

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION"
implementation "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION"
Expand Down
1 change: 0 additions & 1 deletion arrow-libs/core/arrow-meta/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ plugins {
}

apply from: "$SUB_PROJECT"
apply from: "$DOC_CREATION"
apply from: "$PUBLICATION"

dependencies {
Expand Down
3 changes: 3 additions & 0 deletions arrow-libs/core/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ include 'arrow-core'
include 'arrow-core-test'
include 'arrow-continuations'
include 'arrow-core-retrofit'

include 'jekyll'
project(":jekyll").projectDir = file("dokka/jekyll")
12 changes: 12 additions & 0 deletions arrow-libs/dokka/jekyll/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jlleitschuh.gradle.ktlint"
}

apply from: "$SUB_PROJECT"

dependencies {
compileOnly "org.jetbrains.dokka:dokka-core:$DOKKA_VERSION"
implementation "org.jetbrains.dokka:dokka-base:$DOKKA_VERSION"
implementation "org.jetbrains.dokka:gfm-plugin:$DOKKA_VERSION"
}
4 changes: 4 additions & 0 deletions arrow-libs/dokka/jekyll/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Maven publishing configuration
POM_NAME=Arrow Dokka Jekyll
POM_ARTIFACT_ID=arrow-dokka-jekyll
POM_PACKAGING=jar
Loading

0 comments on commit 8be2997

Please sign in to comment.