remark-wiki-link-plus
remark-wiki-link-plus copied to clipboard
File embedding e.g. image, pdf, audio etc using transclusion syntax
See https://help.obsidian.md/How+to/Embed+files
You can embed attachment files like images or audio in your notes. Use the ![[filename.png]] syntax like so
File types supported (note we may support more e.g. everything web browser supports)
Obsidian recognizes the following file formats right now:
Markdown files: md; Image files: png, jpg, jpeg, gif, bmp, svg; Audio files: mp3, webm, wav, m4a, ogg, 3gp, flac; Video files: mp4, webm, ogv, mov, mkv; PDF files: pdf.
Acceptance
- [x] Image embedding #1
- [x] #4
- [ ] Audio embedding
- [ ] Video embedding
- [ ] Markdown embedding (transclusion)
I've been stumped on the transclusion of MD content in my own personal remark plugin for Obsidian. Major issue is it's a cart-horse problem since you can't know what to embed into that transclusion until after it's been parsed. I've had a few ideas to solve this, thought I'd share:
- Use an iframe this is the gross way, but it'd work
- Move this to a rehype plugin
- Attempt to parse the transcluded file
The first idea is bad and shouldn't be used.
The second idea is cumbersome, but ought to be largely foolproof. Just insert a node in place of the transcluded MD syntax and then in a rehype plugin grab that freshly parsed content and embed it.
The third is what I am using (and the remark-obsidian plugin is as well) but it's got a lot of edge cases and other issues.
@ispringle very useful analysis. Agree this one (i.e. full page embedding) is not simple.