Package: mkdocs-obsidian-bridge
Obsidian➡️MkDocsBridgeAn MkDocs plugin that helps exporting yourObsidianvault as an MkDocs site.What it doesI began writing this plugin to simplify exporting my Obsidian vault to GitHub Pages using MkDocs. The plugin is still in development since there are a lot more features that could possibly be implemented, however, currently it has the following features:Auto-expand incompleteMarkdown linksAuto-expand incompleteObsidian's internal linksDetect and mark invalid links (to style them differently)Auto-expanding incomplete linksBy auto-expanding I mean that you don't need to write a full path to the page you are linking to (exactly like inObsidian). Consider the following folder structure:docs/
├── 2021/
│   ├── Books.md
│   └── Games.md
└── 2022/
    └── Sport.mdIf you are editingSport.md, you could write:[Books](../2021/Books.md)but with this plugin you can just drop the path:[Books](Books.md)or even write theObsidianway:[[Books]]Name clashesWhat if you haveBooks.mdin both 2021 and 2022?docs/
├── 2021/
│   ├── Books.md
│   └── Games.md
└── 2022/
    ├── Books.md
    └── Sport.mdBy default, the plugin tried to find the shortest relative path (again, likeObsidian), e.g.[[Books]]is translated into:[Books](./Books.md)But you can also give the resolvera hintby specifying the pathpartially:[[2021/Books]]or[Books](2021/Books.md)Both variants work equivalently.How to enableInstall the plugin with:pipinstallmkdocs-obsidian-bridgeThe plugin depends on some features of Python 3.10, so this is the minimum required version.Then you can enable it in yourmkdocs.ymlconfig:plugins:-obsidian-bridgeWhy 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.Differences toAutolinks PluginAutolinks Plugindoesn't try to resolve the shortest path out of the list of potential candidates.It also doesn't support incomplete relative paths. In other words, it works only with file names.Differences toRoamlinks PluginThis one, actually, was the reason why I started developing my own plugin in the first place. However, it had the following drawbacks for my use-case:As well asAutolinks Plugin, theRoamlinks Plugindoes not try to match the best path if there several of those, does it?Also, in case it can't resolve the[[Roam link]], it leaves it as a text, whileObsidian Bridgestill transforms it into the Markdown link although invalid one.Differences toEZLinks PluginThis one looked like a perfect choice for my needs, however:I didn't spent much time playing with it, butEZLinks Plugingenerated incorrect links for me. Probably because it doesn't resolve any incomplete paths as well as two previous plugins.At the same time, itdoesconvert the[[internal links]]into actual links.It has no ability to distinguish between valid and invalid[[internal links]]. Maybe it could be solved by another plugin, but I haven't searched for it.Differences toWikiLinksextension forPython-MarkdownI haven't tried this one, but it looks likeWikiLinksis unable to automatically resolve paths at all without an additional (and a bit cumbersome) config.Also, not sure if it supports all theObsidian's features.Advanced topicsStyling of invalid linksSee for yourself!The plugin translatesObsidian-style[[internal links]]to markdown[internal links](internal%20links)even if the resulting link is invalid. If you want to distinguish such links from the rest, you can assign them a custom CSS style.In order to do that, you should add aninvalid_link_attributesconfig option to yourmkdocs.ymlANDenable theattr_listMarkdown extension:markdown_extensions:-attr_listplugins:-obsidian-bridge:invalid_link_attributes:-'.invalid'extra_css:-stylesheets/extra.cssThe.invalidin this example translates toclass="invalid"HTML attribute accordingly to the rules ofAttribute Listsextension.After that, you can extendextra.csswith some style (just don't forget to addextra_cssproperty to yourmkdocs.ymltoo as above):a.invalid{color:red;}Alternatively, if your style is going to be simple, you can just write it in the attribute itself as following:markdown_extensions:-attr_listplugins:-obsidian-bridge:invalid_link_attributes:-'style="color:red"'What's nextMy current preliminary roadmap is the following:Obsidian'scallouts➡️ MkDocs'sadmonitionsSupport for Obsidian'snested tagsObsidian'scomments%% ... %%➡️ 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.FeedbackI do appreciate any kind of constructive feedback.If you found a bug, please,report it.If you want to request a feature, please,post an idea.In all other cases, don't hesitate tostart a discussion.