gatsby-source-notion-api
Advanced tools
Comparing version
{ | ||
"name": "gatsby-source-notion-api", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Gatsby source plugin for official Notion.so API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,7 @@ const { pipeExtend } = require("or-pipets") | ||
const annotateEquation = ifTrue( | ||
pick("equation"), | ||
({ content }) => ({ content: `$${content}$` }), | ||
id, | ||
) | ||
const annotateBold = ifTrue(pick("bold"), ({ content }) => ({ content: `**${content}**` }), id) | ||
@@ -42,2 +47,3 @@ const annotateItalic = ifTrue(pick("italic"), ({ content }) => ({ content: `_${content}_` }), id) | ||
.pipeExtend(annotateLink) | ||
.pipeExtend(annotateEquation) | ||
@@ -51,2 +57,7 @@ exports.blockToString = (textBlocks) => | ||
if (textBlock.type == "equation") { | ||
data.content = textBlock.equation.expression | ||
data.equation = true | ||
} | ||
if (textBlock.type == "mention") { | ||
@@ -53,0 +64,0 @@ if (textBlock.mention.type == "user") { |
const fetch = require("node-fetch") | ||
const { errorMessage } = require("../error-message") | ||
exports.getBlocks = async ({ id, block, notionVersion, token }, reporter) => { | ||
exports.getBlocks = async ({ id, notionVersion, token }, reporter) => { | ||
let hasMore = true | ||
@@ -28,3 +28,3 @@ let blockContent = [] | ||
childBlock.children = await this.getBlocks( | ||
{ id: childBlock.id, block: childBlock, notionVersion, token }, | ||
{ id: childBlock.id, notionVersion, token }, | ||
reporter, | ||
@@ -31,0 +31,0 @@ ) |
@@ -20,3 +20,3 @@ const fetch = require("node-fetch") | ||
for (let page of db.results) { | ||
page.children = await getBlocks({ id: page.id, block: page, token, notionVersion }, reporter) | ||
page.children = await getBlocks({ id: page.id, token, notionVersion }, reporter) | ||
} | ||
@@ -23,0 +23,0 @@ |
16590
1.31%251
4.15%