https://kotlinlang.org logo
Title
c

Chris Overcash

04/17/2023, 10:07 PM
is there any way to fail a build if example code in the docstring fails to build or fails an assertion? love this feature from
cargo doc
j

jw

04/17/2023, 10:38 PM
Maybe knit?
c

Chris Overcash

04/17/2023, 10:52 PM
hmm. have you used this or know anything about the roadmap?
j

jw

04/17/2023, 11:00 PM
Coroutines uses it
c

Chris Overcash

04/17/2023, 11:10 PM
good enough for me 👍
i

Ignat Beresnev

04/18/2023, 10:01 AM
(knit started out more as an internal tool that resolves specific problems tbh, so beware - it might stay in the experimental stage for quite some time)
Just as with anything in Dokka, I'm pretty sure you can write a Dokka plugin for that 🙂 You can easily extract codeblocks from KDocs in Dokka, so you only have to find a way to validate/run it. If you're using
@sample
, it's becomes significantly more difficult to deal with, but is also doable It'd be awesome if you could submit a feature request to Dokka's issue tracker on GitHub, maybe one day it'll be implemented natively or as a separate plugin
c

Chris Overcash

04/18/2023, 4:09 PM