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

ANSII/terminal colours #7

Open
Z-snails opened this issue Dec 21, 2022 · 2 comments
Open

ANSII/terminal colours #7

Z-snails opened this issue Dec 21, 2022 · 2 comments

Comments

@Z-snails
Copy link
Owner

I don't see why we couldn't simply embed the ansi escape code in the string, and not count it's length in the stats.
This may end up being a little less flexible than wadler-leijen style, as you can't use an actual idris data type for the annotations, but I think it would work.

eg

red : Doc opts -> Doc opts
red doc = ANSII_RED_BEGIN <+> doc <+> ANSII_END
@stefan-hoeck
Copy link
Contributor

I already make use of this in hedgehog. The functionality comes from package prettier-ansi. Flexibility can easily be regained by using a parameters block.

I'll happily move the functionality from prettier-ansi to this package if a dependency on the ansi library (extracted from contrib) is OK for you.

@Z-snails
Copy link
Owner Author

I already make use of this in hedgehog. The functionality comes from package prettier-ansi. Flexibility can easily be regained by using a parameters block.

I'll happily move the functionality from prettier-ansi to this package if a dependency on the ansi library (extracted from contrib) is OK for you.

In that case, I'd say leave the prettier-ansi package as is, and mention it in this package's README (feel free to make a PR if you want, otherwise I can at some point)

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

2 participants