Something went wrong. Try again.
Material MkDocs theme for Dokka, Kotlin's documentation engine dokka-mkdocs.opensavvy.dev
Something went wrong. Try again.
4.4 kB · 236 lines
Kotlin
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237package opensavvy.dokka.material.mkdocs.example
import kotlin.jvm.JvmName
/** * This is an annotation. * * It is used in [anotherTopLevelFunction] and on [Example.foo]. */@Target(AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER)@MustBeDocumentedannotation class MyAnnotation
/** * This class is an example to see how the documentation website is generated. * * ### Example * * ```kotlin * Example().foo("Hello") shouldBe "Hello world!" * ``` * * Another example: * ```java * class Foo { * public static void main(String[] args) { * System.out.println("Hello world!" + 3 + true); * } * } * ``` * * @constructor Public constructor for the [Example] class. */class Example() : MyInterface {
/** * A value that increments by one each time it is accessed. * * This builder is not thread-safe. */ var counter: Int = 0 get() = field++ private set
/** * Secondary constructor. * * @param s Some variable. */ constructor(s: String) : this()
/** * This is an example function. * * This is a reference to a parameter: [bar]. * * # Level 1 * * This is a level 1 header. * * ## Level 2 * * This is a level 2 header. * * ### Level 3 * * This is a level 3 header. * * #### Level 4 * * This is a level 4 header. * * ##### Level 5 * * This is a level 5 header. * * @param bar This is a parameter. * @return This is a return type. */ fun foo(bar: Boolean): Boolean { TODO() }
/** * This is an example function. * * This is a reference to a parameter: [bar]. * * @param bar This is a parameter. * @return This is a return type. */ fun foo(bar: Char): Boolean { TODO() }
/** * This is an example function. * * This is a reference to a parameter: [bar]. * * @param bar This is a parameter. * @return This is a return type. */ fun foo(bar: String): Boolean { TODO() }
/** * Some other documentation. * * @see Example See the [Example] class for more information. */ @MyAnnotation @JvmName("foo_int") fun foo(number: Int): Boolean { TODO() }
/** * This is a method from [MyInterface] that has been overridden by the [Example] class. */ override fun fromInterface2(): String = "overridden"
/** * The companion object. * * Second line of documentation. */ companion object { const val DEFAULT = 4 }
class Nested {
companion object { const val DEFAULT = 5 } }}
/** * Top-level function masquerading as a constructor. */fun Example(id: Int): Example { TODO()}
/** * This is a top-level function. * * It has a long and complex documentation, with code examples and everything. * * ### Example * * ```kotlin * println(topLevelFunction() + 42) * ``` * * @see Example The [Example] class is completely unrelated to this function. * @author OpenSavvy */fun topLevelFunction(): Int { TODO()}
/** * This is a top-level function. * * It has a long and complex documentation, with code examples and everything. * * ### Example * * ```kotlin * println(topLevelFunction() + 42) * ``` * * @see Example The [Example] class is completely unrelated to this function. * @author OpenSavvy */fun topLevelFunction(a: Int) { TODO()}
/** * This is a top-level function. * * It has a long and complex documentation, with code examples and everything. * * ### Example * * ```kotlin * println(topLevelFunction() + 42) * ``` * * @see Example The [Example] class is completely unrelated to this function. * @author OpenSavvy */fun topLevelFunction(a: String) { TODO()}
/** * This is another top-level function with multiple parameters. * * This a link to a method: [Example.foo]. */fun anotherTopLevelFunction( @MyAnnotation param1: String, param2: Int, param3: Boolean, param4: String = "default", onAction: () -> Unit): Int { TODO()}
/** * This is a typealias. * * I don't really know what to write here, but it needs to spend multiple paragraphs. * * Learn more about typealiases in the [official documentation](https://kotlinlang.org/docs/type-aliases.html). */typealias ExampleAlias = Example
/** * Extension function for [ExampleAlias]. */@Suppress("RedundantSuspendModifier")suspend inline fun <reified T> ExampleAlias.foo2(): T = TODO()
/** * Extension property for [ExampleAlias]. */val ExampleAlias.prop2: String get() = "prop2"