Changes:
* Custom Nushell `color_config`'s (non-Lemnos) are moved to the
`./src/custom-nu-themes` directory and used to generate the main theme
files when doing a `./make.nu`
* `make.nu` and other scripts (e.g. preview) have been moved to the
`src` directory
* A separate `README` for the `src` scripts
* Main theme `README` updated for clarity
* Reordered the theme template, so all themes were regenerated. I'd like
to stop doing this ;-)
@amtoine Thanks for your suggestions on the `README`. I've pretty
extensively changed the flow, so please re-review and let me know how it
looks. Also note that I haven't personally tested with Nupm, so please
especially review this section. Thanks!
@fdncred CC
Still planning on working on the preview scripts next. They'll need only
slight changes to run (probably a path change), but they can be
simplified a bit now, I hope. At the same time, I'll complicate them in
other ways ;-).
Note that there is a bug in both `nushell-dark` and `nushell-light` that
prevented the terminal colors from being updated regardless. You can see
that in the existing screenshots, where both those themes simply re-use
the previous theme (alphabetically's) background. I haven't fixed this
yet.
* Primary change: Simplifies theme usage by adding an `export-env` to
each theme so that `$env.config.color_config` is automatically set when
importing the module.
Rather than the old:
```nu
use nu-themes/nushell-dark.nu
$env.config.color_config = (nushell-dark)
```
It's now a single-step:
```nu
use nu-themes/nushell-dark.nu
```
* Updates `make.nu` to create the theme files (uses the previously added
`str dedent` for clean output).
* A couple (literally, 2) of the remote themes did not have all
necessary colors and failed. Updated `make.nu` to continue on error, but
report the failures.
* Updated `README.md`
* change the main command of the themes to `main`
Command used:
```
sd 'export def .* \[\] \{' 'export def main [] {' themes/themes/**/*
```
This commit mitigates the following equivalent error
```
>_ module spam { export def spam [] { "this is spam::spam" } }
Error: nu::parser::named_as_module
× Can't export command named same as the module.
╭─[entry #74:1:1]
1 │ module spam { export def spam [] { "this is spam::spam" } }
· ──┬─
· ╰── can't export from module spam
╰────
help: Module spam can't export command named the same as the module. Either change the module name, or export `main`
custom command.
```
when running `use themes/themes/dracula.nu` for instance.
* change the template as well to define a `main` function
* do not use * from the theme modules, they define a `main` function
* add my personal color config files
remove the useless colors.nu script
* add all lemnos theme files as a submodule
* add a template module from the default dark theme
the `map.csv` file:
```csv
code,bold,bash,nushell
0,false,black,black
1,false,red,red
2,false,green,green
3,false,yellow,yellow
4,false,blue,blue
5,false,magenta,purple
6,false,cyan,cyan
7,false,white,light_gray
8,true,black,dark_gray
9,true,red,red_bold
10,true,green,green_bold
11,true,yellow,yellow_bold
12,true,blue,blue_bold
13,true,magenta,purple_bold
14,true,cyan,light_cyan
14,true,cyan,cyan_bold
15,true,white,white
```
the command used was
```nushell
open map.csv |
each {
|it|
sed -i $"s/: ($it.nushell)$/: \"{{color($it.code)}}\"/" template.nu
}
```
or as a oneliner
```nushell
open map.csv | each {|it| sed -i $"s/: ($it.nushell)$/: \"{{color($it.code)}}\"/" template.nu}
```
* add a script to make all the scripts at once
* make all the themes
* add a README with some credits to lemnos
* add usage instructions to the README
* add desired values to the template
This commit adds the background, the foreground and the cursor
colors to the themes as commented lines.
These do not fit into any nushell theme as they should be set by the
terminal emulator, but they are included here for completeness.
Addresses https://github.com/nushell/nu_scripts/pull/286#issuecomment-1230814914
* regenerate the themes with the new template
* remove all the occurences of sed by str replace
* remove the lemnos submodule
Co-authored-by: amtoine <44101798+AntoineStevan@users.noreply.github.com>