Converts Notion's rich text strings to Markdown. 🪢
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
.
Dimitri Mitropoulos 💻 🖋 📖 🤔 🚇 🚧 📆 🔧 |
Josh Goldberg ✨ 💻 🖋 📖 🤔 🚇 🚧 📆 🔧 |
💙 This package was templated with
create-typescript-app
.