Aloso/to-html

Feature request: background color detection

Efreak opened this issue · 2 comments

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).

Aloso commented

Please see #8 (comment).

Aloso commented

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