Transclude \ Embed external files (audio, videos, pdfs) present on the computer outside the vault

You’re right, sorry. Still, I think @gkertai is talking about a new idea.

I’m not sure to what extent the Better File Link plugin fails to meet this request.

Can embed Obsidian compatible files from anywhere on computer.

2 Likes

Yes, you’re right.

Thanks for the tip @Dor !

I tried Better File Link for embedding. Unfortunately it copies all embedded .md files into the target vault, which defeats the purpose of transclusion.

Obsidian link embeds of the ![SomeFile](obsidian://open?vault=SomeVault&file=SomeFile) form do not work even with the plugin installed.

I suppose it depends on the purpose. For me, I mostly use transclusion of other files as a way of collecting files for viewing or export. If I want to prepare a file with many transclusions of files from all over the file system for export, I’d just start a new vault, use the plugin to add the files and delete the vault when I’ve done with it.

No. Only seems to import the file to embed and uses the wikilink format to do that.
Though I’m not sure why you would want to use an obsidian:// format rather than a simpler file lin - not that it makes any difference to embedding. The plugin doesn’t transcend Obsidian functionality, but it does give a convenient approach within Obsidian’s limits.

Though I’m not sure why you would want to use an obsidian:// format rather than a simpler file lin - not that it makes any difference to embedding.

Unlike file: links, obsidian: URLs would work even if the target vault is moved to another location (eg. onto an external volume). They would also work when the vaults are synced across multiple computers at differing file paths (eg. different volume names or user accounts). I am using the latter approach extensively.

All this assumes that the files are actually linked to, as opposed to being copied.

My experimenting with media

This works
<video src="file:///mnt/path/to/my/video.mp4" controls></video>
as workaround to
![](file:///mnt/path/to/my/video.mp4)

This works
<audio src="file:///mnt/path/to/my/audio.mp3" controls></audio>
as workaround to
![](file:///mnt/path/to/my/audio.mp3)

12 Likes

My preference for this would be to add external folders to the Obsidian search path. So I can add an image from my Photos folder just as if it were in the vault, like ![[IMG_4035.JPG]]. This way I don’t have to clog up the vault with duplicated images, etc but I also don’t have the fragility of absolute file paths.

This approach is similar to how Workspaces work in VSCode.

3 Likes

For now I’ve happened upon what I believe is a decent solution: Zoho workdrive. They’re quite a bit like google drive, but they have one killer feature: they can generate an iframe embed for your uploaded files (both individually and entire folders). I’ve been using this as my file storage for obsidian — upload, get the iframe, insert into obsidian.

This has a lot of nice benefits:

  1. Device agnostic without needing to sync the files external to Obsidian.
  2. Supports some formats unsupported by Obsidian, like HEIC and videos (they Just Work when embedded).
  3. The iframe media viewer works great. Images can be zoomed in or viewed full screen. Videos can be full screen and have playback speed changed.
  4. If you want to share the media in your vault, just share the iframe src field.

It’s a bit more work up front but so far I’m finding it to be a really great experience.

4 Likes

Use case or problem

As a user with an extensive PDF library managed on my filesystem with 3rd-party tools (e.g., Zotero, DevonTHINK, etc.) outside of my Obsidian vaults, I would like to be able to embed the PDFs in Obsidian notes from their location on the filesystem.

Proposed solution

Enable the same syntax for PDFs that allows remote embedding of images, namely:

![Remote PDF](file:///Users/timj/Desktop/File.pdf)

Current workaround (optional)

No known workaround.

Related feature requests (optional)

No known feature requests, though it is mentioned in this post.

Thanks!

24 Likes

Is this not more of a bug? As your post rightfully states, embedding an image from outside the vault works fine, while for some reason it does not work with pdfs.

PDFs don’t natively display like images. Although I can understand the reasoning behind calling this a bug, the code complexity of displaying a PDF makes this a completely new feature (from the software angle).

I understand, however, in-vault pdfs work right? So the whole embedding code, however complex, does work, just the link to a file outside the vault doesn’t

So in-vault PDFs display embedded?

Yes, they do (seems like it is using the internal chromium engine)

Even in Markdown preview?

What do you mean? If you mean the normal preview mode, then yes. And as far as I know, no plugin that I am using affects this.
Have you tried putting a pdf in your vauilt and embedding it? I am using 0.12.3 with the newest electron.

It looks like Obsidian’s parser treats anything file:// or remote (https://) as an img node automatically, while it does some filtering of files inside the vault (probably by extension, since renaming the .pdf to a .not file broke the embed preview). Detection by MIME type is possible, but a lot trickier. It sounds like they just need to add the same extension filtering to externally included files, which is less work than I was originally thinking (thank you for clarifying some of my confusion!).

2 Likes

i think even batter than that would be a feature that treats zotero links as local pdfs in vault. It is so necessary

5 Likes

You can do a workaround.

  1. create a symlink from zotero-storage into your vault (mac: ln -s “FROM” “TO” win: mklink /D “TO” “FROM”)
  2. Now Zoteros PDFs will be as if they are in your vault, even though technically they are not.
  3. If you used zotfile and betterbibtex, you can make Zotero rename the PDF files as citekeys.
  4. When pulling data into Obsidian either with Citations or Zotero Integration Plugins, you will can use ![[{{citekey}}]] which will render to ![[Zhai-2022.pdf]] for example and then display as an embedded PDF.

Hope tha thelps.
More tips on Academia: ilyashabanov.substack.com

1 Like