diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-14 22:11:42 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-14 22:11:42 -0500 |
| commit | 18132bacf809c889f87fb0be56cf8c7d6a4e8638 (patch) | |
| tree | 16b2dda2c3c1b9200ee5468db972eb53e6362433 /scripts/theme-studio/samples.py | |
| parent | 10dce4bc6762f30cc034d2d551c4eec8a989e550 (diff) | |
| download | dotemacs-18132bacf809c889f87fb0be56cf8c7d6a4e8638.tar.gz dotemacs-18132bacf809c889f87fb0be56cf8c7d6a4e8638.zip | |
refactor(theme-studio): derive the gate list and sentinel the samples split
run-tests.sh built its browser-gate list by hand, so a new gate could go unrun or a removed one stay listed (that drift hid the #familytest alias). It now derives the list from the gate blocks in browser-gates.js.
generate.py split samples.py on the first "cols=" substring to import only the data section, which would truncate at the wrong place if "cols=" ever appeared earlier. Both sides now use an explicit THEME_STUDIO_DATA_END marker.
Diffstat (limited to 'scripts/theme-studio/samples.py')
| -rw-r--r-- | scripts/theme-studio/samples.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/theme-studio/samples.py b/scripts/theme-studio/samples.py index c80b0d40..02605e75 100644 --- a/scripts/theme-studio/samples.py +++ b/scripts/theme-studio/samples.py @@ -288,6 +288,9 @@ ZIGS=[ [('punc','}')], ] +# THEME_STUDIO_DATA_END: generate.py execs only the lines above this marker (the +# code samples and COLS). Everything below is the standalone /tmp/dupre-canon.html +# preview generator, run only when samples.py is executed directly. cols="".join(f'<div class="col"><h2>{n}</h2><pre>{render(s)}</pre></div>' for n,s in [("Elisp",ELS),("Go",GOS),("Python",PYS),("TypeScript",TSS),("Java",JAS),("C",CS),("C++",CPS),("Rust",RUSTS),("Zig",ZIGS),("Shell",SHS)]) legend_rows=[ ("keyword (bold)","kw","class def if return import"),("builtin","bi","len range print"), |
