diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-14 00:08:03 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-14 00:08:03 -0500 |
| commit | 623f8e09b93168c48f98961d963ce62a046b0877 (patch) | |
| tree | 365878a3b411e430c480b20e7f1b95521535f9ef /scripts/theme-studio/samples.py | |
| parent | d1edc63c205b7c589d4178bdd638b171400ed098 (diff) | |
| download | dotemacs-623f8e09b93168c48f98961d963ce62a046b0877.tar.gz dotemacs-623f8e09b93168c48f98961d963ce62a046b0877.zip | |
Update theme studio palette workflow
Diffstat (limited to 'scripts/theme-studio/samples.py')
| -rw-r--r-- | scripts/theme-studio/samples.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/theme-studio/samples.py b/scripts/theme-studio/samples.py index a854d6721..c80b0d405 100644 --- a/scripts/theme-studio/samples.py +++ b/scripts/theme-studio/samples.py @@ -327,5 +327,6 @@ html=f'''<!doctype html><meta charset=utf-8><title>dupre revision — canonical< <table class="leg" id="legtable"><thead><tr><th></th><th onclick="srt(1)">color △</th><th onclick="srt(2)">hex △</th><th onclick="srt(3)">category △</th><th>example</th></tr></thead><tbody>{legend}</tbody></table> <h1>palette</h1> {palette}\n<script>let D={{}};function srt(c){{const t=document.querySelector("#legtable tbody");const r=[...t.rows];D[c]=!D[c];r.sort((a,b)=>{{const x=a.cells[c].innerText.trim().toLowerCase(),y=b.cells[c].innerText.trim().toLowerCase();return (x<y?-1:x>y?1:0)*(D[c]?1:-1)}});r.forEach(x=>t.appendChild(x))}}</script>''' -open("/tmp/dupre-canon.html","w").write(html) +with open("/tmp/dupre-canon.html","w") as out: + out.write(html) print("wrote /tmp/dupre-canon.html") |
