lunan65 downloadsImport external Markdown files while resolving images from their original disk folders.
English | 简体中文
MdAssetSync imports external Markdown files into Obsidian while preserving the original disk location used to resolve local assets. A link such as ./assets/image.png is resolved from the external Markdown file's original folder, then the image or optional attachment is copied into the location configured in Obsidian.
This plugin requires Obsidian 1.13.0 or later on desktop and uses Node.js filesystem access.
.md files, or select a folder to recursively import its .md and .markdown files. Hidden folders and node_modules are skipped../ and ../.<img> sources, and local file:// URIs..main.js and manifest.json from the 1.1.2 GitHub release.<Vault>/.obsidian/plugins/md-asset-sync/.main.js and manifest.json into that folder.Node.js 18 or newer is required.
npm install
npm run build
Copy main.js and manifest.json to the plugin folder in the vault.
The Markdown destination and the attachment destination are independent. Changing the Markdown target folder does not change where assets are stored.
MdAssetSync needs local filesystem access to import files from outside the Vault. It reads only the external Markdown files you explicitly select and the local assets referenced by those files. Unless you enable remote image downloads, this plugin does not upload content, make network requests, or collect telemetry.
Imported Markdown, images, and attachments are written to the Vault through Obsidian's Vault API. MdAssetSync lists Vault folders only to populate the searchable Markdown destination picker and reads the active note's folder to offer it as a shortcut; it does not use direct filesystem access to inspect Vault note contents.
| Obsidian attachment setting | MdAssetSync destination |
|---|---|
| Same folder as the current file | Markdown file's folder |
| Subfolder under the current file's folder | That subfolder beside the imported Markdown file |
| Vault folder | The configured vault folder |
| Setting unavailable | assets beside the imported Markdown file |
Existing attachments are checked by MD5 when the file names match. Matching content is reused. Different content follows the configured same-name strategy.
Use Sync non-image attachments in the plugin settings to choose a mode:
| Mode | Behavior |
|---|---|
| Off | Only image syntax is synchronized |
| PDF and office documents | Synchronizes PDF, Word, Excel, PowerPoint, TXT, RTF, and CSV files |
| All local attachments | Synchronizes every local file type except note-oriented .md, .markdown, .canvas, and .base files |
| Custom file extensions | Synchronizes only extensions listed in the custom extension field |
Custom extensions can be separated with commas or spaces. Leading dots are optional, and values are normalized case-insensitively. For example:
pdf, docx, xlsx, epub, .drawio
Supported non-image syntax includes:
[guide](./files/guide.pdf)[report][doc] with [doc]: ../files/report.xlsx[[manual.pdf|Open manual]]![[recording.mp3]]<a href="./files/data.csv">Open data</a>Images are always rewritten to ![](). Non-image attachments retain their original link or embed syntax so Obsidian can keep opening or previewing the correct file type.
Open Settings → Community plugins → MdAssetSync and choose Plugin language:
The default is English. The command, settings, dialogs, progress messages, notifications, and import-result dialog use the selected language.
Supported:
![image][photo] with [photo]: ./photo.png![[./assets/photo.png]] and ![[photo.png|alt text]]<img src="./photo.png" alt="image">file:///C:/Images/photo.pngC:/Images/photo.png[guide](./files/guide.pdf) for optional non-image attachments[[manual.pdf|Open manual]] and ![[recording.mp3]] for optional non-image attachmentsNot processed:
data: base64 images-import-N suffix rather than overwriting it.See CHANGELOG.md.
This project is licensed under the GNU General Public License v3.0 only.
MdAssetSync 1.0.0 was distributed under the MIT License. GPL-3.0-only applies to version 1.0.1 and later.