1 package org.jetbrains.dokka.javadoc 2 3 import com.google.inject.Binder 4 import com.google.inject.Inject 5 import com.sun.tools.doclets.formats.html.HtmlDoclet 6 import org.jetbrains.dokka.* 7 import org.jetbrains.dokka.Formats.* 8 import org.jetbrains.dokka.Utilities.bind 9 import org.jetbrains.dokka.Utilities.toType 10 11 class JavadocGenerator @Inject constructor(val options: DocumentationOptions, val logger: DokkaLogger) : Generator { 12 buildPagesnull13 override fun buildPages(nodes: Iterable<DocumentationNode>) { 14 val module = nodes.single() as DocumentationModule 15 16 HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter(logger), options.outputDir)) 17 } 18 buildOutlinesnull19 override fun buildOutlines(nodes: Iterable<DocumentationNode>) { 20 // no outline could be generated separately 21 } 22 buildSupportFilesnull23 override fun buildSupportFiles() { 24 } 25 buildPackageListnull26 override fun buildPackageList(nodes: Iterable<DocumentationNode>) { 27 // handled by javadoc itself 28 } 29 } 30 31 class JavadocFormatDescriptor : 32 FormatDescriptor, 33 DefaultAnalysisComponent, <lambda>null34 DefaultAnalysisComponentServices by KotlinAsJava { 35 36 override fun configureOutput(binder: Binder): Unit = with(binder) { 37 bind<Generator>() toType JavadocGenerator::class 38 } 39 } 40