Skip to content

Commit

Permalink
Add support of embedding audio/video files and YouTube
Browse files Browse the repository at this point in the history
Closes #17.
  • Loading branch information
GooRoo committed Sep 23, 2024
1 parent 9e0f4fe commit dd152dc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<details>
<summary>Comparison to others (possibly, outdated)</summary>

### 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.
Expand All @@ -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.

</details>

---

## Advanced topics
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion mkdocs_obsidian_bridge/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" }]
license = "BSD-3-Clause"
Expand All @@ -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"]
Expand Down

0 comments on commit dd152dc

Please sign in to comment.