aboutsummaryrefslogtreecommitdiff
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
parentf3db3f313c599b84b1a9810723c6a503c0baf7a9 (diff)
downloaddokka-1b722f7c61ea3405b8f33612044b28f0b4087406.tar.gz
WIP
-rw-r--r--build.gradle1
-rw-r--r--core/build.gradle2
-rw-r--r--core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt53
-rw-r--r--core/src/main/resources/dokka/format/java-layout-html.properties2
4 files changed, 47 insertions, 11 deletions
diff --git a/build.gradle b/build.gradle
index 0002ee693..5772bc5d3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,6 +33,7 @@ allprojects {
maven { url 'https://jitpack.io' }
maven { url "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/$bundled_kotlin_compiler_version/maven" }
ivy(repo)
+ maven { url "https://dl.bintray.com/kotlin/kotlinx.html" }
}
}
diff --git a/core/build.gradle b/core/build.gradle
index a8f0f2753..d37b98b34 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -33,6 +33,8 @@ dependencies {
compile intellijCoreAnalysis()
+ compile 'org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.8'
+
//tools.jar
def toolsJar = files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") })
compileOnly toolsJar
diff --git a/core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt b/core/src/main/kotlin/Formats/JavaLayoutHtmlFormat.kt
index c023c477c..832c466ed 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 c5c6bb159..fbb2bbedc 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