# Csdn Blog To Obsidian Note

> Convert a user-authored CSDN blog URL into an Obsidian Markdown note while preserving original text order, images, code blocks, formulas, and local attachment behavior. Use when the user provides a CSDN blog/article link and wants it pasted or inserted into an Obsidian note/vault, especially with local compressed images and code fence language labels.

- Skill: `harrison0523/csdn-blog-to-obsidian-note` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add harrison0523/csdn-blog-to-obsidian-note`
- Raw SKILL.md: https://api.skillmd.com/api/skills/harrison0523/csdn-blog-to-obsidian-note/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: Harrison0523 (https://skillmd.com/u/harrison0523)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/harrison0523/csdn-blog-to-obsidian-note

---


# CSDN Blog To Obsidian Note

## Workflow

Use this skill when the user says the CSDN article is their own or otherwise authorizes verbatim conversion.

1. Ask for the Obsidian target note path if the user did not provide it.
2. Use `scripts/csdn_to_obsidian.py` instead of rewriting ad hoc conversion code.
3. Prefer writing only the target note and its configured/nearby attachment folder.
4. Preserve article order: title, text, images, code blocks, lists, tables, links, and formulas.
5. Download images and reference local files from the note.
6. Convert images to WebP by default when Pillow is available, matching typical Obsidian image-converter behavior.
7. 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.
8. Verify counts before reporting: image refs in note, copied images, code fence languages, output paths.

## Default Command

Run from any workspace:

```powershell
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-block` updates a managed block between markers and preserves content outside it. This is the default.
- `--mode append` appends a new managed block.
- `--attachment-dir "D:\...\images"` overrides where images are stored.
- `--image-prefix MCP` controls generated image names such as `MCP-01.webp`.
- `--format webp` or `--format original` controls attachment format.
- `--quality 75` controls 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 `![alt](./images/MCP-01.webp)` for portability.
- Do not edit `.obsidian` plugin configs unless the user explicitly asks.
- If the user requires plugin-exact behavior, inspect `.obsidian/plugins/obsidian-image-converter/data.json` read-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.

