Create a function containing a sample in a non-root package
package org.jetbrains.qa.kdoc.rendering
fun sample() {
val x = 100
println(x + 100)
}
2. Reference the sample from a KDoc (the functions in the same package, so the function is resolved)
```Kotlin
package org.jetbrains.qa.kdoc.rendering
/**
* Function with sample.
* @see [sample]
* @sample [sample]
*/
fun withSample(a: Int): Int{
return a + 1
}
/**
* Function with sample
* @see [org.jetbrains.qa.kdoc.rendering.sample]
* @sample [org.jetbrains.qa.kdoc.rendering.sample]
*/
fun withSampleFqdn(a: Int): Int{
return a + 1
}
Render the dokka
For the first function the sample is not rendered (that's the issue)
The behaviour corresponds to KDoc specification for @sample. It is complicated to find a needed scope since sample sources should be taken from a detached folder by design.
fun sample() { val x = 100 println(x + 100) }
For the first function the sample is not rendered (that's the issue)
For the second with fqn everything is fine:
For the
@see
param the same scenario works fine2032 might be relevant