aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-11-06 13:12:36 +0100
committerKamil Doległo <kamilok1965@interia.pl>2019-11-06 13:12:36 +0100
commit0dd2eeb3d8ec732ca23277e740157da445e82247 (patch)
treedb3613a86ce6ce160562b872221abe785454e673 /core
parent21573971ef5bd2ae37d4643d3d4dbf433cdcbbca (diff)
downloaddokka-0dd2eeb3d8ec732ca23277e740157da445e82247.tar.gz
dokka-0dd2eeb3d8ec732ca23277e740157da445e82247.tar.bz2
dokka-0dd2eeb3d8ec732ca23277e740157da445e82247.zip
A E S T H E T I C S 2
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/pages/MarkdownToContentConverter.kt2
-rw-r--r--core/src/main/kotlin/renderers/HtmlRenderer.kt2
-rw-r--r--core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt5
-rw-r--r--core/src/main/resources/dokka/styles/style.css4
4 files changed, 10 insertions, 3 deletions
diff --git a/core/src/main/kotlin/pages/MarkdownToContentConverter.kt b/core/src/main/kotlin/pages/MarkdownToContentConverter.kt
index 022826fa..24bfc6f4 100644
--- a/core/src/main/kotlin/pages/MarkdownToContentConverter.kt
+++ b/core/src/main/kotlin/pages/MarkdownToContentConverter.kt
@@ -127,7 +127,7 @@ class MarkdownToContentConverter(
// (processingList(nodeStack.peek()) && node.previous?.type == MarkdownTokenTypes.EOL)) {
// parent.append(ContentText(node.text))
// }
- emptyList()
+ listOf(ContentText(" ", dci))
}
MarkdownTokenTypes.CODE_LINE -> {
diff --git a/core/src/main/kotlin/renderers/HtmlRenderer.kt b/core/src/main/kotlin/renderers/HtmlRenderer.kt
index c8d2f619..e0b5b7dc 100644
--- a/core/src/main/kotlin/renderers/HtmlRenderer.kt
+++ b/core/src/main/kotlin/renderers/HtmlRenderer.kt
@@ -10,7 +10,7 @@ import java.io.InputStreamReader
open class HtmlRenderer(fileWriter: FileWriter, locationProvider: LocationProvider): DefaultRenderer(fileWriter, locationProvider) {
- override fun buildComment(parts: List<ContentNode>, pageContext: PageNode): String = "<p>${super.buildComment(parts, pageContext)}</p>"
+ override fun buildComment(parts: List<ContentNode>, pageContext: PageNode): String = "<p>" + parts.joinToString("<br>") { it.build(pageContext) } + "</p>"
override fun buildSymbol(parts: List<ContentNode>, pageContext: PageNode): String = "<code>${super.buildSymbol(parts, pageContext)}</code>"
diff --git a/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt b/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt
index 5e351d95..d7837ca2 100644
--- a/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt
+++ b/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt
@@ -72,7 +72,7 @@ class DefaultDocumentationToPageTransformer(
private fun contentForClass(c: Class) = content(DCI(c.dri, platformData)) {
header(1) { text(c.name) }
- c.rawDocstrings.forEach { markdown(it, c) }
+ c.rawDocstrings.forEach { comment(it, c) }
block("Constructors", c.constructors) {
link(it.name, it.dri)
signature(it)
@@ -145,6 +145,9 @@ class DefaultDocumentationToPageTransformer(
fun link(text: String, address: DRI) {
contents += ContentLink(text, address, dci)
}
+ fun comment(raw: String, node: DocumentationNode<*>) {
+ contents += ContentComment(markdownConverter.buildContent(parseMarkdown(raw), dci, node), dci)
+ }
fun markdown(raw: String, node: DocumentationNode<*>) {
contents += markdownConverter.buildContent(parseMarkdown(raw), dci, node)
diff --git a/core/src/main/resources/dokka/styles/style.css b/core/src/main/resources/dokka/styles/style.css
index 4253fc4c..60ea133f 100644
--- a/core/src/main/resources/dokka/styles/style.css
+++ b/core/src/main/resources/dokka/styles/style.css
@@ -15,6 +15,10 @@ table {
padding:5px;
}
+td:first-child {
+ width: 20vw;
+}
+
.keyword {
color:black;
font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;