-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(whiskers)!: switch to tera, use rich context objects (#150)
* feat(whiskers)!: rewrite from scratch with tera and rich context * feat(whiskers): convert demo example to tera * feat(whiskers): convert frontmatter example to tera * feat(whiskers): convert simple single-file example to tera * feat(whiskers): convert overrides example to tera * docs(whiskers): update for 2.0 * docs(whiskers): update overrides section(s) * chore(whiskers): add beta suffix to version number * Revert "chore(whiskers): add beta suffix to version number" This reverts commit 2d60034. * feat(whiskers): bring back 0.6 opacity red in demo example * docs(whiskers): document the --dry-run flag
- Loading branch information
1 parent
5540590
commit 696578a
Showing
48 changed files
with
2,350 additions
and
1,643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "catppuccin-whiskers" | ||
version = "1.1.4" | ||
version = "2.0.0" | ||
authors = ["backwardspy <[email protected]>"] | ||
edition = "2021" | ||
description = "Soothing port creation tool for the high-spirited!" | ||
|
@@ -9,27 +9,42 @@ homepage = "https://github.com/catppuccin/toolbox/tree/main/whiskers" | |
repository = "https://github.com/catppuccin/toolbox" | ||
license = "MIT" | ||
|
||
[lib] | ||
name = "whiskers" | ||
path = "src/lib.rs" | ||
|
||
[[bin]] | ||
name = "whiskers" | ||
path = "src/main.rs" | ||
|
||
[lints.clippy] | ||
all = "warn" | ||
pedantic = "warn" | ||
nursery = "warn" | ||
unwrap_used = "warn" | ||
missing_errors_doc = "allow" | ||
implicit_hasher = "allow" | ||
cast_possible_truncation = "allow" | ||
cast_sign_loss = "allow" | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
base64 = "0.22" | ||
catppuccin = { version = "2.1", features = ["css-colors"] } | ||
indexmap = { version = "2.2", features = ["serde"] } | ||
catppuccin = { version = "2.1", features = ["serde", "css-colors"] } | ||
clap = { version = "4.5", features = ["derive"] } | ||
clap-stdin = "0.4" | ||
color-eyre = { version = "0.6", default-features = false } | ||
clap-stdin = "0.4.0" | ||
css-colors = "1.0" | ||
handlebars = "5.1" | ||
regex = "1.10" | ||
indexmap = { version = "2.2", features = ["serde"] } | ||
itertools = "0.12" | ||
lzma-rust = "0.1" | ||
rmp-serde = "1.1" | ||
semver = { version = "1.0.22", features = ["serde"] } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_json = { version = "1.0", features = ["preserve_order"] } | ||
serde_json = "1.0" | ||
serde_yaml = "0.9" | ||
tempfile = "3.10" | ||
tempfile = "3.10.1" | ||
tera = { version = "1.19", features = ["preserve_order"] } | ||
thiserror = "1.0" | ||
titlecase = "2.2" | ||
json-patch = "1.2" | ||
|
||
[dev-dependencies] | ||
assert_cmd = "2.0" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
whiskers: | ||
version: "2.0.0" | ||
--- | ||
## Demo | ||
|
||
**flavor:** {{ flavor.name }} | ||
|
||
### Colours | ||
{% set lightred = red | add(lightness=10) -%} | ||
{% set darkred = red | sub(lightness=10) -%} | ||
{% set palered = red | mix(color=base, amount=0.3) -%} | ||
{% set fadered1 = red | mod(opacity=0.6) -%} | ||
{% set fadered2 = red | mod(opacity=0.5) -%} | ||
|
||
- **red:** #{{ red.hex }} / {{ css_rgb(color=red) }} / {{ css_hsl(color=red) }} | ||
- **components:** r: {{ red.rgb.r }} / {{ red.rgb.r / 255 | trunc(places=2) }}, g: {{ red.rgb.g }} / {{ red.rgb.g / 255 | trunc(places=2) }}, b: {{ red.rgb.b }} / {{ red.rgb.b / 255 | trunc(places=2) }} | ||
- **alpha:** {{ fadered1.opacity }} / {{ fadered1.opacity / 255 | trunc(places=2) }} | ||
- **10% lighter:** #{{ lightred.hex }} / {{ css_rgb(color=lightred) }} / {{ css_hsl(color=lightred) }} | ||
- **10% darker:** #{{ darkred.hex }} / {{ css_rgb(color=darkred) }} / {{ css_hsl(color=darkred) }} | ||
|
||
- **30% mix with base:** #{{ palered.hex }} / {{ css_rgb(color=palered) }} / {{ css_hsl(color=palered) }} | ||
|
||
- **50% opacity:** #{{ fadered2.hex }} / {{ css_rgba(color=fadered2) }} / {{ css_hsla(color=fadered2) }} | ||
|
||
### Conditionals | ||
|
||
this is a {{ if(cond=flavor.dark, t="dark", f="light") }} theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
whiskers: | ||
version: "2.0.0" | ||
dark_accent: mauve | ||
light_accent: pink | ||
--- | ||
{% set parent = if(cond=flavor.dark, t='darcula', f='default') -%} | ||
{% set accent = if(cond=flavor.dark, t=dark_accent, f=light_accent) -%} | ||
|
||
## Demo With Frontmatter | ||
|
||
**flavor:** {{ flavor.name }} | ||
|
||
This file also contains variables that have been defined in the frontmatter, as shown below: | ||
|
||
### Frontmatter Variables | ||
|
||
- **parent** is {{ parent }} | ||
- **accent** is #{{ flavor.colors[accent].hex }} | ||
|
||
### Colours | ||
|
||
- **red:** #{{ red.hex }} / {{ css_rgb(color=red) }} / {{ css_hsl(color=red) }} | ||
- **components:** r: {{ red.rgb.r }} / {{ red.rgb.r / 255 | trunc(places=2) }}, g: {{ red.rgb.g }} / {{ red.rgb.g / 255 | trunc(places=2) }}, b: {{ red.rgb.b }} / {{ red.rgb.b / 255 | trunc(places=2) }} | ||
- **alpha:** {{ red.opacity }} / {{ red.opacity / 255 | trunc(places=2) }} | ||
{% set lightred = red | add(lightness=10) -%} | ||
- **10% lighter:** #{{ lightred.hex }} / {{ css_rgb(color=lightred) }} / {{ css_hsl(color=lightred) }} | ||
{% set darkred = red | sub(lightness=10) -%} | ||
- **10% darker:** #{{ darkred.hex }} / {{ css_rgb(color=darkred) }} / {{ css_hsl(color=darkred) }} | ||
|
||
{% set palered = red | mix(color=base, amount=0.3) -%} | ||
- **30% mix with base:** #{{ palered.hex }} / {{ css_rgb(color=palered) }} / {{ css_hsl(color=palered) }} | ||
|
||
{% set fadered = red | mod(opacity=0.5) -%} | ||
- **50% opacity:** #{{ fadered.hex }} / {{ css_rgba(color=fadered) }} / {{ css_hsla(color=fadered) }} | ||
|
||
### Conditionals | ||
|
||
this is a {{ if(cond=flavor.dark, t="dark", f="light") }} theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.