0.1.2 • Published 1 year ago

notion-to-mdx v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

notion-to-mdx WIP

npm version

Generate MarkdownX articles from Notion pages.

This project aims to synchronize remote pages on Notion with local MarkdownX files:

  • Each page found in a Notion database is converted into a MarkdownX file.
  • Images are downloaded and stored locally.
  • Links to Notion pages are replaced with links to the generated MarkdownX files.

It was mainly designed so that the generated files can be processed by the mdx plugin of Gatsby to generate blog content. Of course, it can be used for any other purpose.

Roadmap

  • Synchronize pages from a Notion database with MarkdownX files.
  • Download images and store them locally.
  • Replace links to Notion pages with links to the generated MarkdownX files.
  • Default implementation for TableOfContents, PageMention, LinkPreview, etc.
  • Notion source: wiki.
  • Source: page.
  • Support the child_page block.
  • Documentation.
  • Getting started.

Usage

import synchronizeNotionPages from "notion-to-mdx";

synchronizeNotionPages([
  {
    notionToken: "<your-notion-token>",
    type: "database",
    id: "<database-id>",
    outputDir: "./output/pages",
    basePath: "/pages"
  }
]);

API

synchronizeNotionPages(sources: NotionSource[])

Synchronizes Notion pages with MarkdownX files.

NotionSource

interface NotionSource {
  notionToken: string;
  type: "database" | "page" | "wiki";
  id: string;
  outputDir: string;
  basePath: string;
}
0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago