aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-03-11 17:56:57 +0100
committerKamil Doległo <kamilok1965@users.noreply.github.com>2020-03-11 18:28:28 +0100
commit3d91ed1ff162d4a682ce2d6566db51c6af9249bd (patch)
treef771f9518cdbfcfac21e4f8ce8f19de3aebb2880 /plugins/base
parent8e4ffa367b43cdc57c3921fab2182a4209913a51 (diff)
downloaddokka-3d91ed1ff162d4a682ce2d6566db51c6af9249bd.tar.gz
dokka-3d91ed1ff162d4a682ce2d6566db51c6af9249bd.tar.bz2
dokka-3d91ed1ff162d4a682ce2d6566db51c6af9249bd.zip
Many UI changes for styling
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt33
-rw-r--r--plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt18
3 files changed, 32 insertions, 21 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()
- }
}
}
}
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
index 3c4698fe..98394872 100644
--- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
+++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
@@ -77,7 +77,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
}
}
- private fun signature(t: TypeParameter) = contentBuilder.contentFor(t, ContentKind.Symbol, setOf(TextStyle.Monospace)) {
+ private fun signature(t: TypeParameter) = contentBuilder.contentFor(t, ContentKind.Main) {
link(t.name, t.dri)
list(t.bounds, prefix = " : ") {
signatureForProjection(it)
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index 1f7f0b01..401802eb 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -61,8 +61,9 @@ open class DefaultPageCreator(
block("Types", 2, ContentKind.Classlikes, s.classlikes, platformData.toSet()) {
link(it.name.orEmpty(), it.dri)
group {
- +buildSignature(it)
- breakLine()
+ group(kind = ContentKind.Symbol) {
+ +buildSignature(it)
+ }
group(kind = ContentKind.BriefComment) {
text(it.briefDocumentation())
}
@@ -71,8 +72,9 @@ open class DefaultPageCreator(
block("Functions", 2, ContentKind.Functions, s.functions, platformData.toSet()) {
link(it.name, it.dri)
group {
- +buildSignature(it)
- breakLine()
+ group(kind = ContentKind.Symbol) {
+ +buildSignature(it)
+ }
group(kind = ContentKind.BriefComment) {
text(it.briefDocumentation())
}
@@ -89,14 +91,18 @@ open class DefaultPageCreator(
protected open fun contentForClasslike(c: Classlike) = contentBuilder.contentFor(c) {
header(1) { text(c.name.orEmpty()) }
- +buildSignature(c)
+ group(kind = ContentKind.Symbol) {
+ +buildSignature(c)
+ }
+contentForComments(c) { it !is Property }
if (c is WithConstructors) {
block("Constructors", 2, ContentKind.Constructors, c.constructors, c.platformData.toSet()) {
link(it.name, it.dri)
group {
- +buildSignature(it)
+ group(kind = ContentKind.Symbol) {
+ +buildSignature(it)
+ }
group(kind = ContentKind.BriefComment) {
text(it.briefDocumentation())
}