notion-rich-text-to-markdown

Converts Notion's rich text strings to Markdown. 🪢

MIT License

Downloads
9
Stars
3

Usage

npm i notion-rich-text-to-markdown
import { notionRichTextToMarkdown } from "notion-rich-text-to-markdown";

notionRichTextToMarkdown({
	annotations: {
		italic: true,
	},
	href: "https://hi.joshuakgoldberg.com",
	plain_text: "Click me!",
	type: "text",
});
// Returns:
// "_[Click me!](https://hi.joshuakgoldberg.com)_"

notionRichTextToMarkdown accepts an object like data in Notion's Rich Text API response. That shape is described by the RichTextItemResponse in @notionhq/client.

Contributors

💙 This package was templated with create-typescript-app.

Package Rankings
Top 31.86% on Npmjs.org