diff options
Diffstat (limited to 'core/src/main/kotlin')
3 files changed, 6 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) |