diff options
Diffstat (limited to 'docs/prototypes/gen_tokens.py')
| -rw-r--r-- | docs/prototypes/gen_tokens.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/prototypes/gen_tokens.py b/docs/prototypes/gen_tokens.py index f966451..9f011e9 100644 --- a/docs/prototypes/gen_tokens.py +++ b/docs/prototypes/gen_tokens.py @@ -29,7 +29,7 @@ Usage: The web CSS is written into panel-widget-gallery.html between the `/* @tokens:start */` and `/* @tokens:end */` markers; the waybar and elisp -targets are written to tokens-waybar.css and tokens.el beside it. +targets are written to tokens-waybar.css and gallery-tokens.el beside it. """ import json @@ -39,6 +39,10 @@ HERE = os.path.dirname(os.path.abspath(__file__)) TOKENS_START = "/* @tokens:start */" TOKENS_END = "/* @tokens:end */" +# The elisp target's filename must match its (provide 'gallery-tokens) so +# `require` resolves it from a load-path. +DEFAULT_ELISP_NAME = "gallery-tokens.el" + # sections whose values are plain colors (searched by resolve_color, and the # ones that become @define-color / alist color entries) COLOR_SECTIONS = ("palette", "amber") @@ -152,7 +156,7 @@ def main(tokens_path=None, html_path=None, waybar_path=None, elisp_path=None): tokens_path = tokens_path or os.path.join(HERE, "tokens.json") html_path = html_path or os.path.join(HERE, "panel-widget-gallery.html") waybar_path = waybar_path or os.path.join(HERE, "tokens-waybar.css") - elisp_path = elisp_path or os.path.join(HERE, "tokens.el") + elisp_path = elisp_path or os.path.join(HERE, DEFAULT_ELISP_NAME) with open(tokens_path) as f: tokens = json.load(f) |
