mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-08-01 11:00:54 +08:00
update the script and support both notionnext and general database
This commit is contained in:
48
src/main.ts
48
src/main.ts
@@ -1,11 +1,11 @@
|
||||
import {App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting} from "obsidian";
|
||||
import {addIcons} from 'src/ui/icon';
|
||||
import {Upload2NotionGeneral} from "src/upload/Upload2NotionGeneral";
|
||||
import {Upload2NotionNext} from "src/upload/Upload2NotionNext";
|
||||
import {Upload2NotionGeneral} from "src/upload/upload_general/Upload2NotionGeneral";
|
||||
import {Upload2NotionNext} from "src/upload/upload_next/Upload2NotionNext";
|
||||
import {i18nConfig} from "src/lang/I18n";
|
||||
import ribbonCommands from "src/commands/NotionCommands";
|
||||
import { ObsidianSettingTab, PluginSettings, DEFAULT_SETTINGS } from "src/ui/settingTabs";
|
||||
import {getNowFileMarkdownContent} from "src/upload/getMarkdown";
|
||||
|
||||
// Remember to rename these classes and interfaces!
|
||||
|
||||
|
||||
@@ -43,48 +43,6 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
||||
onunload() {
|
||||
}
|
||||
|
||||
// async uploadCommand() {
|
||||
// const {notionAPI, databaseID, NNon} = this.settings;
|
||||
//
|
||||
// // Check if NNon exists
|
||||
// if (NNon === undefined) {
|
||||
// const NNonmessage = i18nConfig.NNonMissing;
|
||||
// new Notice(NNonmessage);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // Check if the user has set up the Notion API and database ID
|
||||
// if (notionAPI === "" || databaseID === "") {
|
||||
// const setAPIMessage = i18nConfig["set-api-id"];
|
||||
// new Notice(setAPIMessage);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const {markDownData, nowFile, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime} = await getNowFileMarkdownContent(this.app, this.settings)
|
||||
//
|
||||
// if (markDownData) {
|
||||
// const {basename} = nowFile;
|
||||
// let upload;
|
||||
// let res;
|
||||
//
|
||||
// if (NNon) {
|
||||
// upload = new Upload2NotionNext(this);
|
||||
// res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app, this.settings);
|
||||
// } else {
|
||||
// upload = new Upload2NotionGeneral(this);
|
||||
// res = await upload.syncMarkdownToNotionGeneral(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app, this.settings);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (res.status === 200) {
|
||||
// new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||
// } else {
|
||||
// new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
async loadSettings() {
|
||||
this.settings = Object.assign(
|
||||
{},
|
||||
|
||||
Reference in New Issue
Block a user