All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.jupyter.htmlUtil.kt Maven / Gradle / Ivy

package org.jetbrains.kotlinx.jupyter

import org.jetbrains.kotlinx.jupyter.api.VariableState

const val varsTableStyleClass = "variables_table"

fun generateHTMLVarsReport(variablesState: Map): String {
    return buildString {
        append(generateStyleSection())
        if (variablesState.isEmpty()) {
            append("

Variables State's Empty

\n") return toString() } append("

Variables State

\n") append(generateVarsTable(variablesState)) } } fun generateStyleSection(borderPx: Int = 1, paddingPx: Int = 5): String { //language=HTML val styleSection = """ """.trimIndent() return styleSection } fun generateVarsTable(variablesState: Map): String { return buildString { append( """ """.trimIndent() ) variablesState.entries.forEach { append( """ """.trimIndent() ) } append("\n
Variable Value
${it.key} ${it.value.stringValue}
\n") } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy