aboutsummaryrefslogtreecommitdiff
path: root/javadoc/src/main/kotlin/dokka-adapters.kt
diff options
context:
space:
mode:
Diffstat (limited to 'javadoc/src/main/kotlin/dokka-adapters.kt')
-rw-r--r--javadoc/src/main/kotlin/dokka-adapters.kt29
1 files changed, 29 insertions, 0 deletions
diff --git a/javadoc/src/main/kotlin/dokka-adapters.kt b/javadoc/src/main/kotlin/dokka-adapters.kt
new file mode 100644
index 00000000..c9183d50
--- /dev/null
+++ b/javadoc/src/main/kotlin/dokka-adapters.kt
@@ -0,0 +1,29 @@
+package org.jetbrains.dokka.javadoc
+
+import com.sun.tools.doclets.formats.html.HtmlDoclet
+import org.jetbrains.dokka.*
+import org.jetbrains.dokka.Formats.FormatDescriptor
+
+class JavadocGenerator(val conf: DokkaGenerator) : Generator {
+ override fun buildPages(nodes: Iterable<DocumentationNode>) {
+ val module = nodes.single() as DocumentationModule
+
+ DokkaConsoleLogger.report()
+ HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter, conf.outputDir))
+ }
+
+ override fun buildOutlines(nodes: Iterable<DocumentationNode>) {
+ // no outline could be generated separately
+ }
+}
+
+class JavadocFormatDescriptor : FormatDescriptor {
+ override val formatServiceClass: Class<out FormatService>?
+ get() = null
+ override val outlineServiceClass: Class<out OutlineFormatService>?
+ get() = null
+
+ override val generatorServiceClass: Class<out Generator>
+ get() = javaClass<JavadocGenerator>()
+}
+