Justin (Midas) Gilman
02/02/2022, 4:44 PM@sample
to reference some example code and I cannot get it to work. I'm looking at https://github.com/JetBrains/kotlin/blob/bd4d8479430a3ebda030ce4856886e9985cacd75/libraries/stdlib/src/kotlin/collections/Iterators.kt#L8 as an example but I can't figure out how to make it work.PabloCasia
02/03/2022, 7:45 AMtasks.withType<DokkaTask> {
dokkaSourceSets {
register("main") {
samples = listOf("$projectDir/src/sample")
}
}
}
Then add a sample to that dir, for example:
internal class SomeSample {
fun someFunction() {
val a = 5
}
}
And use it in your code doc:
public object SomeObject {
/**
* Some doc.
*
* @sample your.package.SomeSample.someFunction
*/
public fun someFunction() {
...
}
}
You will see val a = 5
in dokka sample outputIgnat Beresnev
02/03/2022, 3:55 PM1.6.10
(without any extra configuration):
package <http://org.jetbrains.qa|org.jetbrains.qa>
/**
* Hello, Sample
* @sample org.jetbrains.qa.runSample
*/
fun withSample(a: Int): Int{
return a + 1
}
fun runSample(){
withSample(41)
}
Justin (Midas) Gilman
02/03/2022, 4:16 PMIgnat Beresnev
02/03/2022, 5:55 PM