internal class SomeSample {
fun someFunction() {
val a = 5
}
}
And use it in your code doc:
Copy code
public object SomeObject {
/**
* Some doc.
*
* @sample your.package.SomeSample.someFunction
*/
public fun someFunction() {
...
}
}
You will see
val a = 5
in dokka sample output
i
Ignat Beresnev
02/03/2022, 3:55 PM
This should also work starting from
1.6.10
(without any extra configuration):
Copy code
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)
}
j
Justin (Midas) Gilman
02/03/2022, 4:16 PM
This worked! Thanks so much! I spent like 4 hours yesterday trying out configurations
i
Ignat Beresnev
02/03/2022, 5:55 PM
I can relate :)) Also tried to find a way myself for an hour before stumbling upon this in an issues. We'll update the documentation to make it more clear