Sergey Mashkov | e27fb69 | 2015-07-31 15:35:34 +0300 | [diff] [blame] | 1 | package org.jetbrains.dokka.javadoc |
| 2 | |
Dmitry Jemerov | e4b2ae9 | 2015-10-30 18:43:48 +0100 | [diff] [blame] | 3 | import com.google.inject.Inject |
Sergey Mashkov | e27fb69 | 2015-07-31 15:35:34 +0300 | [diff] [blame] | 4 | import com.sun.tools.doclets.formats.html.HtmlDoclet |
| 5 | import org.jetbrains.dokka.* |
| 6 | import org.jetbrains.dokka.Formats.FormatDescriptor |
Simon Ogorodnik | 875e7e5 | 2016-11-14 20:52:19 +0300 | [diff] [blame] | 7 | import org.jetbrains.dokka.Samples.DefaultSampleProcessingService |
Simon Ogorodnik | a86c859 | 2017-05-03 13:45:30 +0300 | [diff] [blame] | 8 | import kotlin.reflect.KClass |
Sergey Mashkov | e27fb69 | 2015-07-31 15:35:34 +0300 | [diff] [blame] | 9 | |
Simon Ogorodnik | a86c859 | 2017-05-03 13:45:30 +0300 | [diff] [blame] | 10 | class JavadocGenerator @Inject constructor(val options: DocumentationOptions, val logger: DokkaLogger) : Generator { |
| 11 | |
Sergey Mashkov | e27fb69 | 2015-07-31 15:35:34 +0300 | [diff] [blame] | 12 | override fun buildPages(nodes: Iterable<DocumentationNode>) { |
| 13 | val module = nodes.single() as DocumentationModule |
| 14 | |
| 15 | DokkaConsoleLogger.report() |
Dmitry Jemerov | 84ea5c6 | 2015-11-04 16:26:07 +0100 | [diff] [blame] | 16 | HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter(logger), options.outputDir)) |
Sergey Mashkov | e27fb69 | 2015-07-31 15:35:34 +0300 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | override fun buildOutlines(nodes: Iterable<DocumentationNode>) { |
| 20 | // no outline could be generated separately |
| 21 | } |
Dmitry Jemerov | 3963105 | 2015-12-03 16:22:11 +0100 | [diff] [blame] | 22 | |
| 23 | override fun buildSupportFiles() { |
| 24 | } |
Simon Ogorodnik | a86c859 | 2017-05-03 13:45:30 +0300 | [diff] [blame] | 25 | |
| 26 | override fun buildPackageList(nodes: Iterable<DocumentationNode>) { |
| 27 | // handled by javadoc itself |
| 28 | } |
Sergey Mashkov | e27fb69 | 2015-07-31 15:35:34 +0300 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | class JavadocFormatDescriptor : FormatDescriptor { |
Dmitry Jemerov | 84ea5c6 | 2015-11-04 16:26:07 +0100 | [diff] [blame] | 32 | override val formatServiceClass = null |
| 33 | override val outlineServiceClass = null |
| 34 | override val generatorServiceClass = JavadocGenerator::class |
| 35 | override val packageDocumentationBuilderClass = KotlinAsJavaDocumentationBuilder::class |
| 36 | override val javaDocumentationBuilderClass = JavaPsiDocumentationBuilder::class |
Simon Ogorodnik | 47790d1 | 2016-11-14 18:08:17 +0300 | [diff] [blame] | 37 | override val sampleProcessingService = DefaultSampleProcessingService::class |
Simon Ogorodnik | a86c859 | 2017-05-03 13:45:30 +0300 | [diff] [blame] | 38 | override val packageListServiceClass: KClass<out PackageListService>? = null |
Dmitry Jemerov | e4b2ae9 | 2015-10-30 18:43:48 +0100 | [diff] [blame] | 39 | } |