# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['mkdocs_obsidian_bridge']

package_data = \
{'': ['*']}

install_requires = \
['markdown>=3.2.1,<3.4', 'mkdocs>=1.4.2,<2.0.0']

entry_points = \
{'mkdocs.plugins': ['obsidian-bridge = '
                    'mkdocs_obsidian_bridge.plugin:ObsidianBridgePlugin']}

setup_kwargs = {
    'name': 'mkdocs-obsidian-bridge',
    'version': '1.0.1',
    'description': 'An MkDocs plugin that helps exporting your Obsidian vault as an MkDocs site.',
    'long_description': '# [Obsidian][obsidian] ➡️ [MkDocs][mkdocs] Bridge\n\n[![Made by Ukrainian](https://img.shields.io/static/v1?label=Made%20by&message=Ukrainian&labelColor=1f5fb2&color=fad247&style=flat-square)](https://github.com/GooRoo/ukrainian-shields)\n[![License](https://img.shields.io/github/license/GooRoo/mkdocs-obsidian-bridge?style=flat-square)](LICENSE)\n\nAn MkDocs plugin that helps exporting your [Obsidian](https://obsidian.md) vault as an MkDocs site.\n\n## What it does\n\nI 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:\n\n- Auto-expand incomplete [Markdown links](https://help.obsidian.md/How+to/Format+your+notes#Links)\n- Auto-expand incomplete [Obsidian\'s internal links](https://help.obsidian.md/How+to/Internal+link)\n- Detect and mark invalid links (to style them differently)\n\n### Auto-expanding incomplete links\n\nBy auto-expanding I mean that you don\'t need to write a full path to the page you are linking to (exactly like in [Obsidian][obsidian]). Consider the following folder structure:\n\n```\ndocs/\n├── 2021/\n│   ├── Books.md\n│   └── Games.md\n└── 2022/\n    └── Sport.md\n```\n\nIf you are editing `Sport.md`, you could write:\n```md\n[Books](../2021/Books.md)\n```\nbut with this plugin you can just drop the path:\n```md\n[Books](Books.md)\n```\nor even write the [Obsidian][obsidian] way:\n```md\n[[Books]]\n```\n\n#### Name clashes\n\nWhat if you have `Books.md` in both 2021 and 2022?\n\n```\ndocs/\n├── 2021/\n│   ├── Books.md\n│   └── Games.md\n└── 2022/\n    ├── Books.md\n    └── Sport.md\n```\n\nBy default, the plugin tried to find the shortest relative path (again, like [Obsidian][obsidian]), e.g.\n```md\n[[Books]]\n```\nis translated into:\n```md\n[Books](./Books.md)\n```\n\nBut you can also give the resolver _a hint_ by specifying the path **partially:**\n```md\n[[2021/Books]]\n```\nor\n```md\n[Books](2021/Books.md)\n```\n\nBoth variants work equivalently.\n\n## How to enable\n\nInstall the plugin with:\n\n```sh\npip install mkdocs-obsidian-bridge\n```\n\nThe plugin depends on some features of Python 3.10, so this is the minimum required version.\n\nThen you can enable it in your `mkdocs.yml` config:\n\n```yaml\nplugins:\n  - obsidian-bridge\n```\n\n## Why one more plugin?\n\nI 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.\n\n### Differences to [Autolinks Plugin](https://github.com/zachhannum/mkdocs-autolinks-plugin)\n\n1. **Autolinks Plugin** doesn\'t try to resolve the shortest path out of the list of potential candidates.\n2. It also doesn\'t support incomplete relative paths. In other words, it works only with file names.\n\n### Differences to [Roamlinks Plugin](https://github.com/Jackiexiao/mkdocs-roamlinks-plugin)\n\nThis 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:\n\n1. As well as **Autolinks Plugin**, the **Roamlinks Plugin** does not try to match the best path if there several of those, does it?\n2. Also, in case it can\'t resolve the `[[Roam link]]`, it leaves it as a text, while [**Obsidian Bridge**](https://github.com/GooRoo/mkdocs-obsidian-bridge) still transforms it into the Markdown link although invalid one.\n\n### Differences to [EZLinks Plugin](https://github.com/orbikm/mkdocs-ezlinks-plugin)\n\nThis one looked like a perfect choice for my needs, however:\n\n1. I didn\'t spent much time playing with it, but **EZLinks Plugin** generated incorrect links for me. Probably because it doesn\'t resolve any incomplete paths as well as two previous plugins.\n2. At the same time, it **does** convert the `[[internal links]]` into actual links.\n3. 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.\n\n### Differences to [WikiLinks](https://python-markdown.github.io/extensions/wikilinks/) extension for [Python-Markdown](https://github.com/Python-Markdown/markdown/)\n\n1. 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.\n2. Also, not sure if it supports all the [Obsidian][obsidian]\'s features.\n\n---\n\n## Advanced topics\n\n### Styling of invalid links\n\n<details>\n  <summary>See for yourself!</summary>\n\n\nThe plugin translates [Obsidian][obsidian]-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.\n\nIn order to do that, you should add an `invalid_link_attributes` config option to your `mkdocs.yml` **AND** enable the `attr_list` Markdown extension:\n\n```yaml\nmarkdown_extensions:\n  - attr_list\n\nplugins:\n  - obsidian-bridge:\n      invalid_link_attributes:\n        - \'.invalid\'\n\nextra_css:\n  - stylesheets/extra.css\n```\n\nThe `.invalid` in this example translates to `class="invalid"` HTML attribute accordingly to the rules of [**Attribute Lists**](https://python-markdown.github.io/extensions/attr_list/) extension.\n\nAfter that, you can extend `extra.css` with some style (just don\'t forget to add `extra_css` property to your `mkdocs.yml` too as above):\n\n```css\na.invalid {\n  color: red;\n}\n```\n\nAlternatively, if your style is going to be simple, you can just write it in the attribute itself as following:\n\n```yaml\nmarkdown_extensions:\n  - attr_list\n\nplugins:\n  - obsidian-bridge:\n      invalid_link_attributes:\n        - \'style="color: red"\'\n```\n</details>\n\n---\n\n## What\'s next\n\nMy current preliminary roadmap is the following:\n\n- [ ] Obsidian\'s [**callouts**](https://help.obsidian.md/How+to/Use+callouts) ➡️ MkDocs\'s [**admonitions**](https://python-markdown.github.io/extensions/admonition/)\n- [ ] Support for Obsidian\'s [**nested tags**](https://help.obsidian.md/Plugins/Tags#Nested+tags)\n- [ ] Obsidian\'s [**comments**](https://help.obsidian.md/How+to/Format+your+notes#Comments) `%% ... %%` ➡️ HTML comments `<!-- ... -->`\n\nI 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.\n\n### Feedback\n\nI do appreciate any kind of constructive feedback.\n\n* If you found a bug, please, [report it](https://github.com/GooRoo/mkdocs-obsidian-bridge/issues/new).\n* If you want to request a feature, please, [post an idea](https://github.com/GooRoo/mkdocs-obsidian-bridge/discussions/new?category=Ideas).\n* In all other cases, don\'t hesitate to [start a discussion](https://github.com/GooRoo/mkdocs-obsidian-bridge/discussions/new).\n\n\n[mkdocs]: https://www.mkdocs.org\n[obsidian]: https://obsidian.md\n',
    'author': 'GooRoo',
    'author_email': 'sergey.olendarenko@gmail.com',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
