1.8.0 • Published 9 months ago

remark-obsidian v1.8.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
9 months ago

remark-obsidian

Version License

Remark plugin to support Obsidian markdown syntax.

Requirements

  • Nodejs >= 14

Features

  • Support > [!CALLOUT]
  • Support ==highlight text==
  • Support [[Internal link]]
  • Support [[Internal link|With custom text]]
  • Support [[Internal link#heading]]
  • Support [[Internal link#heading|With custom text]]
  • Support ![[Embed note]]
  • Support ![[Embed note#heading]]

Installation

yarn add -D remark-obsidian

Usage

With remark :

import { remark } from 'remark';
import remarkObsidian from 'remark-obsidian';

const html = String(await remark().use(remarkObsidian).process('[[Hello world]]'));
console.log(html); // <a href="/hello-world">Hello world</a>

With unified :

import { unified } from 'unified'
import remarkObsidian from 'remark-obsidian';
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import rehypeStringify from 'rehype-stringify';

const { value } = unified()
    .use(remarkParse)
    .use(remarkObsidian)
    .use(remarkRehype, { allowDangerousHtml: true })
    .use(rehypeStringify, { allowDangerousHtml: true })
    .processSync('[[Hello world]]');

console.log(value); // <a href="/hello-world">Hello world</a>

Running the tests

npm test

License

This project is licensed under the GNU GPL v3.0 - see the LICENSE file for details

Free Software, Hell Yeah!

1.8.0

9 months ago

1.7.0

9 months ago

1.6.0

9 months ago

1.5.0

10 months ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.0.0

2 years ago