Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Validate themes

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: validate-${{ github.ref }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install validation tools
run: |
python -m pip install --upgrade pip
python -m pip install PyYAML==6.0.2
sudo apt-get update
sudo apt-get install -y shellcheck

- name: Regenerate every editor theme
run: |
for generator in editors/*/generate.py; do
echo "::group::$generator"
(cd "$(dirname "$generator")" && python3 generate.py)
echo "::endgroup::"
done

- name: Check generated files are committed
run: |
git diff --exit-code
test -z "$(git status --porcelain)"

- name: Validate assets and documentation
run: python3 scripts/validate.py

- name: Lint shell scripts
run: git ls-files -z '*.sh' | xargs -0 shellcheck -S error
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,6 @@

<a href="https://xscriptor.io">Dev</a>
&
<a href="https://github.com/xscriptor">github</a>
<a href="https://github.com/xscriptor">Github</a>
&
<a href="https://www.xscriptor.com">X</a>
4 changes: 2 additions & 2 deletions editors/eclipse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<div align="center">
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="https://eclipse.org"><img src="https://img.shields.io/badge/Eclipse-4.5%2B-blue" alt="Eclipse"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.7%2B-blue" alt="Python"></a>
<a href="#themes"><img src="https://img.shields.io/badge/Themes-12-purple" alt="Themes"></a>
Expand Down Expand Up @@ -68,7 +68,7 @@
<div align="center">
<a href="https://xscriptor.io">Dev</a>
&amp;
<a href="https://github.com/xscriptor">github</a>
<a href="https://github.com/xscriptor">Github</a>
&amp;
<a href="https://www.xscriptor.com">X</a>
</div>
4 changes: 2 additions & 2 deletions editors/netbeans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<div align="center">
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="https://netbeans.org"><img src="https://img.shields.io/badge/NetBeans-8.0%2B-blue" alt="NetBeans"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.7%2B-blue" alt="Python"></a>
<a href="#themes"><img src="https://img.shields.io/badge/Themes-12-purple" alt="Themes"></a>
Expand Down Expand Up @@ -68,7 +68,7 @@
<div align="center">
<a href="https://xscriptor.io">Dev</a>
&amp;
<a href="https://github.com/xscriptor">github</a>
<a href="https://github.com/xscriptor">Github</a>
&amp;
<a href="https://www.xscriptor.com">X</a>
</div>
4 changes: 2 additions & 2 deletions editors/sublime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<div align="center">
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="https://www.sublimetext.com"><img src="https://img.shields.io/badge/Sublime%20Text-3.1%2B-blue" alt="Sublime Text"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.7%2B-blue" alt="Python"></a>
<a href="#themes"><img src="https://img.shields.io/badge/Themes-12-purple" alt="Themes"></a>
Expand Down Expand Up @@ -63,7 +63,7 @@
<div align="center">
<a href="https://xscriptor.io">Dev</a>
&amp;
<a href="https://github.com/xscriptor">github</a>
<a href="https://github.com/xscriptor">Github</a>
&amp;
<a href="https://www.xscriptor.com">X</a>
</div>
6 changes: 3 additions & 3 deletions editors/sublime/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os

PARENT = os.path.dirname(__file__)
DIST_DIR = os.path.join(PARENT, "dist")
os.makedirs(DIST_DIR, exist_ok=True)
THEMES_DIR = os.path.join(PARENT, "themes")
os.makedirs(THEMES_DIR, exist_ok=True)

with open(os.path.join(PARENT, "..", "..", "colors.json")) as f:
palettes = json.load(f)
Expand Down Expand Up @@ -184,7 +184,7 @@ def resolve(idx):
}

filename = f"{name}.sublime-color-scheme"
filepath = os.path.join(DIST_DIR, filename)
filepath = os.path.join(THEMES_DIR, filename)
with open(filepath, "w") as f:
json.dump(scheme, f, indent=2)
print(f" ✓ {filename}")
2 changes: 1 addition & 1 deletion editors/textmate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ rm ~/Library/Application\ Support/TextMate/Themes/Xscriptor\ *.tmTheme
## Links

- [Repository](https://github.com/xscriptor-colors/ide)
- [Colors](../colors.md)
- [Colors](../../colors.md)
2 changes: 1 addition & 1 deletion editors/vim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Copy the `.vim` files to your `~/.vim/colors/` directory:

```bash
# Option 1: Copy all themes
cp dist/*.vim ~/.vim/colors/
cp themes/*.vim ~/.vim/colors/

# Option 2: Use the install script
chmod +x install.sh
Expand Down
4 changes: 2 additions & 2 deletions editors/visualstudio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<div align="center">
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="https://visualstudio.microsoft.com"><img src="https://img.shields.io/badge/Visual%20Studio-2019%2B-blue" alt="Visual Studio"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.7%2B-blue" alt="Python"></a>
<a href="#themes"><img src="https://img.shields.io/badge/Themes-12-purple" alt="Themes"></a>
Expand Down Expand Up @@ -68,7 +68,7 @@
<div align="center">
<a href="https://xscriptor.io">Dev</a>
&amp;
<a href="https://github.com/xscriptor">github</a>
<a href="https://github.com/xscriptor">Github</a>
&amp;
<a href="https://www.xscriptor.com">X</a>
</div>
18 changes: 9 additions & 9 deletions editors/xcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<div align="center">
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="https://developer.apple.com/xcode/"><img src="https://img.shields.io/badge/Xcode-12%2B-blue" alt="Xcode"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.7%2B-blue" alt="Python"></a>
<a href="#themes"><img src="https://img.shields.io/badge/Themes-12-purple" alt="Themes"></a>
Expand All @@ -30,7 +30,7 @@

<p>
This generator reads ANSI terminal palettes (16 colors each, 12 palettes) defined in
<a href="colors.md"><code>colors.md</code></a> and produces Xcode
<a href="../../colors.md"><code>colors.md</code></a> and produces Xcode
<code>.xccolortheme</code> files. Each palette maps to 24 Xcode syntax
tokens (keywords, strings, comments, types, etc.) so that the editor's
syntax highlighting matches the terminal color scheme.
Expand All @@ -39,7 +39,7 @@
<p>
Canonical themes live in <a href="themes/"><code>themes/</code></a>.
When the source palette changes, run the generator to rebuild them into
<a href="labs/dist/"><code>labs/dist/</code></a>.
<a href="labs/README.md"><code>labs/dist/</code></a>.
</p>

<hr>
Expand Down Expand Up @@ -121,13 +121,13 @@ REPO="xscriptor/xcode" bash &lt;(curl -fsSL ...) -s -- -u # remote uninstall</
<h2 id="related-documents">Related Documents</h2>

<ul>
<li id="colors-md"><a href="colors.md">colors.md</a></li>
<li id="contributing-md"><a href="CONTRIBUTING.md">CONTRIBUTING.md</a></li>
<li id="security-md"><a href="SECURITY.md">SECURITY.md</a></li>
<li id="code-of-conduct-md"><a href="CODE_OF_CONDUCT.md">CODE_OF_CONDUCT.md</a></li>
<li id="colors-md"><a href="../../colors.md">colors.md</a></li>
<li id="contributing-md"><a href="../../CONTRIBUTING.md">CONTRIBUTING.md</a></li>
<li id="security-md"><a href="../../SECURITY.md">SECURITY.md</a></li>
<li id="code-of-conduct-md"><a href="../../CODE_OF_CONDUCT.md">CODE_OF_CONDUCT.md</a></li>
<li id="color-mapping-md"><a href="docs/color-mapping.md">docs/color-mapping.md</a></li>
<li id="labs-readme"><a href="labs/README.md">labs/README.md</a></li>
<li id="license"><a href="LICENSE.md">labs/README.md</a></li>
<li id="license"><a href="../../LICENSE">LICENSE</a></li>
</ul>

<hr>
Expand All @@ -139,7 +139,7 @@ REPO="xscriptor/xcode" bash &lt;(curl -fsSL ...) -s -- -u # remote uninstall</

<a href="https://xscriptor.io">Dev</a>
&
<a href="https://github.com/xscriptor">github</a>
<a href="https://github.com/xscriptor">Github</a>
&
<a href="https://www.xscriptor.com">X</a>

Expand Down
4 changes: 2 additions & 2 deletions editors/xcode/docs/color-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<hr>

<p>
Each palette defined in <a href="../../colors.md"><code>colors.md</code></a>
Each palette defined in <a href="../../../colors.md"><code>colors.md</code></a>
contains 16 ANSI colors (<code>color0</code> through <code>color15</code>)
plus <code>background</code> and <code>foreground</code>.
The generator maps them to Xcode syntax tokens as follows:
Expand Down Expand Up @@ -54,4 +54,4 @@
insertion point) are computed automatically based on background luminance.
</p>

<p><a href="../../README.md">Back to root README</a></p>
<p><a href="../../../README.md">Back to root README</a></p>
6 changes: 3 additions & 3 deletions editors/xcode/labs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

<p>
<code>generate_themes.py</code> reads the palettes defined in
<a href="../../colors.md"><code>colors.md</code></a> and produces
<a href="../../../colors.md"><code>colors.md</code></a> and produces
Xcode theme files in <code>dist/</code>.
Each theme maps the 16 ANSI colors to 24 Xcode syntax tokens.
</p>

<p>See the <a href="../../README.md">root README</a> for installation instructions and theme listing.</p>
<p>See the <a href="../../../README.md">root README</a> for installation instructions and theme listing.</p>

<hr>

Expand Down Expand Up @@ -105,4 +105,4 @@ colors = make_theme("Praha", theme)</code></pre>

<hr>

<p><a href="../../README.md">Back to root README</a></p>
<p><a href="../../../README.md">Back to root README</a></p>
2 changes: 1 addition & 1 deletion editors/zed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
./install.sh
```

Or manually copy the `.json` files from `dist/` to `~/.config/zed/themes/`.
Or manually copy the `.json` files from `themes/` to `~/.config/zed/themes/`.

## Uninstall

Expand Down
Loading
Loading