Compare commits
No commits in common. "body-formatting" and "main" have entirely different histories.
body-forma
...
main
4
index.js
4
index.js
|
|
@ -2,7 +2,6 @@
|
|||
import 'dotenv/config'
|
||||
import { Client } from '@notionhq/client'
|
||||
import Joplin from './joplin.js'
|
||||
import render from './joplinToNotionFormatting.js'
|
||||
|
||||
const joplin = new Joplin(process.env.JOPLIN_TOKEN, process.env.JOPLIN_CLIPPER_PORT)
|
||||
const notion = new Client({auth: process.env.NOTION_TOKEN});
|
||||
|
|
@ -14,8 +13,7 @@ const notionDatabaseID = process.env.NOTION_DATABASE_ID;
|
|||
async function processNotes() {
|
||||
const data = await joplin.getNotesFromNotebook(joplinNotebookID, ["title", "body", "created_time", "updated_time"])
|
||||
for (let note of data) {
|
||||
render(note.body)
|
||||
// addPageToNotionDatabase(notionDatabaseID, note.title, note.body)
|
||||
addPageToNotionDatabase(notionDatabaseID, note.title, note.body)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
import { marked } from 'marked'
|
||||
|
||||
function render (md) {
|
||||
const result = marked.parse(md)
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
function renderParagraph(pTag) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default render
|
||||
|
|
@ -7,7 +7,6 @@
|
|||
"dependencies": {
|
||||
"@notionhq/client": "^2.1.1",
|
||||
"dotenv": "^16.0.1",
|
||||
"marked": "^4.0.18",
|
||||
"node-fetch": "^3.2.10"
|
||||
}
|
||||
},
|
||||
|
|
@ -142,17 +141,6 @@
|
|||
"node": ">=12.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "4.0.18",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.18.tgz",
|
||||
"integrity": "sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw==",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
|
|
@ -324,11 +312,6 @@
|
|||
"fetch-blob": "^3.1.2"
|
||||
}
|
||||
},
|
||||
"marked": {
|
||||
"version": "4.0.18",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.18.tgz",
|
||||
"integrity": "sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
"dependencies": {
|
||||
"@notionhq/client": "^2.1.1",
|
||||
"dotenv": "^16.0.1",
|
||||
"marked": "^4.0.18",
|
||||
"node-fetch": "^3.2.10"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue