Hey everyone :wave: I’m using KotlinX Knit with Do...
# dokka
s
Hey everyone 👋 I’m using KotlinX Knit with Dokka (html), but my README, and links seem to be broken. Any ideas? https://nomisrev.github.io/Continuation/ https://github.com/nomisRev/Continuation
b
What's knit? First time I'm hearing about it!
s
KotlinX Knit, it’s a tool to verify Kotlin code in documentation. It automatically generates samples, and tests. You can bring in whatever dependencies you want, and you can write custom templates for test generation. I’ve been experimenting for a couple days, and currently I have a very nice way of doing property based testing right in the docs and they also work for tests, including coverage and running on CI etc.
b
But.... You have no autocompletion nor syntax validation? Seems like a very roundabout way to go around testing
s
This is more about documentation using samples than testing 😄
b
I see. Basically squeezing a bit more out of the docs
Do you have a link to their repo?
s
I was also just experimenting how far you can take it, my goal is to have validation over examples in docs. Using an assertion framework helps making that easier because you can verify output whilst showing it in the example:
Copy code
listOf(1, 2).map { it + 1 } shouldBe listOf(2, 3)
Seems more expressive to me than:
Copy code
listOf(1, 2).map { it + 1 }
The result is
[2, 3]
Here is a link. It is also officially on the Kotlin roadmap now, together with Dokka
Also it should be possible to provide IDEA support within the snippet blocks through an IDEA plugin. I’m hoping that’s on their roadmap
That’d be insanely nice for working on documentation