to-html icon indicating copy to clipboard operation
to-html copied to clipboard

Feature request: background color detection

Open Efreak opened this issue 4 years ago • 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).

Efreak avatar Dec 12 '21 20:12 Efreak

Please see https://github.com/Aloso/to-html/issues/8#issuecomment-991980126.

Aloso avatar Dec 12 '21 22:12 Aloso

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

Aloso avatar Dec 12 '21 22:12 Aloso