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

Provide API for implicit conversions #5

Closed
1 of 2 tasks
epage opened this issue Jun 10, 2022 · 6 comments
Closed
1 of 2 tasks

Provide API for implicit conversions #5

epage opened this issue Jun 10, 2022 · 6 comments
Labels
C-enhancement Category: Raise on the bar on expectations

Comments

@epage
Copy link
Collaborator

epage commented Jun 10, 2022

Most term styling crates require the format-site to know the capabilities of the intended output stream. This complicates things when the the format-site and outputting are decoupled.

The idea for this is that people choose the ansi styling crate of their choice and either generate a string and print it as needed (required for clap) or construct a set of stream wrappers around stdout/stderr and write their styled Display types directly to it.

This issue is for a crate that can convert strings or be used in a custom stream to handle

Conversions

  • Graceful degradation to no colors (required for clap)
  • Graceful degradation to lower colors or no colors
  • Convert to wincon api (required for clap)
    • As most of termcolor would likely not be used, we'd probably want to make the calls ourself

Related issues:

@epage
Copy link
Collaborator Author

epage commented Jun 10, 2022

See https://crates.io/crates/fwdansi/ which was the inspiration for this, converting ANSI escape codes to termcolor calls.

@epage epage added the C-enhancement Category: Raise on the bar on expectations label Jun 10, 2022
@epage

This comment was marked as off-topic.

@epage

This comment was marked as off-topic.

@epage

This comment was marked as off-topic.

epage added a commit that referenced this issue Sep 28, 2022
Prior art
- rich (python)
- ansi_colours (rust, c)
- rgb2ansi256 (rust)

This is a step towards #5
epage added a commit that referenced this issue Sep 28, 2022
Prior art
- rich (python)
- ansi_colours (rust, c)
- rgb2ansi256 (rust)

This is a step towards #5
@epage epage changed the title Provide stream API with implicit conversions Provide API for implicit conversions Jan 13, 2023
@epage
Copy link
Collaborator Author

epage commented Feb 27, 2023

#36 takes care of wincon

@epage
Copy link
Collaborator Author

epage commented Mar 10, 2023

With #54 and #61, we can close this out.

color->color degradation is split out into #64

@epage epage closed this as completed Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

1 participant