remark plugin to support OFM (callouts, tags, wikilinks).
This package is a unified(remark) plugin to enable the extensions to markdown that Obsidian adds with OFM. You can use this plugin to add support for parsing and serializing them. For full support you should combine it with other packages like 'remark-gfm'.
This project is useful if you want to support OFM in your markdown.
If you just want to turn markdown into HTML (with maybe a few extensions such as GFM), we recommend micromark
with micromark-extension-ofm
instead.
If you don’t use plugins and want to access the syntax tree, you can use mdast-util-from-markdown
with mdast-util-ofm
.
This package is ESM only. In Node.js (version 18+), install with npm
:
npm install @moritzrs/remark-ofm
import remarkOfm from "@moritzrs/remark-ofm";
import remarkParse from "remark-parse";
import remarkStringify from "remark-stringify";
import { unified } from "unified";
const file = await unified()
.use(remarkParse)
.use(remarkOfm)
.use(remarkStringify)
.process("> [!info]+ Hey There\n> #tag\n> [[link]]");
console.log(String(file));
Yields
> [!info]+ Hey There
> #tag
> [[link]]
This package exports no identifiers. The default export is remarkOfm
.
Add support for OFM (callouts, tags, wikilinks).
none
Nothing (undefined
).
This package was tested to work with node version 18
and later.
-
micromark-extension-ofm
- support for all of OFM in micromark -
mdast-util-ofm
- support for all of OFM in mdast
I don't know if i can check PRs in a timely manner, but feel free to open PRs or issues. If participation is high I will need to add a code of conduct and contribution guidelines.
This package is not affiliated with Obsidian.md or the developers of Obsidian.md.
MIT © Moritz R. Schulz