kotter
kotter copied to clipboard
Consider opening up `link(uri, block)`
Currently, we have implemented a method for creating OSC links with the following signature:
fun RenderScope.link(uri: URI, block: RenderScope.() -> Unit) { ... }
which you could call like:
link("https://example.com") {
text("click here")
}
but opening up this generic API feels like room for problems to sneak in:
link(...) {
link(...) { uh oh }
}
and does it makes sense to add underlines, clear underlines, change colors, etc. inside links?
So, for now, we've marked it an non-public.
We're only exposing the more constrained version:
fun RenderScope.link(uri: URI, displayText: String)
which you can call like:
link("https://example.com", "click here")
even if it, internally, delegates to the more general API.
I think the constrained version is all that people will ever really need, but I'll keep this bug open in case users have good reasons to want to use the general one.