aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationSource.kt
blob: 7c3f6d9795db5e481519999e5a12b8540df950f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package org.jetbrains.dokka.base.parsers.moduleAndPackage

import java.io.File

internal abstract class ModuleAndPackageDocumentationSource {
    abstract val sourceDescription: String
    abstract val documentation: String

    override fun toString(): String {
        return sourceDescription
    }
}

internal data class ModuleAndPackageDocumentationFile(private val file: File) : ModuleAndPackageDocumentationSource() {
    override val sourceDescription: String = file.path
    override val documentation: String by lazy(LazyThreadSafetyMode.PUBLICATION) { file.readText() }
}