diff --git a/.editorconfig b/.editorconfig index fe7a099f..ed5ef2c2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ end_of_line = lf charset = utf-8 insert_final_newline = true -[*.lua] +[*.{lua,tera}] indent_style = tab [*.{diff,md}] diff --git a/.github/scripts/update-palette.py b/.github/scripts/update-palette.py deleted file mode 100644 index 186a7804..00000000 --- a/.github/scripts/update-palette.py +++ /dev/null @@ -1,15 +0,0 @@ -import json -import urllib.request - -url = "https://github.com/catppuccin/palette/raw/main/palette.json" - -with urllib.request.urlopen(url) as response: - flavors = json.loads(response.read().decode()) - -flavors.pop("version", None) -for flavor in flavors: - with open(f"lua/catppuccin/palettes/{flavor}.lua", "w") as f: - f.write("return {\n") - for color in flavors[flavor]["colors"]: - f.write(f'\t{color} = "{flavors[flavor]["colors"][color]["hex"]}",\n') - f.write("}\n") diff --git a/.github/workflows/palette.yml b/.github/workflows/palette.yml deleted file mode 100644 index ba3317a4..00000000 --- a/.github/workflows/palette.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Palette - -on: - workflow_dispatch: - schedule: - - cron: '0 0 1 * *' # Run on the first of every month - -jobs: - createPullRequest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Make changes to pull request - run: python3 ./.github/scripts/update-palette.py - - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v7 - with: - commit-message: 'feat: auto-sync upstream palettes' - committer: GitHub - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - signoff: false - branch: new-palettes - delete-branch: true - title: 'feat: auto-sync upstream palettes' - body: | - Auto-update `lua/catppuccin/palettes/` based on https://github.com/catppuccin/palette/blob/main/palette.json diff --git a/justfile b/justfile new file mode 100644 index 00000000..df660f2b --- /dev/null +++ b/justfile @@ -0,0 +1,5 @@ +_default: + @just list + +build: + whiskers nvim.tera diff --git a/nvim.tera b/nvim.tera new file mode 100644 index 00000000..6361f6af --- /dev/null +++ b/nvim.tera @@ -0,0 +1,12 @@ +--- +whiskers: + version: 2.5.1 + matrix: + - flavor + filename: "lua/catppuccin/palettes/{{flavor.identifier}}.lua" +--- +return { +{%- for id, color in flavor.colors %} + {{id}} = "#{{color.hex}}", +{%- endfor %} +}