to-html
to-html copied to clipboard
Feature request: background color detection
There's no guaranteed way to do this, just some simple things that can be tried (an xterm escape code, defaults for various terminals, and an environment variable). See this answer on SO. If background is dark, foreground colors will need to be lighter.
A better idea might be to just make the background configurable (--theme light|dark).
Please see https://github.com/Aloso/to-html/issues/8#issuecomment-991980126.
I've been thinking, maybe it would be better to use a template, e.g.
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
<style>
{{terminalCss dark}}
</style>
</head>
<body>
<h1>Title</h1>
{{terminal "cargo run"}}
</body>
</html>
And use it with to-html --template my-template.html --output my-output.html