alirezarezvani/claude-skills / markdown-html/skills/md-slides
md-slides
VerifiedTurn a markdown file into a single-file HTML slide deck with keyboard navigation, presenter notes and print-to-PDF. Use whenever the user wants slides or a presentation from markdown or notes.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.8 KB |
| assets/md_slides_template.html | other | 4.8 KB |
| references/keyboard_nav_patterns.md | markdown | 4.6 KB |
| references/presentation_ux.md | markdown | 5.1 KB |
| references/single_file_deck_conventions.md | markdown | 5.1 KB |
| scripts/deck_html_renderer.py | script | 20.4 KB |
| scripts/presenter_notes_parser.py | script | 3.9 KB |
| scripts/slide_splitter.py | script | 9.9 KB |
scripts/presenter_notes_parser.py
View on GitHub#!/usr/bin/env python3
"""presenter_notes_parser.py - Extract <!-- notes: ... --> blocks from slide bodies.
Stdlib-only. Operates on the slide JSON produced by slide_splitter.py. For each
slide, finds any HTML-comment notes block (the convention used by reveal.js,
Marp, Big, Pandoc-Beamer) and:
- Records the notes text separately under `notes`
- Removes the notes block from `body_markdown` so the slide renders cleanly
Accepted notes syntax (case-insensitive on the keyword):
<!-- notes: This is a single-line presenter note. -->
<!-- notes:
Multi-line notes block. Can contain markdown.
- Bullet points
- Multiple paragraphs
-->
<!-- speaker-notes: alias -->
<!-- presenter: alias -->
If a slide has multiple notes blocks, they're concatenated with blank lines
between them.
NO LLM CALLS. Pure regex + slide-by-slide transformation.
Usage:
python presenter_notes_parser.py --slides slides.json --output slides-notes.json
python presenter_notes_parser.py --sample
"""
from __future__ import annotations
import argparse
import json
import re
import sys
from pathlib import Path
from typing import Any
# Matches the entire <!-- notes: ... --> block, including multi-line
NOTES_BLOCK_RE = re.compile(
r"<!--\s*(?:notes|speaker-notes|presenter)\s*:\s*(.*?)\s*-->",
re.IGNORECASE | re.DOTALL,
)
def extract_notes_from_slide(slide: dict[str, Any]) -> dict[str, Any]:
"""Return a new slide dict with `notes` populated and `body_markdown`
stripped of any notes blocks."""
body = slide.get("body_markdown", "")
found: list[str] = []
def _capture(m: re.Match) -> str:
found.append(m.group(1).strip())
return "" # remove the block from body
cleaned = NOTES_BLOCK_RE.sub(_capture, body)
# Tidy up: collapse runs of >2 blank lines, trim trailing whitespace
cleaned = re.sub(r"\n{3,}", "\n\n", cleaned).strip("\n")
out = dict(slide)
out["body_markdown"] = cleaned
out["notes"] = "\n\n".join(found) if found else ""
out["has_notes"] = bool(found)
return out
def attach_notes(slides_payload: dict[str, Any]) -> dict[str, Any]:
slides = slides_payload.get("slides", [])
new_slides = [extract_notes_from_slide(s) for s in slides]
notes_count = sum(1 for s in new_slides if s["has_notes"])
out = dict(slides_payload)
out["slides"] = new_slides
out["summary"] = dict(out.get("summary", {}))
out["summary"]["slides_with_notes"] = notes_count
out["summary"]["notes_coverage_pct"] = (
round(100 * notes_count / len(new_slides), 1) if new_slides else 0.0
)
return out
def main(argv: list[str]) -> int:
p = argparse.ArgumentParser(description=__doc__.split("\n")[0])
p.add_argument("--slides", help="Path to slide_splitter JSON output, or '-' for stdin")
p.add_argument("--output", help="Path to write JSON output (else stdout)")
p.add_argument("--sample", action="store_true",
help="Run on the slide_splitter built-in sample")
args = p.parse_args(argv)
if args.sample:
sys.path.insert(0, str(Path(__file__).resolve().parent))
import slide_splitter
slides_payload = slide_splitter.split_slides(slide_splitter.SAMPLE_MARKDOWN)
elif args.slides:
raw = sys.stdin.read() if args.slides == "-" else Path(args.slides).read_text(encoding="utf-8")
slides_payload = json.loads(raw)
else:
p.print_help()
return 0
result = attach_notes(slides_payload)
payload = json.dumps(result, indent=2)
if args.output:
Path(args.output).write_text(payload, encoding="utf-8")
print(f"wrote {args.output}: {result['summary']['slides_with_notes']}/"
f"{result['summary']['total_slides']} slides have presenter notes "
f"({result['summary']['notes_coverage_pct']}% coverage)")
else:
print(payload)
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |