Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider opening up link(uri, block) #91

Open
bitspittle opened this issue Oct 21, 2022 · 0 comments
Open

Consider opening up link(uri, block) #91

bitspittle opened this issue Oct 21, 2022 · 0 comments
Labels
enhancement New feature / functionality maybe Not sure if we're going to do this issue or not

Comments

@bitspittle
Copy link
Contributor

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.

@bitspittle bitspittle added enhancement New feature / functionality maybe Not sure if we're going to do this issue or not labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature / functionality maybe Not sure if we're going to do this issue or not
Projects
None yet
Development

No branches or pull requests

1 participant