remark-parse-obsidian v1.0.0
remark-obsidian
A remark plugin to extend support to Obsidian-flavored Markdown.
Contents
What is this?
This package is a unified (remark) package that extends Markdown to support Obsidian flavors.
The list of Supported Obsidian Markdown items are:
Syntax | Description |
---|---|
[[Link]] | Internal Links |
![[Link]] | Embed Files |
![[Link#^id]] | Block References |
^id | Defining a Block |
%%Text%% | Comments |
~~Text~~ | Strikethroughs |
==Text== | Highlights |
``` | Code Blocks | |
- [ ] | Incomplete Task |
- [x] | Completed Task |
[!note] | Callouts |
Obsidian's website notes that not all these are fully Obsidian-specific. The main reason I wrote this plugin is for Link and Callout support.
Install
This package is ESM only. In Node.js (version 16+), install using npm
:
npm install @thecae/remark-obsidian
Use
Most definitions are self-explanatory from the above table. However, it is worth mentioning the various Callout syntaxes available.
Use the Obsidian Callouts guide for further instruction.
This plugin is best used with remark-gfm, rehype-raw, and remark-wiki-link-plus.
API
This package exports no identifiers. The default export is remarkObsidian
.
unified().use(remarkObsidian)
Provides support for Obsidian-flavored Markdown, including tables, callouts, links, embeds, and more.
To get full use of the package, ensure you include Obsidian-compliant variables. Then, import the CSS file inside the global.css
file:
@import "@thecae/remark-obsidian/obsidian.module.css";
Parameters
There are no parameters.
Returns
Transform (Transformer
).
Security
Use of remark-videos does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks.
License
MIT © C. Ellis
10 months ago