From 77a35727d54b26f9f6a48bc65a021d6bba1ee4be Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 8 Jun 2026 02:07:35 -0500 Subject: feat(theme-selector): full category coverage, elements rename, visible tile borders I renamed the assignments column "category" to "elements" and gave every language sample a token for each category that applies to it, so clicking an element name flashes real code in any language: Python gained a regexp, Elisp/Go/TypeScript/C each a builtin, and Go and Shell an escape. The categories a language genuinely lacks (Elisp has no preprocessor, Shell no types) fall back to flashing the example cell. The save area header is now "export, import, and save", and the palette tiles and the picker swatch carry a visible border so a tile that matches the page background still reads. --- scripts/theme-selector/samples.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/theme-selector/samples.py') diff --git a/scripts/theme-selector/samples.py b/scripts/theme-selector/samples.py index 38d57092..539effc8 100644 --- a/scripts/theme-selector/samples.py +++ b/scripts/theme-selector/samples.py @@ -20,6 +20,7 @@ PYS=[ [('kw','from'),('p',' '),('var','dataclasses'),('p',' '),('kw','import'),('p',' '),('var','dataclass'),('punc',','),('p',' '),('var','field')], [], [('con','DEFAULT_PORT'),('op',':'),('p',' '),('ty','int'),('p',' '),('op','='),('p',' '),('num','8080')], + [('con','HEX'),('p',' '),('op','='),('p',' '),('var','re'),('op','.'),('fnc','compile'),('punc','('),('re','r"#[0-9a-f]{6}"'),('punc',')')], [], [('dec','@dataclass')], [('kw','class'),('p',' '),('ty','Theme'),('op',':')], @@ -49,7 +50,7 @@ ELS=[ [], [('punc','('),('kw','defun'),('p',' '),('fnd','cache-get'),('p',' '),('punc','('),('var','key'),('punc',')')], [('p',' '),('doc','"Return cached value for KEY."')], - [('p',' '),('punc','('),('kw','or'),('p',' '),('punc','('),('fnc','gethash'),('p',' '),('var','key'),('p',' '),('var','cache--tbl'),('punc',')')], + [('p',' '),('punc','('),('kw','or'),('p',' '),('punc','('),('bi','gethash'),('p',' '),('var','key'),('p',' '),('var','cache--tbl'),('punc',')')], [('p',' '),('punc','('),('kw','let'),('p',' '),('punc','(('),('var','v'),('p',' '),('punc','('),('fnc','compute'),('p',' '),('var','key'),('p',' '),('num','42'),('punc','))) ')], [('p',' '),('punc','('),('fnc','puthash'),('p',' '),('var','key'),('p',' '),('var','v'),('p',' '),('var','cache--tbl'),('punc',') '),('var','v'),('punc','))))')], [], @@ -83,9 +84,9 @@ GOS=[ [('kw','func'),('p',' '),('punc','('),('var','q'),('p',' '),('op','*'),('ty','Queue'),('punc',')'),('p',' '),('fnd','Push'),('punc','('),('var','o'),('p',' '),('op','*'),('ty','Order'),('punc',')'),('p',' '),('ty','error'),('p',' '),('punc','{')], [('p',' '),('cmd','//'),('cm',' reject nil')], [('p',' '),('kw','if'),('p',' '),('var','o'),('p',' '),('op','=='),('p',' '),('con','nil'),('p',' '),('punc','{')], - [('p',' '),('kw','return'),('p',' '),('fnc','fmt.Errorf'),('punc','('),('str','"nil"'),('punc',')')], + [('p',' '),('kw','return'),('p',' '),('fnc','fmt.Errorf'),('punc','('),('str','"nil'),('esc','\\n'),('str','"'),('punc',')')], [('p',' '),('punc','}')], - [('p',' '),('var','q'),('op','.'),('prop','items'),('p',' '),('op','='),('p',' '),('fnc','append'),('punc','('),('var','q'),('op','.'),('prop','items'),('punc',','),('p',' '),('var','o'),('punc',')')], + [('p',' '),('var','q'),('op','.'),('prop','items'),('p',' '),('op','='),('p',' '),('bi','append'),('punc','('),('var','q'),('op','.'),('prop','items'),('punc',','),('p',' '),('var','o'),('punc',')')], [('p',' '),('kw','return'),('p',' '),('con','nil')], [('punc','}')], [], @@ -117,6 +118,7 @@ TSS=[ [('kw','const'),('p',' '),('var','q'),('p',' '),('op','='),('p',' '),('kw','new'),('p',' '),('ty','OrderQueue'),('punc','()'),('punc',';')], [('var','q'),('op','.'),('fnd','push'),('punc','('),('punc','{'),('p',' '),('prop','id'),('op',':'),('p',' '),('num','1'),('p',' '),('punc','}'),('p',' '),('kw','as'),('p',' '),('ty','Order'),('punc',')'),('punc',';')], [('var','console'),('op','.'),('fnc','log'),('punc','('),('var','q'),('op','.'),('prop','max'),('punc',')'),('punc',';')], + [('kw','const'),('p',' '),('var','cap'),('p',' '),('op','='),('p',' '),('var','Math'),('op','.'),('bi','max'),('punc','('),('con','LIMIT'),('punc',','),('p',' '),('num','0'),('punc',')'),('punc',';')], ] CS=[ @@ -140,6 +142,7 @@ CS=[ [('cmd','//'),('cm',' entrypoint')], [('ty','int'),('p',' '),('fnd','main'),('punc','('),('ty','void'),('punc',')'),('p',' '),('punc','{')], [('p',' '),('ty','Order'),('p',' '),('var','o'),('p',' '),('op','='),('p',' '),('punc','{'),('p',' '),('op','.'),('prop','id'),('p',' '),('op','='),('p',' '),('num','1'),('p',' '),('punc','}'),('punc',';')], + [('p',' '),('ty','Order'),('p',' '),('op','*'),('var','p2'),('p',' '),('op','='),('p',' '),('bi','malloc'),('punc','('),('bi','sizeof'),('punc','('),('ty','Order'),('punc','))'),('punc',';')], [('p',' '),('fnc','push'),('punc','('),('op','&'),('var','o'),('punc',')'),('punc',';')], [('p',' '),('kw','return'),('p',' '),('num','0'),('punc',';')], [('punc','}')], @@ -165,7 +168,7 @@ SHS=[ [('p',' '),('kw','for'),('p',' '),('var','host'),('p',' '),('kw','in'),('p',' '),('str','"$@"'),('punc',';'),('p',' '),('kw','do')], [('p',' '),('fnc','deploy'),('p',' '),('str','"$host"'),('p',' '),('op','||'),('p',' '),('bi','exit'),('p',' '),('num','1')], [('p',' '),('kw','done')], - [('p',' '),('bi','echo'),('p',' '),('str','"all done"')], + [('p',' '),('bi','echo'),('p',' '),('op','-e'),('p',' '),('str','"all done'),('esc','\\n'),('str','"')], [('punc','}')], [], [('fnc','main'),('p',' '),('str','"$@"')], -- cgit v1.2.3