Sinevia / fork-html-to-notion

Convert raw HTML into Notion blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML to Notion blocks

This library allows you to convert an HTML string into Notion blocks that you can directly use for the Notion API

Getting started

yarn add html-to-notion
import parseHtmlToNotionBlocks from '../src/lib/parser';

const rawHtml = `<p>Hi!</p>`;

const notionBlocks = parseHtmlToNotionBlocks(rawHtml);

// [
//  {
//    object: "block",
//    paragraph: {
//      text: [{ text: { content: "Hi" }, type: "text" }],
//    },
//    type: "paragraph",
//  },
//];

To-Do

  • Support lists
  • Support decorated texts

About

Convert raw HTML into Notion blocks

License:GNU Affero General Public License v3.0


Languages

Language:TypeScript 99.9%Language:JavaScript 0.1%