Current scope: kotmark-renderer-kotlinx-html| all classes
|
io.heapy.kotmark.renderer.kotlinxhtml.adapters
Coverage Summary for Class: TaskListItemsAdapterKt (io.heapy.kotmark.renderer.kotlinxhtml.adapters)
| Class | Method, % | Branch, % | Line, % | Instruction, % |
|---|---|---|---|---|
| TaskListItemsAdapterKt | 100% (3/3) | 100% (2/2) | 100% (7/7) | 100% (5/5) |
| TaskListItemsAdapterKt$taskListItemsAdapter$lambda$0$$inlined$nodeRenderer$1 | 0% (0/1) | |||
| TaskListItemsAdapterKt$taskListItemsAdapter$lambda$0$$inlined$nodeRenderer$1$1 | 0% (0/2) | |||
| Total | 50% (3/6) | 100% (2/2) | 100% (7/7) | 100% (5/5) |
package io.heapy.kotmark.renderer.kotlinxhtml.adapters
import io.heapy.kotmark.ext.task.list.items.TaskListItemMarker
import io.heapy.kotmark.renderer.kotlinxhtml.KotlinxHtmlAdapter
import io.heapy.kotmark.renderer.kotlinxhtml.nodeRenderer
fun taskListItemsAdapter(): KotlinxHtmlAdapter = KotlinxHtmlAdapter { configuration ->
configuration.nodeRenderer<TaskListItemMarker> { marker ->
val attributes = linkedMapOf("type" to "checkbox", "disabled" to "")
if (marker.isChecked) attributes["checked"] = ""
element(marker, "input", attributes)
text(" ")
}
}