CSDN Blog To Obsidian Note
Workflow
Use this skill when the user says the CSDN article is their own or otherwise authorizes verbatim conversion.
- Ask for the Obsidian target note path if the user did not provide it.
- Use
scripts/csdn_to_obsidian.pyinstead of rewriting ad hoc conversion code. - Prefer writing only the target note and its configured/nearby attachment folder.
- Preserve article order: title, text, images, code blocks, lists, tables, links, and formulas.
- Download images and reference local files from the note.
- Convert images to WebP by default when Pillow is available, matching typical Obsidian image-converter behavior.
- Add language names to code fences when confident:
- JSON object/config snippets ->
json - Python imports/defs/decorators ->
python - shell commands such as
pip,conda,npm,uv,npx->bash - leave blank only when uncertain.
- JSON object/config snippets ->
- Verify counts before reporting: image refs in note, copied images, code fence languages, output paths.
Default Command
Run from any workspace:
python .\.codex\skills\csdn-blog-to-obsidian-note\scripts\csdn_to_obsidian.py `
--url "https://blog.csdn.net/USER/article/details/ARTICLE_ID" `
--target "D:\Obsidian\Study\Study\LLM\MCP.md"
Useful options:
--mode replace-blockupdates a managed block between markers and preserves content outside it. This is the default.--mode appendappends a new managed block.--attachment-dir "D:\...\images"overrides where images are stored.--image-prefix MCPcontrols generated image names such asMCP-01.webp.--format webpor--format originalcontrols attachment format.--quality 75controls WebP/JPEG compression quality.
Obsidian Notes
- If the target note has nearby
images/, use it as the default attachment directory. - Otherwise create
images/next to the target note. - Use relative Markdown image links like
for portability. - Do not edit
.obsidianplugin configs unless the user explicitly asks. - If the user requires plugin-exact behavior, inspect
.obsidian/plugins/obsidian-image-converter/data.jsonread-only and mirror its attachment folder/format settings in the script options.
Verification Checklist
After running the script, report:
- Target note path.
- Attachment directory.
- Number of article images and local note references.
- Number of code blocks and detected languages.
- Any images that failed to download or any code blocks left unlabeled because language was uncertain.