Support Obsidian wiki link syntax in publishing to website
rufuspollock opened this issue · 1 comments
Obsidian extends basic markdown with special wiki-link syntax, transclusion and tags. As per https://obsidian.md/features
- **[[Internal links]]**
- **![[Filename]]** to embed notes and other files
Acceptance
- New remark plugin repo called
remark-wiki-obsidian
See https://github.com/life-itself/remark-wiki-link-plus
Supports these types of links:
-
[[Internal link]]
-
[[Internal link|With custom text]]
-
[[Internal link#heading]]
-
[[Internal link#heading|With custom text]]
🚩 NB we assume that internal links are the right path - we don't do any kind of resolution. This is important to flag (?) somewhere as default obsidian behaviour is shortest path e.g. if actual path is abc/mynote.md
obsidian with just have [[mynote]]
Transclusion links
May as well as do these even if for things other than images they won't really work.
🚩 need to think about how to do transclusion for things other than images. PDFs especially would be nice. (Other markdown docs is a bit complex as it requires an ability to pull that content ...)
-
![[Embed image or note path]]
=> (in markdown)![](Embed image or note path)
-
![[Embed note#heading]]
❌ leave for now ...
Tasks
- Research if existing remark plugin solutions exist ✅ Rufus has researched quickly and best option is below.
- Create a new folder
- Write a test (best if we can copy over!), probably just for basic string parser - we are doing TDD 😄
- Get test passing
- Get a proper test for remark plugin
- Get it passing
- Add docs to README
- Publish to npm
Notes
existing remark solutions
- https://github.com/johackim/gatsby-remark-obsidian **Pretty good but is somehow gatsby-ish. Simplest would be to extract the core (LGPL licensed i believe) into a new repo plus tests and see if all works
- https://github.com/landakram/remark-wiki-link **Up to date remark plugin that we could probably reuse as base. However, has a different wiki syntax it is parsing for. One option would be to fork this plugin and
Fixed all major tasks except for transclusion links.