mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 08:08:34 +08:00
feat: support long notes syncing
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { i18nConfig } from "../lang/I18n";
|
||||
import { App, Notice } from "obsidian";
|
||||
import { Upload2NotionNext } from "./upload_next/Upload2NotionNext";
|
||||
import { Upload2NotionGeneral } from "./upload_general/Upload2NotionGeneral";
|
||||
import { Upload2NotionCustom } from "./upoload_custom/Upload2NotionCustom";
|
||||
import { DatabaseDetails, PluginSettings } from "../ui/settingTabs";
|
||||
import {i18nConfig} from "../lang/I18n";
|
||||
import {App, Notice} from "obsidian";
|
||||
import {Upload2NotionNext} from "./upload_next/Upload2NotionNext";
|
||||
import {Upload2NotionGeneral} from "./upload_general/Upload2NotionGeneral";
|
||||
import {Upload2NotionCustom} from "./upoload_custom/Upload2NotionCustom";
|
||||
import {DatabaseDetails, PluginSettings} from "../ui/settingTabs";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import { getNowFileMarkdownContentNext } from "./upload_next/getMarkdownNext";
|
||||
import { getNowFileMarkdownContentGeneral } from "./upload_general/getMarkdownGeneral";
|
||||
import { getNowFileMarkdownContentCustom } from "./upoload_custom/getMarkdownCustom";
|
||||
import {getNowFileMarkdownContentNext} from "./upload_next/getMarkdownNext";
|
||||
import {getNowFileMarkdownContentGeneral} from "./upload_general/getMarkdownGeneral";
|
||||
import {getNowFileMarkdownContentCustom} from "./upoload_custom/getMarkdownCustom";
|
||||
|
||||
export async function uploadCommandNext(
|
||||
plugin: ObsidianSyncNotionPlugin,
|
||||
@@ -16,7 +16,7 @@ export async function uploadCommandNext(
|
||||
app: App,
|
||||
) {
|
||||
|
||||
const { notionAPI, databaseID } = dbDetails;
|
||||
const {notionAPI, databaseID} = dbDetails;
|
||||
|
||||
// Check if the user has set up the Notion API and database ID
|
||||
if (notionAPI === "" || databaseID === "") {
|
||||
@@ -42,12 +42,12 @@ export async function uploadCommandNext(
|
||||
} = await getNowFileMarkdownContentNext(app, settings)
|
||||
|
||||
if (markDownData) {
|
||||
const { basename } = nowFile;
|
||||
const {basename} = nowFile;
|
||||
|
||||
const upload = new Upload2NotionNext(plugin, dbDetails);
|
||||
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
||||
|
||||
const { response } = res;
|
||||
const {response} = res;
|
||||
if (response.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
@@ -65,7 +65,7 @@ export async function uploadCommandGeneral(
|
||||
app: App,
|
||||
) {
|
||||
|
||||
const { notionAPI, databaseID } = dbDetails;
|
||||
const {notionAPI, databaseID} = dbDetails;
|
||||
|
||||
// Check if the user has set up the Notion API and database ID
|
||||
if (notionAPI === "" || databaseID === "") {
|
||||
@@ -74,15 +74,15 @@ export async function uploadCommandGeneral(
|
||||
return;
|
||||
}
|
||||
|
||||
const { markDownData, nowFile, cover, tags } = await getNowFileMarkdownContentGeneral(app, settings)
|
||||
const {markDownData, nowFile, cover, tags} = await getNowFileMarkdownContentGeneral(app, settings)
|
||||
|
||||
if (markDownData) {
|
||||
const { basename } = nowFile;
|
||||
const {basename} = nowFile;
|
||||
|
||||
const upload = new Upload2NotionGeneral(plugin, dbDetails);
|
||||
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
||||
|
||||
const { response } = res;
|
||||
const {response} = res;
|
||||
if (response.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
@@ -100,7 +100,7 @@ export async function uploadCommandCustom(
|
||||
app: App,
|
||||
) {
|
||||
|
||||
const { notionAPI, databaseID } = settings;
|
||||
const {notionAPI, databaseID} = settings;
|
||||
|
||||
// Check if the user has set up the Notion API and database ID
|
||||
if (notionAPI === "" || databaseID === "") {
|
||||
@@ -109,15 +109,15 @@ export async function uploadCommandCustom(
|
||||
return;
|
||||
}
|
||||
|
||||
const { markDownData, nowFile, cover, customValues } = await getNowFileMarkdownContentCustom(app, dbDetails)
|
||||
const {markDownData, nowFile, cover, customValues} = await getNowFileMarkdownContentCustom(app, dbDetails)
|
||||
|
||||
if (markDownData) {
|
||||
const { basename } = nowFile;
|
||||
const {basename} = nowFile;
|
||||
|
||||
const upload = new Upload2NotionCustom(plugin, dbDetails);
|
||||
const res = await upload.syncMarkdownToNotionCustom(cover, customValues, markDownData, nowFile, this.app);
|
||||
|
||||
const { response } = res;
|
||||
const {response} = res;
|
||||
if (response.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user