1.1.1 • Published 1 year ago

remark-wiki-link-plus v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

  • Support [[Internal link]]
  • Support [[Internal link|With custom text]]
  • Support [[Internal link#heading]]
  • Support [[Internal link#heading|With custom text]]
  • Support ![[Document.pdf]]
  • Support ![[Image.png]]
  • 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:

  • Support ![[Audio.mp3]]
  • Support ![[Video.mp4]]
  • Support ![[Embed note]]
  • Support ![[Embed note#heading]]

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

  • options.markdownFolder [String]: A string that points to the content folder.

    The default hrefTemplate is:

(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.