Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moritzrs/mdast-util-ofm-tag
mdast extensions to support Obsidian Flavored Markdown (OFM) tags
https://github.com/moritzrs/mdast-util-ofm-tag
markdown mdast mdast-util obsidian
Last synced: 27 days ago
JSON representation
mdast extensions to support Obsidian Flavored Markdown (OFM) tags
- Host: GitHub
- URL: https://github.com/moritzrs/mdast-util-ofm-tag
- Owner: MoritzRS
- License: mit
- Created: 2024-10-16T17:43:22.000Z (29 days ago)
- Default Branch: main
- Last Pushed: 2024-10-16T17:43:25.000Z (29 days ago)
- Last Synced: 2024-10-18T13:18:56.131Z (28 days ago)
- Topics: markdown, mdast, mdast-util, obsidian
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# mdast-util-ofm-tag
[mdast](https://github.com/syntax-tree/mdast) extensions to support Obsidian Flavored Markdown (OFM) [tags](https://help.obsidian.md/Editing+and+formatting/Tags).
## Contents
- From Markdown Extension
- To Markdown Extension## Installation
This package is **ESM only**, install latest version with `npm`:
```bash
npm install https://github.com/moritzrs/mdast-util-ofm-tag
```## Usage
```javascript
import { fromMarkdown } from "mdast-util-from-markdown";
import { toMarkdown } from "mdast-util-to-markdown";
import { ofmTag } from "micromark-extension-ofm-tag";
import { ofmTagFromMarkdown, ofmTagToMarkdown } from "mdast-util-ofm-tag";const markdown = "This is a #tag.";
const tree = fromMarkdown(markdown, {
extensions: [ofmTag()],
mdastExtensions: [ofmTagFromMarkdown()],
});const result = toMarkdown(tree, {
extensions: [ofmTagToMarkdown()],
});console.log(result); // "This is a #tag."
```## Related
- [micromark-extension-ofm-tag](https://github.com/moritzrs/micromark-extension-ofm-tag) - micromark extension to parse OFM tags.
## Disclaimer
This package is not affiliated with Obsidian.md or the developers of Obsidian.md.
## License
[MIT](LICENSE.md) © Moritz R. Schulz