diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-16 07:08:55 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-16 07:08:55 -0500 |
| commit | 62be9cf808116de3c387d795b563db1abd02e587 (patch) | |
| tree | 20a259a4e5a1239af2d2adb676528b0f567445b6 /scripts/theme-studio/app_inventory.py | |
| parent | effd41cfec8d051071131197ffb9a5cca479c55d (diff) | |
| download | dotemacs-62be9cf808116de3c387d795b563db1abd02e587.tar.gz dotemacs-62be9cf808116de3c387d795b563db1abd02e587.zip | |
feat(theme-studio): realistic README preview for markdown-mode
markdown-mode fell back to the generic preview (bare face names). I added renderMarkdownPreview, a realistic README that exercises the markdown faces in context: front matter, headers, bold/italic, inline and fenced code, links, lists and checkboxes, a blockquote with a footnote, a table, strikethrough, highlight, math, and inline HTML. A PREVIEW_KEYS map in app_inventory routes markdown-mode to the renderer, and the #mdtest gate checks every data-face it emits is a real markdown face.
Diffstat (limited to 'scripts/theme-studio/app_inventory.py')
| -rw-r--r-- | scripts/theme-studio/app_inventory.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/theme-studio/app_inventory.py b/scripts/theme-studio/app_inventory.py index 01dcb7db..9add0f65 100644 --- a/scripts/theme-studio/app_inventory.py +++ b/scripts/theme-studio/app_inventory.py @@ -35,6 +35,13 @@ BESPOKE_APPS = { } +# Inventory apps (not in BESPOKE_APPS) default to the generic preview. A few have +# a dedicated PACKAGE_PREVIEWS renderer in app.js, keyed by name here. +PREVIEW_KEYS = { + "markdown-mode": "markdown", +} + + def face_label(face: str, prefix: str) -> str: label = face[len(prefix) :] if face.startswith(prefix) else face return label.replace("-face", "").replace("-", " ") @@ -55,7 +62,7 @@ def add_inventory_apps(apps: dict[str, Any], inventory_path: str) -> dict[str, A continue apps[pkg] = { "label": pkg, - "preview": "generic", + "preview": PREVIEW_KEYS.get(pkg, "generic"), "faces": [[face, face_label(face, pkg + "-"), {}] for face in inventory[pkg]], } return apps |
