[WordPress] 外掛分享: MTM HTML to Markdown

首頁外掛目錄 › MTM HTML to Markdown
WordPress 外掛 MTM HTML to Markdown 的封面圖片
10+
安裝啟用
尚無評分
58 天前
最後更新
問題解決
WordPress 5.0+ PHP 7.4+ v1.0.0 上架:2026-01-15

內容簡介

總結:這個外掛可以將 WordPress 的 URL 以 .md.txt 格式提供快取的 Markdown 版本,並附上 YAML 前置資料。無需更改主題,使您的網站能夠保持原樣,同時為工具、存檔和 AI 友好的文件製作流程提供乾淨的 Markdown 輸出。

**問題與答案:**

1. 如何啟用外掛功能呢?
- 答:當訪客要求以 .md.txt 結尾的 URL 時,外掛會載入頁面的 HTML,提取主要內容,將 HTML 轉換為 Markdown,並附上 YAML 前置資料,然後通過短期快取返回結果。

2. 這個外掛的關鍵功能有哪些?
- 答:.md.txt 結尾的端點適用於頁面、文章和公開自訂文章類型,YAML 前置標頭提供結構化的元數據,允許 HTML 轉換為 Markdown,並透過 League HTML to Markdown 進行清理,還可自行配置選擇器、快取輸出以減少重複轉換,且提供了可選的「強制更新」功能來刷新 Markdown 快取。

3. 外掛用於 LLMS.txt / AI 文件工作流程時有何作用?
- 答:許多團隊維護一個 /llms.txt 索引文件,其中列出與「詳細」Markdown 頁面鏈接,以進行快速人工智能吸入和導覽,這個外掛可以作為「詳細頁生成器」,使每個頁面都可透過穩定的 URL 以 Markdown 形式提供。

4. 若在 .md.txt URL 上遇到 404 錯誤該如何解決?
- 答:確認已啟用美觀的永久連結,然後重新保存「設定」→「永久連結」以刷新重寫規則。若站點前面有快取層/CDN,請清除 .md.txt 路徑的快取。

5. 如果輸出缺少內容該如何處理?
- 答:如果您的主題未使用主要元素,則更改選擇器以匹配真實內容容器(例如,#content)。

6. 這個外掛的開發者為誰?
- 答:這個外掛是由 Moving Traffic Media & YSC 開發的。

7. 這個外掛的許可證是什麼?
- 答:這個程序是自由軟件,您可以根據 GNU 通用公共許可證 v2 或更新版本的條款進行重新分發和/或修改。您可以在 https://www.gnu.org/licenses/gpl-2.0.html 查看完整的許可證。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「MTM HTML to Markdown」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Serve cached Markdown versions of WordPress URLs at .md.txt with YAML frontmatter. No theme changes required.
When a visitor requests a URL ending in .md.txt, the plugin:
1. loads the page HTML,
2. extracts the primary content (default selector: main),
3. converts HTML to Markdown,
4. prepends YAML frontmatter (metadata),
5. returns the result with short-term caching.
This keeps your normal site unchanged while exposing a clean Markdown output for tooling, archiving, and AI-friendly documentation workflows.
Key features include:

.md.txt endpoint for pages, posts, and public custom post types
YAML frontmatter headers for structured metadata (title, slug, canonical URL, generated time)
HTML → Markdown conversion via League HTML to Markdown
Builder-noise cleanup for common wrappers (Divi, Elementor, block markup)
Configurable selector (default: main)
Cached output to reduce repeated conversions
Optional “Force Update” from the admin panel for refreshing the Markdown cache.

LLMs.txt / AI Documentation Workflows
Many teams maintain a /llms.txt index file that links to “detail” Markdown pages for fast AI ingestion and navigation.
This plugin can act as the “detail page generator” by making each page available as Markdown via a stable URL.
Typical pattern:
– /llms.txt lists key pages (human curated)
– each entry links to the corresponding .md.txt URL for full content
(If you publish /llms.txt, confirm it only includes URLs you intend to expose publicly.)
Example Output
plugin: “MTM HTML to Markdown”
source_url: “https://example.com/sample-page/”
generated_at: “2026-01-08T13:00:00-05:00”
slug: “sample-page”
Sample Page
(Body converted to Markdown…)
Troubleshooting
I get a 404 on .md.txt URLs
Confirm pretty permalinks are enabled, then re-save Settings → Permalinks to flush rewrite rules.
If a caching layer/CDN is in front of the site, purge cache for the .md.txt path.
Output is missing content
If your theme does not use a element, change the selector to match the real content container (e.g., #content).
Credits
Developed by Moving Traffic Media & YSC.
Uses League HTML to Markdown under MIT license.
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v2 or later.
See the full license at https://www.gnu.org/licenses/gpl-2.0.html.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon