|
1 | 1 | import kotlinx.html.*
|
2 | 2 | import kotlinx.html.stream.createHTML
|
| 3 | +import org.jetbrains.dokka.base.DokkaBase |
| 4 | +import org.jetbrains.dokka.base.DokkaBaseConfiguration |
3 | 5 |
|
4 | 6 | buildscript {
|
5 | 7 | dependencies {
|
@@ -113,16 +115,50 @@ val docsDir = buildDir.resolve("dokka")
|
113 | 115 |
|
114 | 116 | tasks.dokkaHtmlMultiModule {
|
115 | 117 | 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 | + } |
116 | 123 | doLast {
|
117 | 124 | 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 | + +"." |
119 | 154 | }
|
120 | 155 | }
|
121 | 156 |
|
122 | 157 | fun createDocsIndexPage(): String {
|
123 | 158 | return createHTML().html {
|
124 | 159 | head {
|
125 | 160 | link(href = "./$version/styles/style.css", rel = "Stylesheet")
|
| 161 | + link(href = "./$version/styles/logo-styles.css", rel = "Stylesheet") |
126 | 162 | title("modelix.core API Reference")
|
127 | 163 | style {
|
128 | 164 | unsafe {
|
@@ -179,6 +215,16 @@ fun createDocsIndexPage(): String {
|
179 | 215 | }
|
180 | 216 | }
|
181 | 217 | }
|
| 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 | + } |
182 | 228 | }
|
183 | 229 | }
|
184 | 230 | }
|
|
0 commit comments