Skip to content

Commit

Permalink
separate generators into each modules
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 28, 2024
1 parent 1b6cd9e commit 1ae8e80
Show file tree
Hide file tree
Showing 13 changed files with 1,542 additions and 1,485 deletions.
2 changes: 1 addition & 1 deletion alacritty/spring_night.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright (c) 2016 rhysd
#
# PLEASE DO NOT MODIFY THIS FILE DIRECTLY!
# Generated by script vim-color-spring-night/gen/src/main.rs
# Generated by script vim-color-spring-night/gen/src/alacritty.rs

[colors.primary]
background = "#132132"
Expand Down
2 changes: 1 addition & 1 deletion autoload/airline/themes/spring_night.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
" Copyright (c) 2016 rhysd
"
" PLEASE DO NOT MODIFY THIS FILE DIRECTLY!
" Generated by script vim-color-spring-night/gen/src/main.rs
" Generated by script vim-color-spring-night/gen/src/airline.rs

let g:airline#themes#spring_night#palette = {}

Expand Down
2 changes: 1 addition & 1 deletion colors/spring-night.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
" Copyright (c) 2016 rhysd
"
" PLEASE DO NOT MODIFY THIS FILE DIRECTLY!
" Generated by script vim-color-spring-night/gen/src/main.rs
" Generated by script vim-color-spring-night/gen/src/colorscheme.rs

" Optimization:
" `:set background=dark` has some side effects which takes a time.
Expand Down
1 change: 1 addition & 0 deletions gen/.rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
edition = "2021"
use_field_init_shorthand = true
6 changes: 3 additions & 3 deletions gen/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "gen-color-spring-night"
name = "gen-spring-night-theme"
version = "0.0.0"
authors = ["rhysd <lin90162@yahoo.co.jp>"]
publish = false
Expand Down
22 changes: 12 additions & 10 deletions gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ The following files are generated by this script.

- [`colors/spring-night.vim`](../colors/sprint-night.vim)
- [`autoload/airline/themes/spring_night.vim`](../autoload/airline/themes/spring_night.vim)
- [`alacritty/sprint_night.toml`](../alacritty/sprint_night.toml)

This script requires Rust toolchain. Install it by following [the official steps](https://www.rust-lang.org/en-US/install.html)
This script requires Rust toolchain. Install it by following the [official instruction](https://www.rust-lang.org/en-US/install.html)
and confirm that `cargo` command is available for package management.

To generate files:
Expand All @@ -24,17 +25,18 @@ To build a release binary:

```
$ cargo build --release
$ ./target/release/gen-color-spring-night --dir ..
$ ./target/release/gen-spring-night-theme --dir ..
```

To modify colors or highlights, you can update tables and lists in `src/main.rs`.

- `Palette` is a struct to define colors. `Palette::default` method constructs the instance. You
can find the color palette inside the function body.
- `Colorscheme` is a struct to generate Vim colorscheme file. `ColorschemeWriter::new` method
constructs the definition of highlights. Read the function body to know/modify the highlights for
each syntax items. The terminal colors used in `:terminal` are also defined here.
- `AirlineTheme` is a struct to generate [vim-airline](https://github.com/vim-airline/vim-airline)
- `Palette` in [`palette` module](./src/palette.rs) is a struct to define colors. `Palette::default`
method constructs the instance. You can find the color palette inside the function body.
- `Colorscheme` in [`colorscheme` module](./src/colorscheme.rs) is a struct to generate Vim
colorscheme file. `ColorschemeWriter::new` method constructs the definition of highlights. Read
the function body to know/modify the highlights for each syntax items. The terminal colors used in
`:terminal` are also defined here.
- `AirlineTheme` in [`airline` module](./src/airline.rs) is a struct to generate [vim-airline](https://github.com/vim-airline/vim-airline)
theme file. `AirlineThemeWriter::new` method defines color palettes for each modes.
- `AlacrittyTheme` is a struct to generate [Alacritty](https://alacritty.org/) theme file.
`AlacrittyTheme::new` method defines the terminal ANSI colors.
- `AlacrittyTheme` in [`alacritty` module](./src/alacritty.rs) is a struct to generate [Alacritty](https://alacritty.org/)
theme file. `AlacrittyTheme::new` method defines the terminal ANSI colors.
Loading

0 comments on commit 1ae8e80

Please sign in to comment.