| name | pdf-to-md |
| description | Converts PDF, PPTX, DOCX, XLSX, HTML, images to Markdown via MarkItDown (Microsoft). Saves .md next to the source file or in a specified folder. |
| allowedTools | ["Bash","Read"] |
PDF / PPTX / DOCX -> Markdown
Converts documents to clean Markdown via MarkItDown by Microsoft.
Supported formats: PDF, PPTX, DOCX, XLSX, XLS, HTML, images (JPG, PNG), ZIP archives.
Configuration
No configuration needed. This skill uses markitdown CLI which is installed automatically on first run via pip.
Triggers
- "pdf to markdown", "pptx to markdown", "convert PDF/PPTX/DOCX"
- "extract text from file", "convert document"
/pdf-to-md
Algorithm
Step 1: Determine input files
If user provided a path — use it.
If no path provided — ask:
Provide the path to the file (PDF, PPTX, DOCX, XLSX, image).
You can drag a file into chat or paste the full path.
Step 2: Check and install markitdown
if ! command -v markitdown &>/dev/null; then
echo "Installing markitdown..."
pip install 'markitdown[all]' -q
fi
markitdown --version 2>/dev/null || echo "ok"
If pip is unavailable — try pip3 or python3 -m pip.
Step 3: Convert file
INPUT="/path/to/file.pdf"
OUTPUT="${INPUT%.*}.md"
markitdown "$INPUT" > "$OUTPUT"
echo "Done: $OUTPUT"
echo "Size: $(wc -l < "$OUTPUT") lines"
If a destination folder is specified:
OUTPUT="/target/dir/$(basename "${INPUT%.*}").md"
markitdown "$INPUT" > "$OUTPUT"
Step 4: Show preview
Show the first 60 lines of the result via Read tool.
If file is empty or < 10 lines — inform:
PDF likely consists of scans without OCR. MarkItDown does not support OCR.
Options: 1) Use Marker (heavier, but has OCR) 2) Use Adobe or another OCR tool
Step 5: Final report
CONVERSION COMPLETE
---
File: <source filename>
Format: <PDF / PPTX / DOCX>
Result: <full path to .md>
Size: <N lines>
Batch conversion
If user provided multiple files or a folder:
for f in /path/to/*.pdf; do
markitdown "$f" > "${f%.*}.md"
echo "Done: $(basename $f)"
done
Important rules
- OCR: MarkItDown does NOT do OCR. Scans without a text layer will produce an empty file — warn the user.
- PPTX: Extracts slide text, headings, tables. Images from slides can be described via LLM if
--llm-client is passed (not used by default).
- Overwrite: If
<name>.md already exists — warn before overwriting.
- Paths: Use absolute paths. If user gave a relative path — clarify the working directory.
�ез Read tool.
Если файл пустой или < 10 строк — сообщи:
PDF, вероятно, состоит из сканов без OCR. MarkItDown не поддерживает OCR.
Варианты: 1) Использовать Marker (тяжелее, но OCR) 2) Использовать Adobe или другой OCR
Шаг 5: Финальный отчёт
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
КОНВЕРТАЦИЯ ЗАВЕРШЕНА
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Файл: <имя исходного файла>
Формат: <PDF / PPTX / DOCX>
Результат: <полный путь к .md>
Размер: <N строк>
Пакетная конвертация
Если пользователь передал несколько файлов или папку:
for f in /path/to/*.pdf; do
markitdown "$f" > "${f%.*}.md"
echo "✓ $(basename $f)"
done
Важные правила
- OCR: MarkItDown НЕ делает OCR. Сканы без текстового слоя дадут пустой файл — предупреди пользователя.
- PPTX: Извлекается текст слайдов, заголовки, таблицы. Изображения из слайдов описываются через LLM если передан
--llm-client (по умолчанию не используется).
- Перезапись: Если
<name>.md уже существует — предупреди перед перезаписью.
- Пути: Использовать абсолютные пути. Если пользователь дал относительный — уточнить рабочую директорию.