
cc.unitmesh.docs.model.DocContent.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docs-builder Show documentation
Show all versions of docs-builder Show documentation
Chocolate Factory is a cutting-edge LLM toolkit designed to empower you in creating your very own AI assistant.
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