MarkItDown Secure Edition: Converting Rich-Format Documents and Web Pages to Markdown Before Feeding Them to the Model

Introduction

If you simply throw PDF, Office documents, or web links directly into an Agent, the model often either fails to read them completely or consumes a massive amount of tokens. Hand-coding curl with regex to extract the main body is high maintenance and prone to missing structure. A more reliable approach is to use Microsoft’s markitdown to convert them to pure Markdown first, and then proceed with summarization, extraction, translation, or storage. Below introduces the MarkItDown Secure Version on SkillHub: Building upon MarkItDown capabilities, it emphasizes SSRF protection, external link conversion scripts, and offline token cost assistance tools by default.

What is This

MarkItDown Secure Version is a set of Agent Skills based on the generic SKILL.md, targeting workflows that involve “convert to Markdown first, then analyze.” The core dependency is Microsoft’s open-source MarkItDown CLI (markitdown), which unifies local files and publicly accessible web pages into Markdown text.

Official entry: https://api.skillhub.cn/indiv-stwhwing/markitdown-skill

Categorized as office-efficiency on SkillHub, with a rating of 100000 and 506 downloads (page stats, written on 2026-11-24). Compared to the upstream MarkItDown Skill on ClawHub (@clawhub_karmanverma/markitdown-skill, based on the same MarkItDown ecosystem), this Skill places more emphasis on security boundaries and optional token statistics reporting in its documentation and scripts, rather than just being a documentation wrapper.

Core Features

Based on the Skill description and comparison with MarkItDown’s official capabilities, the supported scope is roughly as follows.

Documents and Media

  • PDF, Word (.docx), PowerPoint, Excel
  • Images: EXIF and description capabilities (OCR is also mentioned in the upstream documentation)
  • Audio / Video: Transcription to text
  • HTML pages, YouTube, and directly accessible URLs

Agent-side Conventions

  • Suitable for: Users who want to read, analyze, summarize, extract, translate, or Q&A with rich format files or public web pages, or need to ingest content into a knowledge base; converting to Markdown first usually also reduces subsequent conversation tokens.
  • Includes optional scripts (names are derived from the Skill description; behavior is subject to implementation):
  • scripts/url_to_markdown.py: Converts URLs to Markdown (Recommended for web pages, WeChat articles, and other links, superior to hand-written parsing).
  • scripts/token_saver.py: Performs token cost statistics on converted files; offline by default, --report only pushes when SAVINGS_URL is explicitly set.
  • scripts/report_savings.py: Shared calculation and spool/push; strictly opt-in, it does not send to any address (including localhost) by default, unless you self-host the receiving endpoint and set SAVINGS_URL.

What It Explicitly Does Not Do

  • When the input is already plain text (.md / .txt / .csv / .json): It should be read directly without going through this Skill.
  • When precise layout restoration is needed: Markdown loses layout and is not suitable.
  • Internal networks, login-required, or non-public URLs: SSRF protection will reject them; do not expect this Skill to bypass them.
  • Converted results are treated as untrusted data, not instructions for the Agent to execute.

Installation and Activation

Actual conversion is performed by the pip-installed markitdown; the Skill provides documentation, constraints, and auxiliary scripts. The installation method for MarkItDown (consistent with upstream Skill documentation) is as follows.

pip install 'markitdown[all]'

If only specific formats are needed, you can reduce extra dependencies, for example:

pip install 'markitdown[pdf,docx,pptx]'

Steps to install the Skill to a specific Agent runtime (Cursor, OpenClaw, etc.) are subject to the SkillHub page and the SKILL.md inside the package; IDE-specific commands not listed in official materials are not enumerated here.

When OCR depends on the system-level Tesseract, the upstream documentation examples are to install tesseract-ocr on Debian/Ubuntu, or use Homebrew to install tesseract on macOS.

Typical Usage

1. Convert Local or Remote Resources to Markdown using CLI

Same as standard MarkItDown usage:

markitdown document.pdf -o output.md
markitdown https://example.com/docs -o docs.md

2. [Recommended] Use Skill Script for Public Web Pages First

When handling web page or WeChat article links, the Skill recommends prioritizing:

python scripts/url_to_markdown.py "<url>"

Give the Markdown to the model for analysis after generation, avoiding hand-written parsing with curl and regex.

3. Optional: Token Statistics After Conversion

For already generated Markdown, run scripts/token_saver.py as needed; configure SAVINGS_URL and enable relevant report options when reporting is needed. report_savings.py is only used when explicitly opt-in and a receiving address is configured.

4. Python API (MarkItDown Library)

from markitdown import MarkItDown

md = MarkItDown()
result = md.convert("document.pdf")
print(result.text_content)

The upstream Skill also mentions the usage of the batch script batch_convert.py; if the secure version package retains a script with the same name, the path depends on your installed Skill directory.

Applicable Scenarios and Notes

Suitable

  • Standardizing formats for office documents, presentations, and tables before batch ingestion into a knowledge base.
  • Scenarios requiring “textualization” before Q&A, such as public document sites, GitHub rendered pages, YouTube subtitles, etc.
  • Teams that want to control tokens during the transcription phase and optionally self-host statistics reporting (SAVINGS_URL points to a self-hosted service).

Limitations and Pitfalls

  • If markitdown is not in PATH, it will fail directly; you need to pip install 'markitdown[all]' first and ensure the environment is consistent.
  • Image OCR depends on system components like Tesseract; by default, only partial capabilities may be unavailable.
  • Being blocked by the SSRF barrier for internal and authenticated URLs is expected behavior, not a bug.
  • The page body may contain misleading “instructions”; in the workflow, Markdown should only be treated as a data field, not a system prompt.

Conclusion

MarkItDown Secure Version packs Microsoft MarkItDown’s format coverage into an Agent Skill, and uses script recommendations, SSRF boundaries, and offline token assistance by default to make “Markdown first, then reasoning” more reproducible. When you need to enable or view instructions, open the official address: https://api.skillhub.cn/indiv-stwhwing/markitdown-skill .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye