Markdown to Office Skill
Overview
This skill enables conversion from Markdown to various Office formats using Pandoc - the universal document converter. Convert your Markdown files to professional Word documents, PowerPoint presentations, PDFs, and more while preserving formatting and structure.
How to Use
- Provide the Markdown content or file
- Specify the target format (docx, pptx, pdf, etc.)
- Optionally provide a reference template for styling
- I'll convert using Pandoc with optimal settings
Example prompts:
- "Convert this README.md to a professional Word document"
- "Turn my markdown notes into a PowerPoint presentation"
- "Generate a PDF from this markdown with custom styling"
- "Create a Word doc from this markdown using company template"
Domain Knowledge
Pandoc Fundamentals
Supported Conversions
Markdown to Word (.docx)
Basic Conversion
With Template (Reference Doc)
With Table of Contents
With Metadata
Markdown to PDF
Via LaTeX (Best Quality)
Via HTML/wkhtmltopdf
PDF Options
Markdown to PowerPoint (.pptx)
Basic Conversion
Markdown Structure for Slides
With Template
YAML Frontmatter
Add metadata at the top of your Markdown:
Python Integration
pypandoc (Python Wrapper)
Best Practices
- Use Templates: Create a reference document for consistent branding
- Structure Headers: Use consistent heading levels (## for slides, # for sections)
- Test Incrementally: Convert small sections first to verify formatting
- Include Metadata: Use YAML frontmatter for document properties
- Handle Images: Use relative paths and specify dimensions
Common Patterns
Batch Conversion
Report Generator
Examples
Example 1: Technical Documentation
Authorization: Bearer YOUR_API_KEY
Error Codes
Save markdown
with open('api_docs.md', 'w') as f: f.write(doc)
Convert to Word
subprocess.run([ 'pandoc', 'api_docs.md', '-o', 'api_documentation.docx', '--toc', '--reference-doc', 'company_template.docx' ], check=True)
Convert to PDF
subprocess.run([ 'pandoc', 'api_docs.md', '-o', 'api_documentation.pdf', '--toc', '-V', 'geometry:margin=1in', '-V', 'fontsize=11pt' ], check=True)
Limitations
- Complex Word formatting may not convert perfectly
- PDF conversion requires LaTeX or wkhtmltopdf
- PowerPoint animations not supported
- Some advanced tables may need manual adjustment
- Image positioning can be tricky

