diff options
| author | Kamil Doległo <kamilok1965@interia.pl> | 2020-03-11 17:56:57 +0100 |
|---|---|---|
| committer | Kamil Doległo <kamilok1965@users.noreply.github.com> | 2020-03-11 18:28:28 +0100 |
| commit | 3d91ed1ff162d4a682ce2d6566db51c6af9249bd (patch) | |
| tree | f771f9518cdbfcfac21e4f8ce8f19de3aebb2880 /plugins/base/src/main/kotlin/renderers | |
| parent | 8e4ffa367b43cdc57c3921fab2182a4209913a51 (diff) | |
| download | dokka-3d91ed1ff162d4a682ce2d6566db51c6af9249bd.tar.gz dokka-3d91ed1ff162d4a682ce2d6566db51c6af9249bd.tar.bz2 dokka-3d91ed1ff162d4a682ce2d6566db51c6af9249bd.zip | |
Many UI changes for styling
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers')
| -rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index a2a31340..07de6867 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -30,6 +30,7 @@ open class HtmlRenderer( ) { val additionalClasses = node.style.joinToString { it.toString().toLowerCase() } return when { + node.dci.kind == ContentKind.Symbol -> div("symbol $additionalClasses") { childrenCallback() } node.dci.kind == ContentKind.BriefComment -> div("brief $additionalClasses") { childrenCallback() } node.style.contains(TextStyle.Paragraph) -> p(additionalClasses) { childrenCallback() } node.style.contains(TextStyle.Block) -> div(additionalClasses) { childrenCallback() } @@ -214,13 +215,17 @@ open class HtmlRenderer( override fun buildPage(page: ContentPage, content: (FlowContent, ContentPage) -> Unit): String = buildHtml(page, page.embeddedResources) { - attributes["pageIds"] = page.dri.toList()[0].toString() - content(this, page) + div { + id = "content" + attributes["pageIds"] = page.dri.first().toString() + content(this, page) + } } open fun buildHtml(page: PageNode, resources: List<String>, content: FlowContent.() -> Unit) = createHTML().html { head { + meta(name = "viewport", content = "width=device-width, initial-scale=1") title(page.name) with(resources) { filter { it.substringBefore('?').substringAfterLast('.') == "css" } @@ -232,23 +237,23 @@ open class HtmlRenderer( } body { div { - id = "navigation" + id = "container" div { - id = "searchBar" - form(action = page.root("-search.html"), method = FormMethod.get) { - id = "searchForm" - input(type = InputType.search, name = "query") - input(type = InputType.submit) { value = "Search" } - } + id = "sideMenu" } div { - id = "sideMenu" + id = "main" + div { + id = "searchBar" + form(action = page.root("-search.html"), method = FormMethod.get) { + id = "searchForm" + input(type = InputType.search, name = "query") + input(type = InputType.submit) { value = "Search" } + } + } + content() } } - div { - id = "content" - content() - } } } } |
