跳到主要内容

Notion Markdown 导出

本示例介绍如何从 Notion 仪表板导出的 Notion 页面加载数据。

首先,按照此处的官方说明,将您的 Notion 页面导出为 Markdown 和 CSV 格式。 确保选择“include subpages”和“Create folders for subpages”。

然后,解压缩下载的文件并将解压缩的文件夹移动到您的存储库中。 它应该包含您的页面的 Markdown 文件。

将文件夹放入您的存储库后,只需运行以下示例

import { NotionLoader } from "@langchain/community/document_loaders/fs/notion";

export const run = async () => {
/** Provide the directory path of your notion folder */
const directoryPath = "Notion_DB";
const loader = new NotionLoader(directoryPath);
const docs = await loader.load();
console.log({ docs });
};

API 参考

  • NotionLoader 来自 @langchain/community/document_loaders/fs/notion

此页面对您有帮助吗?


您也可以留下详细的反馈 在 GitHub 上.