Markdown Export
Use this skill when the user wants one Markdown source exported into docx, html, or both.
What this skill provides
- One unified CLI for both
docxandhtml - Input from either a Markdown file or a raw Markdown string
- Built-in templates for both output formats
- Custom template support for both output formats
- Optional table of contents, numbered headings, metadata, and resource-path support
- HTML layout controls for optional TOC panel and plain article body rendering
Formats
docxUses a Wordreference.docxstyle templatehtmlUses a Pandoc HTML template plus CSS
Built-in template names
DOCX
modern-blueexecutive-serifwarm-notebookminimal-gray
HTML
docs-slatemagazine-amberproduct-midnightserif-paper
List everything with:
python3 scripts/export_markdown.py --list-templates
Only list one format with:
python3 scripts/export_markdown.py --format html --list-templates
Main examples
Markdown to DOCX
python3 scripts/export_markdown.py \
--format docx \
--input-file /abs/path/source.md \
--output /abs/path/output.docx \
--builtin-template modern-blue \
--toc \
--number-sections
Markdown to HTML
python3 scripts/export_markdown.py \
--format html \
--input-file /abs/path/source.md \
--output /abs/path/output.html \
--builtin-template docs-slate \
--toc \
--embed-assets
Markdown to HTML Without TOC Background Card
python3 scripts/export_markdown.py \
--format html \
--input-file /abs/path/source.md \
--output /abs/path/output.html \
--builtin-template docs-slate \
--embed-assets \
--no-body-background
Raw string
python3 scripts/export_markdown.py \
--format html \
--markdown '# Release Notes\n\n- Export to both HTML and DOCX with one skill' \
--output /abs/path/release.html \
--builtin-template magazine-amber \
--title 'Release Notes'
Template rules
docx--templatemust point to a.docxreference documenthtml--templatemust point to a Pandoc HTML template that contains$body$- For HTML, built-in CSS is automatically applied when using a built-in template
- For HTML, extra
--cssfiles are appended after built-in CSS - For HTML, omitting
--tocremoves the TOC panel and expands the article body to full width - For HTML,
--no-body-backgroundremoves the article panel background, border, and shadow while keeping the page theme
Bundled files
- Unified converter:
scripts/export_markdown.py - DOCX built-in templates:
assets/docx/templates/*.docx - HTML built-in templates:
assets/html/templates/*.html - HTML built-in styles:
assets/html/styles/*.css
Notes
- This skill expects
pandocto be installed and available onPATH - If the user already has a brand template, prefer passing
--template
