All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cc.unitmesh.docs.model.DocContent.kt Maven / Gradle / Ivy

Go to download

Chocolate Factory is a cutting-edge LLM toolkit designed to empower you in creating your very own AI assistant.

There is a newer version: 1.0.0
Show newest version
package cc.unitmesh.docs.model

import cc.unitmesh.docs.kdoc.KDocContent
import cc.unitmesh.docs.sample.ClassSample
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
import org.jetbrains.kotlin.psi.KtElement

data class DocContent(
    val name: String,
    val content: String,
    val element: KtElement?,
    val sampleCode: ClassSample? = null,
) {
    companion object {
        fun fromKDoc(content: KDocContent, sampleCode: ClassSample? = null): DocContent {
            return DocContent(
                name = content.element?.name ?: "",
                content = content.sections.joinToString("\n", transform = KDocSection::getContent),
                element = content.element,
                sampleCode = sampleCode
            )
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy