remark-wiki-link-plus
Parse and render wiki-style links in markdown especially Obsidian style links.
What is this ?
Using obsidian, when we type in wiki link syntax for eg. [[wiki_link]]
it would parse them as anchors.
Features supported
- Supported image formats are jpg, jpeg, png, apng, webp, gif, svg, bmp, ico
- Unsupported image formats display a message for eg.
![[Image.xyz]]
would render the following:
Document type XYZ is not yet supported for transclusions
Future support:
Installation
npm install remark-wiki-link-plus
Usage
const unified = require('unified')
const markdown = require('remark-parse')
const wikiLinkPlugin = require('remark-wiki-link-plus');
let processor = unified()
.use(markdown, { gfm: true })
.use(wikiLinkPlugin)
Configuration options
(permalink) => `/${permalink}`
Running the tests
npm run test
Change Log
[1.1.1] - 2022-11-14
Fixed
- Permalinks not linking to case sensitive url paths
- eg. before
[[Page]]
generates href="/page"
but will now generate href="/Page"
[1.1.0] - 2022-09-06
Added
- Add support for more image formats
- apng, webp, gif, svg, bmp, ico
- Add support for PDF documents
- Add warning for unsupported image formats
[1.0.2] - 2022-08-11
Added
- Add support for transclusion links / image links
- png, jpg, jpeg
[1.0.1] - 2022-08-04
Changed
- permalink for folders with an index file will tranform to folder name only.
For example, if the wikilink is [[docs/index]] the href will be '/docs'.
Fixed
- broken links to filenames that matched the markdown folder name.