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

Smarter color coding? E.g. for HTML, RTF, ... #4

Open
joeytwiddle opened this issue Jun 17, 2014 · 0 comments
Open

Smarter color coding? E.g. for HTML, RTF, ... #4

joeytwiddle opened this issue Jun 17, 2014 · 0 comments

Comments

@joeytwiddle
Copy link
Owner

An idea I have had for a while is to adjust the coloring policy so that it can apply to more situations that just 8-color terminal.

For example, the color codes could be different depending on the environment we want to output to:

  • 8 color terminal
  • 2 color terminal (with bold/reverse/underline)
  • HTML
  • ...

Doing this would require:

  • Any script that wants to produce multiple output formats would need to close their color blocks. Currently many scripts (designed for the terminal) just switch to a new color. But to produce nice HTML, we need to close each block of color we have opened!

However, the vast majority of scripts won't ever be wanted for HTML output. If they ever are, then a layer to convert termcodes to HTML might be preferable.

Furthermore, anything targetting HTML will also need to escape lots of other character (< and > being the most obvious). Again, doing this by post-processing the output might be more appropriate.

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