diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-24 11:33:17 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-24 11:40:16 +0100 |
commit | bfd615dde13ef6ebbfaca6b042f263a57c11018c (patch) | |
tree | 10f91003d6bee78c236ae86b4671864a591689f7 /core/src/main/kotlin | |
parent | edb0d90fbc44f611d806a06a12f1d8280e274b8e (diff) | |
download | dokka-bfd615dde13ef6ebbfaca6b042f263a57c11018c.tar.gz dokka-bfd615dde13ef6ebbfaca6b042f263a57c11018c.tar.bz2 dokka-bfd615dde13ef6ebbfaca6b042f263a57c11018c.zip |
Option to skip declarations in root package from generated documentation (they can't be imported anyway)
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/DokkaBootstrapImpl.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/Generation/DokkaGenerator.kt | 8 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index 5f3fc7b3..8038089f 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -42,6 +42,7 @@ class DokkaBootstrapImpl : DokkaBootstrap { outputDir: String, format: String, includeNonPublic: Boolean, + includeRootPackage: Boolean, reportUndocumented: Boolean, skipEmptyPackages: Boolean, skipDeprecated: Boolean, @@ -59,6 +60,7 @@ class DokkaBootstrapImpl : DokkaBootstrap { outputDir, format, includeNonPublic, + includeRootPackage, reportUndocumented, skipEmptyPackages, skipDeprecated, diff --git a/core/src/main/kotlin/Generation/DokkaGenerator.kt b/core/src/main/kotlin/Generation/DokkaGenerator.kt index 2c1cdb03..b7163a5c 100644 --- a/core/src/main/kotlin/Generation/DokkaGenerator.kt +++ b/core/src/main/kotlin/Generation/DokkaGenerator.kt @@ -148,9 +148,11 @@ fun buildDocumentationModule(injector: Injector, for (include in includes) { packageDocs.parse(include, fragments.firstOrNull()) } - documentationModule.updateContent { - for (node in packageDocs.moduleContent.children) { - append(node) + if (documentationModule.content.isEmpty()) { + documentationModule.updateContent { + for (node in packageDocs.moduleContent.children) { + append(node) + } } } diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 10b5c598..4974b765 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -33,6 +33,7 @@ import com.google.inject.name.Named as GuiceNamed data class DocumentationOptions(val outputDir: String, val outputFormat: String, val includeNonPublic: Boolean = false, + val includeRootPackage: Boolean = false, val reportUndocumented: Boolean = true, val skipEmptyPackages: Boolean = true, val skipDeprecated: Boolean = false, @@ -337,6 +338,7 @@ class DocumentationBuilder val allFqNames = fragments.map { it.fqName }.distinct() for (packageName in allFqNames) { + if (packageName.isRoot && !options.includeRootPackage) continue val declarations = fragments.filter { it.fqName == packageName }.flatMap { it.getMemberScope().getContributedDescriptors() } if (options.skipEmptyPackages && declarations.none { it.isDocumented(options) }) continue |