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 | 0682b24f27540e9ae943b5e8fefc605fdd44d1b5 (patch) | |
| tree | 9beec872ddd1ee8bdc1b349f470ee229c2aadc98 /scripts/theme-studio/app_inventory.py | |
| parent | 2458ebd7f7df77b0ee6cee447bc391ac6adef5cc (diff) | |
| download | dotemacs-0682b24f27540e9ae943b5e8fefc605fdd44d1b5.tar.gz dotemacs-0682b24f27540e9ae943b5e8fefc605fdd44d1b5.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 01dcb7db7..9add0f658 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 |
