diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/renderers/HtmlRenderer.kt | 8 | ||||
-rw-r--r-- | core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/core/src/main/kotlin/renderers/HtmlRenderer.kt b/core/src/main/kotlin/renderers/HtmlRenderer.kt index adc3dd5a..f750140a 100644 --- a/core/src/main/kotlin/renderers/HtmlRenderer.kt +++ b/core/src/main/kotlin/renderers/HtmlRenderer.kt @@ -35,21 +35,23 @@ open class HtmlRenderer(fileWriter: FileWriter, locationProvider: LocationProvid |</tr> |</thead>""".trimMargin() - return """<table>``` + return """<table> |$tableHeader |<tbody> |<tr> - |<td>${node.children.joinToString("<td>\n</tr>\n<tr>\n<td>") { it.build(pageContext) }}</td> + |<td>${node.children.joinToString("</td>\n</tr>\n<tr>\n<td>\n") { it.buildTableRow(pageContext) }}</td> |</tr> |</tbody> |</table>""".trimMargin() } + protected open fun ContentGroup.buildTableRow(pageContext: PageNode) = children.joinToString("</td>\n<td>\n") { it.build(pageContext) } + override fun buildHeader(level: Int, text: String): String = "<h$level>$text</h$level>\n" override fun buildNewLine(): String = "<br/>" - override fun buildLink(text: String, address: String): String = "<a href=\"$address\">${text.htmlEscape()}</a>" + override fun buildLink(text: String, address: String): String = "<a href=\"$address\">$text</a>" override fun buildCode(code: List<ContentNode>, language: String, pageContext: PageNode): String = "<code>$code</code>" diff --git a/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt b/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt index 3f3cb7a2..6cfcec56 100644 --- a/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt +++ b/core/src/main/kotlin/transformers/DefaultDocumentationToPageTransformer.kt @@ -131,10 +131,9 @@ class DefaultDocumentationToPageTransformer( ) { header(level) { text(name) } - contents += ContentGroup( - elements.map { - group(it, kind) { operation(it) } - }, + contents += ContentTable( + emptyList(), + elements.map { group(it, kind) { operation(it) } }, DCI(node.dri, kind), platformData, styles, extras ) |