100 height for demos

This commit is contained in:
2025-02-14 19:33:38 +03:00
parent 858b7d7b25
commit bb7361d97e
2 changed files with 15 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import io.ktor.server.cio.CIO
import io.ktor.server.engine.embeddedServer
import io.ktor.server.http.content.staticResources
import io.ktor.server.routing.routing
import kotlinx.html.unsafe
import space.kscience.dataforge.context.Context
import space.kscience.plotly.PlotlyPlugin
import space.kscience.visionforge.html.*
@@ -41,6 +42,11 @@ public fun makeVisionFile(
resourceLocation,
actualPath
),
"playground-style" to VisionPage.styleHeader {
unsafe {
+".visionforge-output { height:100vh; }"
}
}
)
}
if (show) Desktop.getDesktop().browse(actualPath.toFile().toURI())

View File

@@ -36,6 +36,15 @@ public data class VisionPage(
}
}
/**
* Inject a simple style header
*/
public fun styleHeader(block: STYLE.() -> Unit): HtmlFragment = HtmlFragment {
style {
block()
}
}
public fun title(title: String): HtmlFragment = HtmlFragment {
title(title)
}