title: "Token discipline: check inline directives ({{NNpt:...}} and {{#HEX:...}})"
Problem
The fontSize token check (#133, follow-up #TBD) only validates fontSize as a JSON key. Font sizes and colors specified via inline directives inside text strings are not checked:
{"type": "textbox", "fontSize": 16, "text": "{{22pt:big}} and {{#FF9900:orange}}"}
fontSize: 16 → checked ✓
{{22pt:big}} → not checked ✗
{{#FF9900:orange}} → not checked ✗
These inline directives are parsed at render time by sdpm.utils.text.parse_styled_text (line 70), which supports:
NNpt (font size)
#RRGGBB (color)
bold, italic, underline
font=Name
link:URL
Proposed solution
Add a second pass in sdpm/checks/font_size.py (and future color.py) that:
- Walks all string values in the slide JSON
- Extracts
{{attrs:text}} patterns via the same regex used by parse_styled_text
- Validates
NNpt attrs against --fs-* tokens
- Validates
#RRGGBB attrs against --color-* / --* color tokens
Can reuse _walk_font_sizes pattern — extend to yield inline occurrences with a location like page02(intro) elements.[0].text:inline.
Scope
References
skill/sdpm/utils/text.py:70 — parse_styled_text docstring
skill/sdpm/checks/font_size.py — known limitation comment in _walk_font_sizes
skill/references/workflows/slide-json-spec.md:114 — inline directive spec
title: "Token discipline: check inline directives ({{NNpt:...}} and {{#HEX:...}})"
Problem
The fontSize token check (#133, follow-up #TBD) only validates
fontSizeas a JSON key. Font sizes and colors specified via inline directives insidetextstrings are not checked:{"type": "textbox", "fontSize": 16, "text": "{{22pt:big}} and {{#FF9900:orange}}"}fontSize: 16→ checked ✓{{22pt:big}}→ not checked ✗{{#FF9900:orange}}→ not checked ✗These inline directives are parsed at render time by
sdpm.utils.text.parse_styled_text(line 70), which supports:NNpt(font size)#RRGGBB(color)bold,italic,underlinefont=Namelink:URLProposed solution
Add a second pass in
sdpm/checks/font_size.py(and futurecolor.py) that:{{attrs:text}}patterns via the same regex used byparse_styled_textNNptattrs against--fs-*tokens#RRGGBBattrs against--color-*/--*color tokensCan reuse
_walk_font_sizespattern — extend to yield inline occurrences with a location likepage02(intro) elements.[0].text:inline.Scope
color,fill,fontColor,iconColor, etc.)References
skill/sdpm/utils/text.py:70—parse_styled_textdocstringskill/sdpm/checks/font_size.py— known limitation comment in_walk_font_sizesskill/references/workflows/slide-json-spec.md:114— inline directive spec