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

Custom "stringify" for worksheets #71

Open
kubukoz opened this issue Jan 25, 2020 · 0 comments
Open

Custom "stringify" for worksheets #71

kubukoz opened this issue Jan 25, 2020 · 0 comments

Comments

@kubukoz
Copy link

kubukoz commented Jan 25, 2020

Is your feature request related to a problem? Please describe.

It would be nice to have a custom way of showing certain values, especially those that involve effects or streaming, e.g. for a cats.effect.IO you might want to display the value of theIO.timeout(5.seconds).unsafeRunSync().

Describe the solution you'd like
Some way of customizing the behavior responsible for displaying values in worksheets. It would probably have to be supported in mdoc itself.

Something like a Show-like typeclass defaulting to toString that we'd be able to override e.g. by importing an instance in a project-wide, or global, ~/.mdoc/predef.scala file.

Describe alternatives you've considered
Currently, the best alternative is adding an extension method that does the job, but it'd be nice to not have to do that for every value of a given type.

Additional context

Search terms:
show, toString, stringify, worksheet, display, custom, effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant