package org.jetbrains.dokka.renderers import org.jetbrains.dokka.pages.ContentLink import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.resolvers.LocationProvider open class HtmlRenderer(outputDir: String, fileWriter: FileWriter, locationProvider: LocationProvider): DefaultRenderer(outputDir, fileWriter, locationProvider) { override fun buildComment(parts: List): String = "

${super.buildComment(parts)}

" override fun buildSymbol(parts: List): String = "${super.buildSymbol(parts)}" override fun buildHeader(level: Int, text: String): String = "$text\n" override fun buildNewLine(): String = "
" override fun buildLink(text: String, address: String): String = "$text" override fun buildCode(code: String): String = "$code" override fun buildNavigation(): String = "" // TODO implement override fun buildGroup(children: List): String = "\n" + "" + children.find { it is ContentLink }?.build() + "\n" + "" + children.filterNot { it is ContentLink }.joinToString("\n") { it.build() } + "\n" + "\n" override fun buildBlock(name: String, content: List): String = buildHeader(2, name) + "\n" + content.joinToString("\n") { it.build() } + "
" override fun renderPage(page: PageNode) { val pageText = buildStartHtml(page) + buildPageContent(page) + buildEndHtml() fileWriter.write(locationProvider.resolve(page), pageText) } protected open fun buildStartHtml(page: PageNode) = """ | | |${page.name} | | |""".trimMargin() protected open fun buildEndHtml() = """ | | | """.trimMargin() }