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

Feature request: background color detection #7

Open
Efreak opened this issue Dec 12, 2021 · 2 comments
Open

Feature request: background color detection #7

Efreak opened this issue Dec 12, 2021 · 2 comments

Comments

@Efreak
Copy link
Contributor

Efreak commented Dec 12, 2021

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
Copy link
Owner

Aloso commented Dec 12, 2021

Please see #8 (comment).

@Aloso
Copy link
Owner

Aloso commented Dec 12, 2021

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

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

2 participants