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
.
See .github/CONTRIBUTING.md
, then .github/DEVELOPMENT.md
.
Thanks! πͺ’
Dimitri Mitropoulos π» π π π€ π π§ π π§ |
Josh Goldberg β¨ π» π π π€ π π§ π π§ |
π This package was templated with
create-typescript-app
using the Bingo engine.