feat(P01): render PPTX + CAP-042 + D-241 record + frontmatter-comment fix
- render_pptx.py: skip leading HTML comments before frontmatter (split_slides + parse_frontmatter) - docs/presentations/nova-leadership-deck.pptx: 7 slides, footer on every slide - STATE.md: CAP-042 row appended (leadership deck, single-shot, Aug 2026) - PROJECT.md: D-241 formal entry (single-shot, discrete, no compression) - smoke test exits 0 (all 6 assertions a-f pass) ---ci--- project: acdl phase: 1 milestone: v1.30 status: execute wave: 4 persona: backend-engineer + lead-developer ---/ci---
This commit is contained in:
+28
-8
@@ -70,13 +70,21 @@ def parse_frontmatter(md_text: str):
|
||||
(no nested structures) — sufficient for Marp deck frontmatter
|
||||
(marp, theme, footer, paginate, size). The `style:` block (multi-
|
||||
line `|`) is skipped (not needed by the python-pptx renderer).
|
||||
Skips leading HTML comments before the frontmatter fence.
|
||||
"""
|
||||
if not md_text.lstrip().startswith("---"):
|
||||
text = md_text.lstrip()
|
||||
# Skip leading HTML comments before frontmatter.
|
||||
while text.startswith("<!--"):
|
||||
end = text.find("-->")
|
||||
if end == -1:
|
||||
return {}
|
||||
text = text[end + 3 :].lstrip()
|
||||
if not text.startswith("---"):
|
||||
return {}
|
||||
end = md_text.find("\n---", 3)
|
||||
end = text.find("\n---", 3)
|
||||
if end == -1:
|
||||
return {}
|
||||
fm_text = md_text[3:end]
|
||||
fm_text = text[3:end]
|
||||
fm = {}
|
||||
in_multiline = False
|
||||
for line in fm_text.splitlines():
|
||||
@@ -104,14 +112,26 @@ def parse_frontmatter(md_text: str):
|
||||
|
||||
|
||||
def split_slides(md_text: str):
|
||||
"""Strip YAML frontmatter, then split the deck into slide source strings."""
|
||||
"""Strip leading HTML comments + YAML frontmatter, then split into slides.
|
||||
|
||||
A Marp deck may carry a header HTML comment before the frontmatter
|
||||
(e.g. the REQ-372 related-artifacts comment). Skip leading comments
|
||||
before detecting the `---` frontmatter fence.
|
||||
"""
|
||||
text = md_text.lstrip()
|
||||
# Skip leading HTML comments (<!-- ... -->) before frontmatter.
|
||||
while text.startswith("<!--"):
|
||||
end = text.find("-->")
|
||||
if end == -1:
|
||||
break
|
||||
text = text[end + 3 :].lstrip()
|
||||
# Strip YAML frontmatter (between first pair of `---` lines).
|
||||
if md_text.lstrip().startswith("---"):
|
||||
end = md_text.find("\n---", 3)
|
||||
if text.startswith("---"):
|
||||
end = text.find("\n---", 3)
|
||||
if end != -1:
|
||||
md_text = md_text[end + 4 :]
|
||||
text = text[end + 4 :]
|
||||
# Normalize slide separators. Marp uses `\n---\n` on its own line.
|
||||
parts = re.split(r"\n---\s*\n", md_text)
|
||||
parts = re.split(r"\n---\s*\n", text)
|
||||
slides = []
|
||||
for p in parts:
|
||||
p = p.strip("\n")
|
||||
|
||||
Reference in New Issue
Block a user