com.github.woojiahao.style.elements.code.CodeBlock.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kMD2PDF Show documentation
Show all versions of kMD2PDF Show documentation
Simple and highly customizable markdown to PDF conversion library
package com.github.woojiahao.style.elements.code
import com.github.woojiahao.style.css.cssSelector
import com.github.woojiahao.style.utility.Box
import com.github.woojiahao.style.utility.px
class CodeBlock : Code("pre") {
init {
padding = Box(10.0.px)
}
override fun toCss(): String {
css += cssSelector("pre > code") {
attributes {
"font-family" to fontFamily
}
}
css += cssSelector("pre") {
attributes {
"white-space" to "pre-wrap"
}
}
return super.toCss()
}
}