Embed and link local files outside your obsidian vault with relative paths for cross-device and multi-platform compatibility.
- Embed external files (Markdown, PDF, Images, Audio, Video) outside your obsidian vault.
- Create links to files outside your obsidian vault that open with system default applications.
- Reference files using paths relative to Home directory or Vault directory for cross-device and cross-platform compatibility.
- Provide commands to add embeds or links via file picker.
- Support drag & drop to create embeds or links.
You can embed files using paths relative to your Home directory. For example, if your Home path is C:\Users\username
, you can embed a PDF file from C:\Users\username\SynologyDrive\work\Document.pdf
like this:
```EmbedRelativeToHome
SynologyDrive/work/Document.pdf
```
This will be rendered in Live Preview and Reading Mode as:
If your Obsidian vault is located at C:\Users\username\SynologyDrive\obsidian
, you can embed the same file using a path relative to your vault:
```EmbedRelativeToVault
../work/Document.pdf
```
Using relative paths ensures compatibility across different computers and operating systems, especially useful when syncing files with services like SynologyDrive.
Almost the same as Obsidian's Accepted file formats documentation except for JSON Canvas files.
- Markdown:
.md
,.markdown
,.txt
- Images:
.avif
,.bmp
,.gif
,.jpeg
,.jpg
,.png
,.svg
,.webp
- Audio:
.flac
,.m4a
,.mp3
,.ogg
,.wav
,.webm
,.3gp
- Video:
.mkv
,.mov
,.mp4
,.ogv
,.webm
- PDF:
.pdf
Following Obsidian's Embed files documentation, this plugin supports parameters for controlling display behavior:
Add header name after #
to embed only the header section:
```EmbedRelativeToHome
SynologyDrive/work/Document.md#This is a header
```
Add parameters after #
to control page number, width, and height:
```EmbedRelativeToHome
SynologyDrive/work/Document.pdf#page=3&width=100%&height=80vh
```
Add dimensions after |
to control size:
```EmbedRelativeToHome
Downloads/test.png|400
```
```EmbedRelativeToHome
Videos/test.mp4|800x600
```
If you don't need to render the file content in Reading Mode, you can create links to external files:
This is a pdf file outside of the vault:
```LinkRelativeToHome
Downloads/sample.pdf
```
This will be rendered as:
For inline links within paragraphs, use:
This is a <a class=LinkRelativeToHome>Downloads/sample.pdf</a> outside of the vault.
Which renders as:
Type "external" in the command palette to see available options:
Create embeds or links by holding modifier keys (ctrl
, shift
, ctrl+shift
) while dragging files.
Modifier keys can be customized in the plugin settings:
This project uses PDF.js for PDF rendering, which is made available under the Apache License 2.0. A copy of the PDF.js license can be found in the LICENSE
file of the PDF.js repository.
If you distribute this project or its binaries, please ensure that you include the appropriate copyright and license notices as required by the Apache License 2.0.
For more information on PDF.js and its contributors, visit the official GitHub repository.