Misterio77 / nix-colors

Modules and schemes to make theming with Nix awesome.
GNU General Public License v3.0
465 stars 38 forks source link

Add textMateThemeFromScheme to lib-contrib #39

Closed mateusauler closed 4 months ago

mateusauler commented 9 months ago

Adds a function that generates a theme in TextMate format. SublimeText and Bat also use this format.

I may have gone a little too far and created a function that translates a nix expression to XML. That was done to allow the user to append extra configs written in nix. But maybe it's unnecessary, since they are also allowed to append XML configs. I'm willing to delete the function and revert the nix set back to XML.

I only tested this with bat, since I don't use either TextMate nor SublimeText. So maybe those are borked.

The original XML was ~stolen~ inspired by https://github.com/chriskempson/base16-textmate.

Misterio77 commented 4 months ago

Hey! Thanks a lot for the contribution, and my apologies for taking so long to review this.

I'll admit that XML conversion function is super awesome and I love how ergonomic extraConfig becomes with it, but reviewing it and ensuring it does not break is a little hard. It being in the contrib namespace, though, lowers reliability expectations so it's fine by me! I'll look into writing some tests for it in the future (do feel free to open up a follow up PR if you're interesting in doing it).

An alternative, if you'd like, would be moving the XML conversion function to a separate flake (hopefully with some good tests!) or nixpkgs.

mateusauler commented 4 months ago

Hey! Thanks a lot for the contribution, and my apologies for taking so long to review this.

I'll admit that XML conversion function is super awesome and I love how ergonomic extraConfig becomes with it, but reviewing it and ensuring it does not break is a little hard. It being in the contrib namespace, though, lowers reliability expectations so it's fine by me! I'll look into writing some tests for it in the future (do feel free to open up a follow up PR if you're interesting in doing it).

An alternative, if you'd like, would be moving the XML conversion function to a separate flake (hopefully with some good tests!) or nixpkgs.

No worries! I've looked into creating a more generic conversion function, but XML usage is very non-standard. I agree that moving it out of here would be a good idea, especially because of tests. Maybe I'll create a cool flake to do something like generating XML snippets from nix without the headers. If I do so, I'll let you know.

Also, feliz carnaval!