MarkdownHandlers

abstract class MarkdownHandlers @Inject constructor(project: Project)(source)

Register custom handlers for various Markdown elements.

For example, if your project declares a fancy, custom horizontal rule, you can register it like so:

kobweb {
markdown {
handlers {
hr.set { "com.myproject.components.widgets.FancyRule()" }
}
}
}

Constructors

Link copied to clipboard
@Inject
constructor(project: Project)

Types

Link copied to clipboard
object DataKeys

Keys which can be used to read/write data values into/out of the NodeScope.data container.

Link copied to clipboard
class ImageData(val destination: String, val altText: String, val title: String?)

Data pulled out of an Image node into an easier-to-consume format.

Properties

Link copied to clipboard
abstract val a: Property<NodeScope.(Link) -> String>
Link copied to clipboard
abstract val blockquote: Property<NodeScope.(BlockQuote) -> String>
Link copied to clipboard
abstract val br: Property<NodeScope.(HardLineBreak) -> String>
Link copied to clipboard
abstract val code: Property<NodeScope.(FencedCodeBlock) -> String>
Link copied to clipboard
abstract val em: Property<NodeScope.(Emphasis) -> String>
Link copied to clipboard
@get:Input
abstract val generateHeaderIds: Property<Boolean>

If true, attach an auto-generated header ID to each header element.

Link copied to clipboard
abstract val heading: Property<NodeScope.(Heading) -> String>
Link copied to clipboard
abstract val hr: Property<NodeScope.(ThematicBreak) -> String>
Link copied to clipboard
abstract val html: Property<NodeScope.(HtmlBlock) -> String>
Link copied to clipboard
abstract val idGenerator: Property<(String) -> String>

Handler for converting some incoming text (fairly unconstrained) into a final string value that should be used as an ID for a URL fragment.

Link copied to clipboard
abstract val img: Property<NodeScope.(Image) -> String>
Link copied to clipboard
abstract val inlineCode: Property<NodeScope.(Code) -> String>
Link copied to clipboard
abstract val inlineTag: Property<NodeScope.(HtmlInline) -> String>
Link copied to clipboard
abstract val li: Property<NodeScope.(ListItem) -> String>
Link copied to clipboard
abstract val ol: Property<NodeScope.(OrderedList) -> String>
Link copied to clipboard
abstract val p: Property<NodeScope.(Paragraph) -> String>
Link copied to clipboard
abstract val rawTag: Property<NodeScope.(String) -> String>

Handler which is fed the raw text (name and attributes) within an opening tag, e.g. span id="demo"

Link copied to clipboard
abstract val strong: Property<NodeScope.(StrongEmphasis) -> String>
Link copied to clipboard
abstract val table: Property<NodeScope.(TableBlock) -> String>
Link copied to clipboard
abstract val tbody: Property<NodeScope.(TableBody) -> String>
Link copied to clipboard
abstract val td: Property<NodeScope.(TableCell) -> String>
Link copied to clipboard
abstract val text: Property<NodeScope.(Text) -> String>
Link copied to clipboard
abstract val th: Property<NodeScope.(TableCell) -> String>
Link copied to clipboard
abstract val thead: Property<NodeScope.(TableHead) -> String>
Link copied to clipboard
abstract val tr: Property<NodeScope.(TableRow) -> String>
Link copied to clipboard
abstract val ul: Property<NodeScope.(BulletList) -> String>
Link copied to clipboard
@get:Input
abstract val useSilk: Property<Boolean>

Use Silk components instead of Compose HTML components when relevant.

Functions

Link copied to clipboard

Helper function to process an Image node, passing information to a callback to generate the final output.