Markdown Exporter
Markdown Exporter is an Agent Skill that transforms your Markdown text into a wide variety of professional format files.
This SKILL.md for Agent Skills, the cli tool and Python package markdown-exporter are maintained in the GitHub repository bowenliang123/markdown-exporter by bowenliang123.
Tools and Supported Formats
| Tool | Input (File path of Markdown text or styles) | Output (File path of exported file) |
|---|
| INLINECODE1 | 📝 Markdown text | 📄 Word document (.docx) |
| INLINECODE2 |
📝 Markdown text | 🌐 HTML file (.html) |
|
md_to_html_text | 📝 Markdown text | 🌐 HTML text string |
|
md_to_pdf | 📝 Markdown text | 📑 PDF file (.pdf) |
|
md_to_png | 📝 Markdown text | 🖼️ PNG image(s) of PDF pages |
|
md_to_md | 📝 Markdown text | 📝 Markdown file (.md) |
|
md_to_ipynb | 📝 Markdown text | 📓 Jupyter Notebook (.ipynb) |
|
md_to_pptx | 📝 Markdown slides in
Pandoc style | 🎯 PowerPoint (.pptx) |
|
md_to_xlsx | 📋
Markdown tables | 📊 Excel spreadsheet (.xlsx) |
|
md_to_csv | 📋
Markdown tables | 📋 CSV file (.csv) |
|
md_to_json | 📋
Markdown tables | 📦 JSON/JSONL file (.json) |
|
md_to_xml | 📋
Markdown tables | 🏷️ XML file (.xml) |
|
md_to_latex | 📋
Markdown tables | 📝 LaTeX file (.tex) |
|
md_to_codeblock | 💻
Code blocks in Markdown | 📁 Code files by language (.py, .js, .sh, etc.) |
📦 Usage
Overview
Markdown Exporter is available as a PyPI package, which provides a seamless command-line interface for all its functionality.
Installation
CODEBLOCK0
Check markdown-exporter command and usages:
CODEBLOCK1
Basic Usage
Use the
markdown-exporter command to access all the tools:
CODEBLOCK2
Important Notes
- - All commands only support file paths as input
- The package handles all dependency management automatically
- You can run the command from anywhere in your system, no need to navigate to the project directory
🔧 Scripts
mdtocsv - Convert Markdown tables to CSV
Converts Markdown tables to CSV format file.
Usage:
CODEBLOCK3
Arguments:
- -
input - Input Markdown file path containing tables - INLINECODE18 - Output CSV file path
Options:
- -
--strip-wrapper - Remove code block wrapper if present
Examples:
- 1. Basic conversion:
markdown-exporter md_to_csv /path/input.md /path/output.csv
This converts all tables in the input Markdown file to CSV format.
- 2. With code block wrapper removal:
markdown-exporter md_to_csv /path/input.md /path/output.csv --strip-wrapper
This removes any code block wrappers (``
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_pdf - Convert Markdown to PDF
Converts Markdown text to PDF format with support for Chinese, Japanese, and other languages.
**Usage:**
CODEBLOCK6
**Arguments:**
- input
- Input Markdown file path
- output
- Output PDF file path
**Options:**
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK7
This converts the entire Markdown file to a PDF document.
2. **With code block wrapper removal**:
CODEBLOCK8
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_docx - Convert Markdown to DOCX
Converts Markdown text to DOCX format file.
**Usage:**
CODEBLOCK9
**Arguments:**
- input
- Input Markdown file path
- output
- Output DOCX file path
**Options:**
- --template
- Path to DOCX template file (optional)
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK10
This converts the entire Markdown file to a DOCX document.
2. **With custom template**:
CODEBLOCK11
This uses a custom DOCX template for styling.
3. **With code block wrapper removal**:
CODEBLOCK12
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_xlsx - Convert Markdown tables to XLSX
Converts Markdown tables to XLSX format with multiple sheets support.
**Usage:**
CODEBLOCK13
**Arguments:**
- input
- Input Markdown file path containing tables
- output
- Output XLSX file path
**Options:**
- --force-text
- Convert cell values to text type (default: True)
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK14
This converts all tables in the input Markdown file to an XLSX workbook, with each table on a separate sheet.
2. **With code block wrapper removal**:
CODEBLOCK15
This removes any code block wrappers (`
) before processing the Markdown.
3. **With force-text disabled**:
CODEBLOCK16
This allows Excel to automatically determine cell types.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_pptx - Convert Markdown to PPTX
Converts Markdown text to PPTX format file.
**Usage:**
CODEBLOCK17
**Arguments:**
- input
- Input Markdown file path
- output
- Output PPTX file path
**Options:**
- --template
- Path to PPTX template file (optional)
**Examples:**
1. **Basic conversion**:
CODEBLOCK18
This converts the Markdown file to a PowerPoint presentation.
2. **With custom template**:
CODEBLOCK19
This uses a custom PowerPoint template for styling.
**Sample Markdown Input:**
Use the "Slides (for PPTX)" example from the [Sample Markdown Inputs - Slides (for PPTX)](#slides-for-pptx) section below.
---
### md_to_codeblock - Extract Codeblocks to Files
Extracts code blocks from Markdown and saves them as individual files.
**Usage:**
CODEBLOCK20
**Arguments:**
- input
- Input Markdown file path containing code blocks
- output
- Output directory path or ZIP file path
**Options:**
- --compress
- Compress all code blocks into a ZIP file
**Examples:**
1. **Extract to directory**:
CODEBLOCK21
This extracts all code blocks to individual files in the specified directory.
2. **Extract to ZIP file**:
CODEBLOCK22
This extracts all code blocks and compresses them into a ZIP file.
**Sample Markdown Input:**
Use the "Code Blocks" example from the [Sample Markdown Inputs - Code Blocks](#code-blocks) section below.
---
### md_to_json - Convert Markdown Tables to JSON
Converts Markdown tables to JSON or JSONL format file.
**Usage:**
CODEBLOCK23
**Arguments:**
- input
- Input Markdown file path containing tables
- output
- Output JSON file path
**Options:**
- --style
- JSON output style: jsonl
(default) or json_array
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion (JSONL format)**:
CODEBLOCK24
This converts tables to JSON Lines format (one JSON object per line).
2. **Convert to JSON array**:
CODEBLOCK25
This converts tables to a single JSON array of objects.
3. **With code block wrapper removal**:
CODEBLOCK26
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_xml - Convert Markdown to XML
Converts Markdown text to XML format file.
**Usage:**
CODEBLOCK27
**Arguments:**
- input
- Input Markdown file path
- output
- Output XML file path
**Options:**
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK28
This converts the entire Markdown file to an XML document.
2. **With code block wrapper removal**:
CODEBLOCK29
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_latex - Convert Markdown Tables to LaTeX
Converts Markdown tables to LaTeX format file.
**Usage:**
CODEBLOCK30
**Arguments:**
- input
- Input Markdown file path containing tables
- output
- Output LaTeX file path
**Options:**
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK31
This converts all tables in the input Markdown file to LaTeX format.
2. **With code block wrapper removal**:
CODEBLOCK32
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_html - Convert Markdown to HTML
Converts Markdown text to HTML format file.
**Usage:**
CODEBLOCK33
**Arguments:**
- input
- Input Markdown file path
- output
- Output HTML file path
**Options:**
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK34
This converts the entire Markdown file to an HTML document.
2. **With code block wrapper removal**:
CODEBLOCK35
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_html_text - Convert Markdown to HTML Text
Converts Markdown text to HTML and outputs to stdout.
**Usage:**
CODEBLOCK36
**Arguments:**
- input
- Input Markdown file path
**Example:**
CODEBLOCK37
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_png - Convert Markdown to PNG Images
Converts Markdown text to PNG images (one per page).
**Usage:**
CODEBLOCK38
**Arguments:**
- input
- Input Markdown file path
- output
- Output PNG file path or directory path
**Options:**
- --compress
- Compress all PNG images into a ZIP file
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK39
This converts the Markdown file to PNG images (one per page).
2. **With compression**:
CODEBLOCK40
This converts the Markdown file to PNG images and compresses them into a ZIP file.
3. **With code block wrapper removal**:
CODEBLOCK41
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_md - Convert Markdown to MD File
Saves Markdown text to a .md file.
**Usage:**
CODEBLOCK42
**Arguments:**
- input
- Input Markdown file path
- output
- Output MD file path
**Example:**
CODEBLOCK43
**Sample Markdown Input:**
Use the "Basic Text and Tables" example from the [Sample Markdown Inputs - Basic Text and Tables](#basic-text-and-tables) section below.
---
### md_to_ipynb - Convert Markdown to IPYNB
Converts Markdown text to Jupyter Notebook (.ipynb) format file.
**Usage:**
CODEBLOCK44
**Arguments:**
- input
- Input Markdown file path
- output
- Output IPYNB file path
**Options:**
- --strip-wrapper
- Remove code block wrapper if present
**Examples:**
1. **Basic conversion**:
CODEBLOCK45
This converts the Markdown file to a Jupyter Notebook format.
2. **With code block wrapper removal**:
CODEBLOCK46
This removes any code block wrappers (`
) before processing the Markdown.
**Sample Markdown Input:**
Use the "Code Blocks" example from the [Sample Markdown Inputs - Code Blocks](#code-blocks) section below.
### Sample Markdown Inputs
To help you test the various tools, below are common Markdown input examples that represent the content of input files:
#### Basic Text and Tables
CODEBLOCK47
#### Code Blocks
# Test Markdown File
## Code Block Test
python
print("Hello, World!")
def add(a, b):
return a + b
Test the function
result = add(5, 3)
print(f"Result: {result}")
bash
Bash script example
echo "Hello from Bash"
ls -la
javascript
// JavaScript example
console.log("Hello from JavaScript");
function multiply(a, b) {
return a * b;
}
#### Slides (for PPTX)
---
title: Markdown Exporter
author: Bowen Liang
---
# Introduction
## Welcome Slide
Welcome to our Markdown Exporter!
::: notes
Remember to greet the audience warmly.
:::
---
# Section 1: Basic Layouts
## Title and Content
- This is a basic slide with bullet points
- It uses the "Title and Content" layout
- Perfect for simple content presentation
## Two Column Layout
::::: columns
::: column
Left column content:
- Point 1
- Point 2
:::
::: column
Right column content:
- Point A
- Point B
:::
:::::
## Comparison Layout
::::: columns
::: column
Text followed by an image:

:::
::: column
- This triggers the "Comparison" layout
- Useful for side-by-side comparisons
:::
:::::
## Content with Caption
Here's some explanatory text about the image below.

---
# Section 2: Advanced Features
## Code Block
Here's a Python code block:
python
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
## Table Example
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Row 1 | Data | More |
| Row 2 | Info | Stuff |
## Incremental List
::: incremental
- This point appears first
- Then this one
- And finally this one
:::
## {background-image="https://example.com/image.jpg"}
::: notes
This is a slide with a background image and speaker notes only.
The "Blank" layout will be used.
:::
# Conclusion
## Thank You
Thank you for viewing this kitchen sink presentation!
::: notes
Remember to thank the audience and invite questions.
:::
## 📝 Notes
- All scripts only support file paths as input
- For scripts that generate multiple files (e.g., multiple tables, multiple code blocks), the output filename will be automatically numbered
- Use the --strip-wrapper
option to remove code block wrappers (``) from the input Markdown
Markdown Exporter
Markdown Exporter 是一项智能体技能,可将您的 Markdown 文本转换为多种专业格式文件。
本 SKILL.md 文件用于智能体技能,其 CLI 工具和 Python 包 markdown-exporter 由 bowenliang123 在 GitHub 仓库 bowenliang123/markdown-exporter 中维护。
工具与支持的格式
| 工具 | 输入(Markdown 文本或样式文件路径) | 输出(导出文件路径) |
|---|
| mdtodocx | 📝 Markdown 文本 | 📄 Word 文档 (.docx) |
| mdtohtml |
📝 Markdown 文本 | 🌐 HTML 文件 (.html) |
| md
tohtml_text | 📝 Markdown 文本 | 🌐 HTML 文本字符串 |
| md
topdf | 📝 Markdown 文本 | 📑 PDF 文件 (.pdf) |
| md
topng | 📝 Markdown 文本 | 🖼️ PDF 页面的 PNG 图片 |
| md
tomd | 📝 Markdown 文本 | 📝 Markdown 文件 (.md) |
| md
toipynb | 📝 Markdown 文本 | 📓 Jupyter Notebook (.ipynb) |
| md
topptx | 📝 采用
Pandoc 风格 的 Markdown 幻灯片 | 🎯 PowerPoint (.pptx) |
| md
toxlsx | 📋
Markdown 表格 | 📊 Excel 电子表格 (.xlsx) |
| md
tocsv | 📋
Markdown 表格 | 📋 CSV 文件 (.csv) |
| md
tojson | 📋
Markdown 表格 | 📦 JSON/JSONL 文件 (.json) |
| md
toxml | 📋
Markdown 表格 | 🏷️ XML 文件 (.xml) |
| md
tolatex | 📋
Markdown 表格 | 📝 LaTeX 文件 (.tex) |
| md
tocodeblock | 💻
Markdown 中的代码块 | 📁 按语言分类的代码文件 (.py, .js, .sh 等) |
📦 使用方法
概述
Markdown Exporter 以 PyPI 包形式提供,为所有功能提供无缝的命令行界面。
安装
bash
使用 pip
pip install md-exporter
使用 uv
uv tool install md-exporter
在 OpenClaw 上
npx clawhub install markdown-exporter
查看 markdown-exporter 命令及用法:
markdown-exporter -h
markdown-exporter <子命令> -h
基本用法
使用 markdown-exporter 命令访问所有工具:
bash
markdown-exporter <子命令> <参数> [选项]
重要说明
- - 所有命令仅支持文件路径作为输入
- 该包自动处理所有依赖管理
- 您可以在系统的任何位置运行命令,无需导航到项目目录
🔧 脚本
mdtocsv - 将 Markdown 表格转换为 CSV
将 Markdown 表格转换为 CSV 格式文件。
用法:
bash
markdown-exporter mdtocsv <输入> <输出> [选项]
参数:
- - input - 包含表格的输入 Markdown 文件路径
- output - 输出 CSV 文件路径
选项:
- - --strip-wrapper - 如果存在代码块包装器则移除
示例:
- 1. 基本转换:
bash
markdown-exporter md
tocsv /path/input.md /path/output.csv
将输入 Markdown 文件中的所有表格转换为 CSV 格式。
- 2. 移除代码块包装器:
bash
markdown-exporter md
tocsv /path/input.md /path/output.csv --strip-wrapper
在处理 Markdown 前移除所有代码块包装器()。
示例 Markdown 输入:
使用下方 示例 Markdown 输入 - 基本文本和表格 部分中的基本文本和表格示例。
mdtopdf - 将 Markdown 转换为 PDF
将 Markdown 文本转换为 PDF 格式,支持中文、日文及其他语言。
用法:
bash
markdown-exporter mdtopdf <输入> <输出> [选项]
参数:
- - input - 输入 Markdown 文件路径
- output - 输出 PDF 文件路径
选项:
- - --strip-wrapper - 如果存在代码块包装器则移除
示例:
- 1. 基本转换:
bash
markdown-exporter md
topdf /path/input.md /path/output.pdf
将整个 Markdown 文件转换为 PDF 文档。
- 2. 移除代码块包装器:
bash
markdown-exporter md
topdf /path/input.md /path/output.pdf --strip-wrapper
在处理 Markdown 前移除所有代码块包装器()。
示例 Markdown 输入:
使用下方 示例 Markdown 输入 - 基本文本和表格 部分中的基本文本和表格示例。
mdtodocx - 将 Markdown 转换为 DOCX
将 Markdown 文本转换为 DOCX 格式文件。
用法:
bash
markdown-exporter mdtodocx <输入> <输出> [选项]
参数:
- - input - 输入 Markdown 文件路径
- output - 输出 DOCX 文件路径
选项:
- - --template - DOCX 模板文件路径(可选)
- --strip-wrapper - 如果存在代码块包装器则移除
示例:
- 1. 基本转换:
bash
markdown-exporter md
todocx /path/input.md /path/output.docx
将整个 Markdown 文件转换为 DOCX 文档。
- 2. 使用自定义模板:
bash
markdown-exporter md
todocx /path/input.md /path/output.docx --template /path/template.docx
使用自定义 DOCX 模板进行样式设置。
- 3. 移除代码块包装器:
bash
markdown-exporter md
todocx /path/input.md /path/output.docx --strip-wrapper
在处理 Markdown 前移除所有代码块包装器()。
示例 Markdown 输入:
使用下方 示例 Markdown 输入 - 基本文本和表格 部分中的基本文本和表格示例。
mdtoxlsx - 将 Markdown 表格转换为 XLSX
将 Markdown 表格转换为支持多工作表的 XLSX 格式。
用法:
bash
markdown-exporter mdtoxlsx <输入> <输出> [选项]
参数:
- - input - 包含表格的输入 Markdown 文件路径
- output - 输出 XLSX 文件路径
选项:
- - --force-text - 将单元格值转换为文本类型(默认:True)
- --strip-wrapper - 如果存在代码块包装器则移除
示例:
- 1. 基本转换:
bash
markdown-exporter md
toxlsx /path/input.md /path/output.xlsx
将输入 Markdown 文件中的所有表格转换为 XLSX 工作簿,每个表格位于单独的工作表中。
- 2. 移除代码块包装器:
bash
markdown-exporter md
toxlsx /path/input.md /path/output.xlsx --strip-wrapper
在处理 Markdown 前移除所有代码块包装器()。
- 3. 禁用强制文本:
bash
markdown-exporter md
toxlsx /path/input.md /path/output.xlsx --force-text False
允许 Excel 自动确定