Browse Source

upgrade to bootstrap v5

main 0.0.3
James Fenn 1 month ago
parent
commit
7bd8ea42f0
1 changed files with 19 additions and 15 deletions
  1. +19
    -15
      docs/src/me/jfenn/ktordocs/HtmlBuilder.kt

+ 19
- 15
docs/src/me/jfenn/ktordocs/HtmlBuilder.kt View File

@@ -68,11 +68,11 @@ class HtmlBuilder(
a(href = "#" + endpoint.id) { +endpoint.title }
}
if (endpoint.auth.isNotEmpty()) {
span("float-right") {
span("float-end") {
endpoint.auth.forEach {
button(type = ButtonType.button, classes = "btn btn-link text-monospace") {
attributes["data-toggle"] = "modal"
attributes["data-target"] = "#auth_${it}"
attributes["data-bs-toggle"] = "modal"
attributes["data-bs-target"] = "#auth_${it}"

+it
}
@@ -89,7 +89,7 @@ class HtmlBuilder(
}
}
div("alert bg-light") {
span("mr-3 badge badge-" + when (endpoint.method) {
span("me-3 badge bg-" + when (endpoint.method) {
HttpMethod.Get -> "primary"
HttpMethod.Post -> "success"
HttpMethod.Put -> "warning"
@@ -164,15 +164,19 @@ class HtmlBuilder(
appendHTML().html {
head {
meta(charset = "utf-8")
meta(name = "viewport", content = "width=device-width,initial-scale=1")
title(docs.config.title)

link(
href = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.1/css/bootstrap.min.css",
rel = "stylesheet"
)
rel = "stylesheet",
href = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
) {
attributes["integrity"] = "sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
attributes["crossorigin"] = "anonymous"
}

style {
+"table {font-size:0.8rem;display:inline-block;max-width:100%;overflow-x:auto;}.bg-dark a {color:#b1d4fb !important;}"
+"a:not(:hover){text-decoration:none;}table{font-size:0.8rem;display:inline-block;max-width:100%;overflow-x:auto;}.bg-dark a{color:#b1d4fb !important;}"
}
}
body {
@@ -208,7 +212,7 @@ class HtmlBuilder(
+"Documentation generated by "
a(href = "https://code.horrific.dev/james/ktordocs") { +"Ktor-Docs" }
}
a(classes = "text-muted float-right", href = "https://www.mozilla.org/en-US/MPL/2.0/") {
a(classes = "text-muted float-end", href = "https://www.mozilla.org/en-US/MPL/2.0/") {
+"MPL v2.0"
}
}
@@ -229,9 +233,10 @@ class HtmlBuilder(
}
}

script(src = "https://code.jquery.com/jquery-3.5.1.slim.min.js") {}
script(src = "https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js") {}
script(src = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js") {}
script(src = "https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js") {
attributes["integrity"] = "sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"
attributes["crossorigin"] = "anonymous"
}
}
}
appendln()
@@ -247,9 +252,8 @@ fun FlowContent.modal(modalId: String, modalTitle: String, content: DIV.() -> Un
div("modal-content") {
div("modal-header") {
h5("modal-title") { +modalTitle }
button(type = ButtonType.button, classes = "close") {
attributes["data-dismiss"] = "modal"
unsafe { +"×" }
button(type = ButtonType.button, classes = "btn-close") {
attributes["data-bs-dismiss"] = "modal"
}
}
div("modal-body") {


Loading…
Cancel
Save