Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 4.48 KB

README.md

File metadata and controls

65 lines (52 loc) · 4.48 KB

Notion Rich Text to Markdown

Converts Notion's rich text strings to Markdown. 🪢

👪 All Contributors: 2 🤝 Code of Conduct: Kept 🧪 Coverage 📝 License: MIT 📦 npm version 💪 TypeScript: Strict

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

Dimitri Mitropoulos
Dimitri Mitropoulos

💻 🖋 📖 🤔 🚇 🚧 📆 🔧
Josh Goldberg ✨
Josh Goldberg ✨

💻 🖋 📖 🤔 🚇 🚧 📆 🔧

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