把一个或多个微信公众号文章链接整理成结构化 markdown,支持单篇整理和多篇日报汇总。
mp.weixin.qq.com 文章链接summarize 用中文总结全文内容在真正开始抓取文章之前,需要先确认:
summarize 已经配置好 API key,并且可正常使用Do not fetch article content until all three items are clear:
summary.include_images=true|false.~/Downloads.If any of the three items is missing, stop and ask before continuing.
For each mp.weixin.qq.com URL, run:
bash
python3 scripts/read_wechat_article.py '<wechat_url>' --out '<temp_dir>'
This produces structured metadata, raw HTML, and a first-pass markdown export.
Do not trust the first-pass article markdown blindly.
If the body contains mojibake or obvious encoding corruption, repair it from raw.html by running:
bash
python3 scripts/fix_wechat_body.py '<raw.html>' --out '<body-fixed.txt>'
Use the cleaned body text as the canonical input for summarization.
Always summarize the cleaned local text, not the original WeChat URL.
Run:
bash
python3 scripts/summarize_cn.py '<body-fixed.txt>' --out '<summary.json>' --length short
or for a combined report:
bash
python3 scripts/summarize_cn.py '<combined-input.md>' --out '<summary.json>' --length medium
The script enforces Chinese output and fails if the returned summary is not sufficiently Chinese.
Never write summarize output directly into the final file.
Normalize paragraph breaks and spacing with:
bash
python3 scripts/normalize_markdown_text.py '<input.txt>' --out '<normalized.txt>'
Use this for:
This prevents ugly line wrapping and mixed-language formatting artifacts.
Run:
bash
python3 scripts/build_mindmap_markdown.py \
--result '<result.json>' \
--body '<body-fixed.txt>' \
--summary '<summary.json>' \
--output-dir '<chosen-dir>' \
--include-images true
Run:
bash
python3 scripts/build_batch_report.py \
--inputs '<dir1>' '<dir2>' '<dir3>' \
--output-dir '<chosen-dir>' \
--include-images true \
--report-label '微信文章日报'
The batch report must:
text
YYYYMMDD-文章标题.md
text
YYYYMMDD-<总文章数量>篇-<汇总说明>.md
Before writing the final markdown:
raw.html when the extracted body is corrupted.scripts/read_wechat_article.py — fetch WeChat article metadata, body, raw HTML, and image linksscripts/fix_wechat_body.py — repair mojibake and extract clean text from raw HTMLscripts/summarize_cn.py — run summarize in Chinese and enforce a language checkscripts/normalize_markdown_text.py — normalize prose paragraphs and line breaksscripts/build_mindmap_markdown.py — generate single-article markdown filesscripts/build_batch_report.py — generate multi-article combined reportsscripts/run_wechat_mindmap_workflow.py — orchestrate the full workflow end to end after the required user confirmations