aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-30 20:34:25 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-30 20:34:25 +0300
commit1b722f7c61ea3405b8f33612044b28f0b4087406 (patch)
treedc8321a2f7dbd4a3084ced461b5768ed75a79d7b /core/src
parentf3db3f313c599b84b1a9810723c6a503c0baf7a9 (diff)
downloaddokka-1b722f7c61ea3405b8f33612044b28f0b4087406.tar.gz
dokka-1b722f7c61ea3405b8f33612044b28f0b4087406.tar.bz2
dokka-1b722f7c61ea3405b8f33612044b28f0b4087406.zip
WIP
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt53
-rw-r--r--core/src/main/resources/dokka/format/java-layout-html.properties2
2 files changed, 44 insertions, 11 deletions
diff --git a/core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt b/core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt
index c023c477..832c466e 100644
--- a/core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt
+++ b/core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt
@@ -1,7 +1,11 @@
-package org.jetbrains.dokka.formats
+package org.jetbrains.dokka.Formats
+import com.google.inject.Inject
+import kotlinx.html.li
+import kotlinx.html.stream.appendHTML
+import kotlinx.html.ul
import org.jetbrains.dokka.*
-import org.jetbrains.dokka.Formats.KotlinFormatDescriptorBase
+import java.io.File
class JavaLayoutHtmlFormatDescriptor : KotlinFormatDescriptorBase() {
@@ -22,24 +26,53 @@ class JavaLayoutHtmlFormatService : FormatService {
class JavaLayoutHtmlFormatOutputBuilder : FormattedOutputBuilder {
override fun appendNodes(nodes: Iterable<DocumentationNode>) {
- TODO("not implemented")
+
+ }
+}
+
+
+class JavaLayoutHtmlFormatNavListBuilder @Inject constructor(private val locationService: LocationService) : OutlineFormatService {
+ override fun getOutlineFileName(location: Location): File {
+ TODO()
+ }
+
+ override fun appendOutlineHeader(location: Location, node: DocumentationNode, to: StringBuilder) {
+ with(to.appendHTML()) {
+ //a(href = )
+ li {
+ when {
+ node.kind == NodeKind.Package -> appendOutline(location, to, node.members)
+ }
+ }
+ }
+ }
+
+ override fun appendOutlineLevel(to: StringBuilder, body: () -> Unit) {
+ with(to.appendHTML()) {
+ ul { body() }
+ }
}
+
}
-class JavaLayoutHtmlFormatGenerator : Generator {
+class JavaLayoutHtmlFormatGenerator @Inject constructor(
+ private val outlineFormatService: OutlineFormatService
+) : Generator {
override fun buildPages(nodes: Iterable<DocumentationNode>) {
- TODO("not implemented")
+
}
override fun buildOutlines(nodes: Iterable<DocumentationNode>) {
- TODO("not implemented")
+ for (node in nodes) {
+ if (node.kind == NodeKind.Module) {
+ //outlineFormatService.formatOutline()
+ }
+ }
}
- override fun buildSupportFiles() {
- TODO("not implemented")
- }
+ override fun buildSupportFiles() {}
override fun buildPackageList(nodes: Iterable<DocumentationNode>) {
- TODO("not implemented")
+
}
} \ No newline at end of file
diff --git a/core/src/main/resources/dokka/format/java-layout-html.properties b/core/src/main/resources/dokka/format/java-layout-html.properties
index c5c6bb15..fbb2bbed 100644
--- a/core/src/main/resources/dokka/format/java-layout-html.properties
+++ b/core/src/main/resources/dokka/format/java-layout-html.properties
@@ -1,2 +1,2 @@
-class=org.jetbrains.dokka.formats.JavaLayoutHtmlFormatDescriptor
+class=org.jetbrains.dokka.Formats.JavaLayoutHtmlFormatDescriptor
description=Produces Kotlin Style Docs with Javadoc like layout \ No newline at end of file