aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-28 21:23:27 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-07-13 18:29:39 +0300
commit87705bf24f6f7e541dbdb14c44e00d0b90a81f37 (patch)
treeb70a3982985b9b696ed60a3925e2ef0f4f141fb9 /core/src
parent93ce43340730111df977921e62cae93c2bcc4a5b (diff)
downloaddokka-87705bf24f6f7e541dbdb14c44e00d0b90a81f37.tar.gz
dokka-87705bf24f6f7e541dbdb14c44e00d0b90a81f37.tar.bz2
dokka-87705bf24f6f7e541dbdb14c44e00d0b90a81f37.zip
[backport] Add package list support for JLH
Original: 4256adf
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt b/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt
new file mode 100644
index 00000000..398758f2
--- /dev/null
+++ b/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt
@@ -0,0 +1,28 @@
+package org.jetbrains.dokka.Formats
+
+import org.jetbrains.dokka.DocumentationModule
+import org.jetbrains.dokka.ExternalDocumentationLinkResolver.Companion.DOKKA_PARAM_PREFIX
+import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.PackageListService
+
+class JavaLayoutHtmlPackageListService: PackageListService {
+
+ private fun StringBuilder.appendParam(name: String, value: String) {
+ append(DOKKA_PARAM_PREFIX)
+ append(name)
+ append(":")
+ appendln(value)
+ }
+
+ override fun formatPackageList(module: DocumentationModule): String {
+ val packages = module.members(NodeKind.Package).map { it.name }
+
+ return buildString {
+ appendParam("format", "java-layout-html")
+ for (p in packages) {
+ appendln(p)
+ }
+ }
+ }
+
+} \ No newline at end of file