Skip to content

Commit 1ceb511

Browse files
committed
feat: configured api ref footer message and logo
1 parent 7b52ea0 commit 1ceb511

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

build.gradle.kts

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import kotlinx.html.*
22
import kotlinx.html.stream.createHTML
3+
import org.jetbrains.dokka.base.DokkaBase
4+
import org.jetbrains.dokka.base.DokkaBaseConfiguration
35

46
buildscript {
57
dependencies {
@@ -113,16 +115,50 @@ val docsDir = buildDir.resolve("dokka")
113115

114116
tasks.dokkaHtmlMultiModule {
115117
outputDirectory.set(docsDir.resolve("$version"))
118+
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
119+
customAssets += file(projectDir.resolve("dokka/logo-dark.svg"))
120+
customStyleSheets += file(projectDir.resolve("dokka/logo-styles.css"))
121+
footerMessage = createFooterMessage()
122+
}
116123
doLast {
117124
val index = file(docsDir.resolve("index.html"))
118-
index.writeText(createDocsIndexPage())
125+
index.writeText(createDocsIndexPage(), Charsets.ISO_8859_1)
126+
}
127+
}
128+
129+
fun createFooterMessage(): String {
130+
return createHTML().span {
131+
createFooter()
132+
}
133+
}
134+
135+
fun FlowContent.createFooter() {
136+
p {
137+
+"For more information visit "
138+
a("https://modelix.org") { +"modelix.org" }
139+
+", for further documentation visit "
140+
a("https://docs.modelix.org") { +"docs.modelix.org" }
141+
+"."
142+
}
143+
p {
144+
+"Copyright \u00A9 2021-present by the "
145+
a("https://modelix.org") { +"modelix open source project" }
146+
+" and the individual contributors. All Rights reserved."
147+
}
148+
p {
149+
+"Except where otherwise noted, "
150+
a("https://api.modelix.org") {+"api.modelix.org"}
151+
+", modelix, and the modelix framework, are licensed under the "
152+
a("https://www.apache.org/licenses/LICENSE-2.0.html") { +"Apache-2.0 license"}
153+
+"."
119154
}
120155
}
121156

122157
fun createDocsIndexPage(): String {
123158
return createHTML().html {
124159
head {
125160
link(href = "./$version/styles/style.css", rel = "Stylesheet")
161+
link(href = "./$version/styles/logo-styles.css", rel = "Stylesheet")
126162
title("modelix.core API Reference")
127163
style {
128164
unsafe {
@@ -179,6 +215,16 @@ fun createDocsIndexPage(): String {
179215
}
180216
}
181217
}
218+
div("footer") {
219+
span("go-to-top-icon") {
220+
a("#content") {
221+
id = "go-to-top-link"
222+
}
223+
}
224+
span {
225+
createFooter()
226+
}
227+
}
182228
}
183229
}
184230
}

dokka/logo-dark.svg

Lines changed: 27 additions & 0 deletions
Loading

dokka/logo-styles.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.library-name a {
2+
position: relative;
3+
margin-left: 55px;
4+
}
5+
6+
.library-name a::before {
7+
content: '';
8+
background: url('../images/logo-dark.svg') center no-repeat;
9+
background-size: contain;
10+
position: absolute;
11+
width: 50px;
12+
height: 50px;
13+
top: -18px;
14+
left: -55px;
15+
}

0 commit comments

Comments
 (0)