Skip to content

JoshuaKGoldberg/notion-rich-text-to-markdown

Repository files navigation

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.

About

Converts Notion's rich text strings to Markdown. 🪢

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published