Skip to content

Commit 7b52ea0

Browse files
committed
feat: improved styling of the api docs index page
1 parent 5192f5c commit 7b52ea0

File tree

1 file changed

+46
-30
lines changed

1 file changed

+46
-30
lines changed

build.gradle.kts

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -122,43 +122,59 @@ tasks.dokkaHtmlMultiModule {
122122
fun createDocsIndexPage(): String {
123123
return createHTML().html {
124124
head {
125+
link(href = "./$version/styles/style.css", rel = "Stylesheet")
126+
title("modelix.core API Reference")
125127
style {
126-
+"""
127-
body {
128-
font-family: sans-serif;
129-
}
130-
131-
ul {
132-
list-style-type: none;
133-
}
134-
.wrapper {
135-
margin: auto;
136-
width: 50%;
137-
border: 1px solid;
138-
border-radius: 15px;
139-
padding: 20px;
140-
text-align: center;
128+
unsafe {
129+
+"""
130+
.library-name {
131+
padding-top: 6px;
132+
padding-bottom: 6px;
133+
}
134+
""".trimIndent()
141135
}
142-
""".trimIndent()
143136
}
144137
}
145138
body {
146-
header {
147-
h1 { +"Modelix Core API Reference" }
139+
div("navigation-wrapper") {
140+
id = "navigation-wrapper"
141+
div("library-name") {
142+
a { +"modelix.core API Reference" }
143+
}
148144
}
149145
div("wrapper") {
150-
151-
ul {
152-
val versionDirs = docsDir.listFiles()
153-
?.filter { it.isDirectory }
154-
?.sortedByDescending { it.name }
155-
?: return@ul
156-
for (versionDir in versionDirs) {
157-
val versionIndex = versionDir.resolve("index.html")
158-
if (versionIndex.exists()) {
159-
li {
160-
a(href = versionIndex.relativeTo(docsDir).path) {
161-
+"modelix.core ${versionDir.name}"
146+
id = "container"
147+
div {
148+
id ="leftColumn"
149+
}
150+
div {
151+
id = "main"
152+
div("main-content") {
153+
id ="content"
154+
div("breadcrumbs")
155+
div("cover") {
156+
h2 { +"Available versions:" }
157+
div("table") {
158+
val versionDirs = docsDir.listFiles()
159+
?.filter { it.isDirectory }
160+
?.sortedByDescending { it.name }
161+
if (versionDirs != null) {
162+
for (versionDir in versionDirs) {
163+
val versionIndex = versionDir.resolve("index.html")
164+
if (versionIndex.exists()) {
165+
div("table-row") {
166+
div("main-subrow") {
167+
div("w-100") {
168+
span("inline-flex") {
169+
a( href = versionIndex.relativeTo(docsDir).path) {
170+
+"modelix.core ${versionDir.name}"
171+
}
172+
}
173+
}
174+
}
175+
}
176+
}
177+
}
162178
}
163179
}
164180
}

0 commit comments

Comments
 (0)