From dd152dcd562946bafb12d81ff982e77c72b7ffef Mon Sep 17 00:00:00 2001 From: GooRoo Date: Mon, 23 Sep 2024 23:38:08 +0200 Subject: [PATCH] Add support of embedding audio/video files and YouTube Closes #17. --- README.md | 23 ++++++++++++++++++++--- mkdocs_obsidian_bridge/plugin.py | 2 +- pyproject.toml | 3 ++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 769a206..41348c8 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,24 @@ plugins: - obsidian-bridge ``` +### Embedding of media files + +If you want to have Obsidian-like embedding of audio and video files or even YouTube videos, enable it in your `mkdocs.yml` like this: + +```yaml +markdown_extensions: + - obsidian_media_mkdocs +``` + +More information on this feature can be found here: [**GooRoo/obsidian-media**](https://github.com/GooRoo/obsidian-media). + ## Why one more plugin? I wouldn't ever write this one if I could achieve what I need with other ones. Maybe, I just couldn't find the solution, but here we are. +
+ Comparison to others (possibly, outdated) + ### Differences to [Autolinks Plugin](https://github.com/zachhannum/mkdocs-autolinks-plugin) 1. **Autolinks Plugin** doesn't try to resolve the shortest path out of the list of potential candidates. @@ -126,6 +140,8 @@ This one looked like a perfect choice for my needs, however: 1. I haven't tried this one, but it looks like **WikiLinks** is unable to automatically resolve paths at all without an additional (and a bit cumbersome) config. 2. Also, not sure if it supports all the [Obsidian][obsidian]'s features. +
+ --- ## Advanced topics @@ -182,9 +198,10 @@ plugins: My current preliminary roadmap is the following: -- [ ] Obsidian's [**callouts**](https://help.obsidian.md/How+to/Use+callouts) ➡️ MkDocs's [**admonitions**](https://python-markdown.github.io/extensions/admonition/) -- [ ] Support for Obsidian's [**nested tags**](https://help.obsidian.md/Plugins/Tags#Nested+tags) -- [ ] Obsidian's [**comments**](https://help.obsidian.md/How+to/Format+your+notes#Comments) `%% ... %%` ➡️ HTML comments `` +- [x] [Embedding of audio/video](https://help.obsidian.md/Linking+notes+and+files/Embed+files) +- [ ] Obsidian's [**callouts**](https://help.obsidian.md/Editing+and+formatting/Callouts) ➡️ MkDocs's [**admonitions**](https://python-markdown.github.io/extensions/admonition/) +- [ ] Support for Obsidian's [**nested tags**](https://help.obsidian.md/Editing+and+formatting/Tags#Nested+tags) +- [ ] Obsidian's [**comments**](https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax#Comments) `%% ... %%` ➡️ HTML comments `` I give no guarantees about the deadlines or whether I implement anything at all. I do it for myself and currently I do see a need, so probably I'll continue. diff --git a/mkdocs_obsidian_bridge/plugin.py b/mkdocs_obsidian_bridge/plugin.py index 09018eb..876b8a9 100644 --- a/mkdocs_obsidian_bridge/plugin.py +++ b/mkdocs_obsidian_bridge/plugin.py @@ -35,7 +35,7 @@ class ObsidianBridgePlugin(BasePlugin[ObsidianBridgeConfig]): Plugin to make obsidian or incomplete markdown links work. ''' - # from https://help.obsidian.md/Advanced+topics/Accepted+file+formats: + # from https://help.obsidian.md/Files+and+folders/Accepted+file+formats: OBSIDIAN_FORMATS = [ 'md', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg', diff --git a/pyproject.toml b/pyproject.toml index 9288811..f9da98b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [project] name = "mkdocs-obsidian-bridge" -version = "1.0.4" +version = "1.1.0" description = "An MkDocs plugin that helps exporting your Obsidian vault as an MkDocs site." authors = [{ name = "GooRoo", email = "sergey.olendarenko@gmail.com" }] license = "BSD-3-Clause" @@ -13,6 +13,7 @@ requires-python = ">=3.10,<4" dependencies = [ "mkdocs >=1.4.2", "markdown >=3.2.1", + "obsidian-media>=2.0.0", ] [project.entry-points."mkdocs.plugins"]