This commit is contained in:
Gary Tierney
2019-07-18 02:44:35 +01:00
parent fe457d762a
commit 0b61e559fc
13 changed files with 321 additions and 27 deletions
+13
View File
@@ -0,0 +1,13 @@
apply plugin: "java"
apply plugin: 'kotlin'
apply from: "$rootDir/gradle/kotlin.gradle"
repositories {
jcenter()
}
dependencies {
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
compile 'org.jetbrains.dokka:dokka-fatjar:0.9.18'
}
@@ -0,0 +1,19 @@
package org.apollo.tools.dokka2yaml
import com.google.inject.Binder
import org.jetbrains.dokka.FormatService
import org.jetbrains.dokka.Formats.FormatDescriptor
import org.jetbrains.dokka.Formats.KotlinFormatDescriptorBase
import kotlin.reflect.KClass
class YamlFileFormatDescriptor : KotlinFormatDescriptorBase() {
override val formatServiceClass = YamlFileGenerator::class
override fun configureAnalysis(binder: Binder) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun configureOutput(binder: Binder) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,24 @@
package org.apollo.tools.dokka2yaml
import org.jetbrains.dokka.DocumentationNode
import org.jetbrains.dokka.FormatService
import org.jetbrains.dokka.FormattedOutputBuilder
import org.jetbrains.dokka.Location
class YamlFileGenerator(override val extension: String = ".yaml") : FormatService {
override fun createOutputBuilder(to: StringBuilder, location: Location): FormattedOutputBuilder {
return YamlFileOutputBuilder()
}
}
class YamlFileOutputBuilder : FormattedOutputBuilder {
override fun appendNodes(nodes: Iterable<DocumentationNode>) {
for (node in nodes) {
appendNode(node)
}
}
fun appendNode(node: DocumentationNode) {
}
}
@@ -0,0 +1,2 @@
class=org.apollo.tools.dokka2yaml.YamlFileFormatDescriptor
description=Turns KDoc and Javadoc into the code2yaml format for DocFX.