Comments (9)
Can you please tell me what happens when you change the background color here? https://github.com/pypa/hatch/blob/hatch-v1.10.0/src/hatch/cli/config/__init__.py#L36
from hatch.
Using "white"
text = app.config_file.read() if all_keys else app.config_file.read_scrubbed()
app.output(Syntax(text.rstrip(), 'toml', background_color='white'))
produces
Using '#ffffff'
text = app.config_file.read() if all_keys else app.config_file.read_scrubbed()
app.output(Syntax(text.rstrip(), 'toml', background_color='#ffffff'))
produces
Using None
app.output(Syntax(text.rstrip(), 'toml', background_color=None))
produces
That's readable. Not pretty, but the contrast works, so it's readable. π
from hatch.
@willmcgugan What should I do here? I'm not sure what is recommended.
from hatch.
Syntax will use an Pygments theme by default. Pygments themes use RGB colors , which means that changing the background without changing the text colors is unlikely to look good.
You can also use ansi colors, which will render with the user's choice of terminal theme colors. Just set theme="ansi_light"
or theme="ansi_dark"
.
from hatch.
I would suggest to keep it simple, because programs like gcc, rustc, ls, rg etc output colorful text without trying to know which background color the terminal has.
Pick a syntax coloring with few classes (few different colors or styles) and use ansi colors, I guess?
from hatch.
I'm just going to remove the explicit background color for broader compatibility even though on light terminals it might not be as pretty like you mentioned. If you require configurability (and can provide example keyword arguments that look good) feel free to open a separate feature request!
from hatch.
Just as a heads up (mostly for Will) the background_color
option must be set to default
for tests because otherwise a bunch of spaces get written at the end of each line I think based on the terminal size. That may be in fact why I did that originally π
from hatch.
Ok, thanks for that. What do you think about a config option that turns off syntax highlight for this?
from hatch.
Sure I can do that.
from hatch.
Related Issues (20)
- The test environment should auto-install the test feature if present HOT 1
- Add feature to dynamically set environment variables in `envs.ENV.env-vars` HOT 4
- maybe wrong bumping strategy
- Pre-commit hook for `hatch fmt`? HOT 5
- [Feature Request] Dependency-specific index urls HOT 4
- Running arbitrary scripts as part of hatch test HOT 2
- How to configure the global pypi api token HOT 1
- hatch env creation currently broken (placeholder issue) HOT 3
- `INTERNALERROR> coverage.exceptions.DataError: Can't combine line data with arc data` HOT 3
- Inconsistent behavior causing 'No module named project_name' HOT 4
- With rye {root:uri}/../../packages/ seems to traverse more than 2 folders up HOT 6
- Running 'hatch test' command, default matrix does not respect 'requires-python' HOT 2
- hatch shell fails to create env HOT 1
- Question: What is the purpose of the hatchling CLI (not hatch) HOT 3
- Dependency resolution failure with 3rd party index in matrix tests HOT 5
- Feature request: Add an option to always install the project from sdist before running a command in an environment HOT 2
- βmajor.minor.microβ for requires-python gets no compatible Python distribution available HOT 5
- portable way to call a command with the same name as a a script HOT 2
- [Issue] Wrong license format generated with `hatch new` HOT 4
- AV triggered when run `hatch shell` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hatch.