A plugin for Python-Markdown that allows you to embed media files as in Obsidian.
Project description
Obsidian media embedder
This is an extension for Python-Markdown which allows you to embed audio or video files as easily as images by simply writing:
![my song](assets/music/my-last-song.mp3)
![my video](assets/video/interview.webm)
Additionally, this plugins allows to specify an image size the Obsidian way, e.g.:
![400x300](assets/images/photo.jpg) <!-- width and height -->
![400](assets/images/photo.jpg) <!-- only width -->
Supported formats are:
- Images:
avif
,bmp
,gif
,jpeg
,jpg
,png
,svg
,webp
. - Audio:
mp3
,wav
,m4a
,ogg
,3gp
,flac
. - Video:
mp4
,webm
,ogv
,mov
,mkv
. - Other:
not yet.md
,pdf
And even more than that! It embeds youtube videos too!
![](https://youtu.be/dQw4w9WgXcQ)
Usage
Simply enable the extension like this:
import markdown
md = markdown.Markdown(extensions=['obsidian_media'])
print(md.convertFile('page.md'))
MkDocs
It can be used with MkDocs as following:
# mkdocs.yml
markdown_extensions:
- obsidian_media_mkdocs
For the best results, I recommend using it together with my mkdocs-obsidian-bridge. This would allow you to simply write:
![[assets/audio/my favourite song.mp3]]
![[assets/video/birthday party.mov]]
![[images/photo.jpg|400x300]]
![[images/photo.jpg|200]]
Credits
This extension is heavily inspired by orobardet/pymarkdown-video and motivated by @pipe-organ in GooRoo/mkdocs-obsidian-bridge#17.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file obsidian_media-2.0.0.tar.gz
.
File metadata
- Download URL: obsidian_media-2.0.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ba18569f60d2ea747f8fdb72f979bbd265b2ef1305c95ef82d5efe21c7fca5 |
|
MD5 | 1fac0f76953498c98119a2e4da30a0f4 |
|
BLAKE2b-256 | 2afa99965ada8a2c84195dcd26ca72efc2f4bf515059a075625bcc8269d2abb7 |
File details
Details for the file obsidian_media-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: obsidian_media-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c1370cf2f6c488ab18fdfd1be1b07ae475d30983c8481dc6ba7836e85f75970 |
|
MD5 | b593890c0da21125d618f695a7283ce2 |
|
BLAKE2b-256 | 1811f83635e9bb098cbda2ad035bd1f27f48f6cce27aa954a0e11fb735184b4d |