diff --git a/src/FuzzySuggester.ts b/src/FuzzySuggester.ts index eeba6f4..bdf5420 100644 --- a/src/FuzzySuggester.ts +++ b/src/FuzzySuggester.ts @@ -1,6 +1,6 @@ import { FuzzySuggestModal, FuzzyMatch } from 'obsidian'; import MyPlugin from "./main"; -import {i18nConfig} from "./I18n"; +import {i18nConfig} from "./lang/I18n"; /** * Simple interface for what should be displayed and stored for suggester diff --git a/src/NotionCommands.ts b/src/NotionCommands.ts index 63a77c7..89cd10a 100644 --- a/src/NotionCommands.ts +++ b/src/NotionCommands.ts @@ -1,4 +1,4 @@ -import {i18nConfig} from "src/I18n"; +import {i18nConfig} from "src/lang/I18n"; import MyPlugin from "src/main"; import {Editor, MarkdownView} from "obsidian"; import {FuzzySuggester, DatabaseList} from "./FuzzySuggester"; diff --git a/src/I18n.ts b/src/lang/I18n.ts similarity index 100% rename from src/I18n.ts rename to src/lang/I18n.ts diff --git a/src/main.ts b/src/main.ts index b23ce00..ef1ad29 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ import {App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting} from "obsidian"; -import {addIcons} from 'src/icon'; -import {Upload2Notion} from "src/Upload2Notion"; -import {Upload2NotionNext} from "src/Upload2Notion_NN"; -import {i18nConfig} from "src/I18n"; +import {addIcons} from 'src/ui/icon'; +import {Upload2NotionGeneral} from "src/upload/Upload2NotionGeneral"; +import {Upload2NotionNext} from "src/upload/Upload2NotionNext"; +import {i18nConfig} from "src/lang/I18n"; import ribbonCommands from "src/NotionCommands"; // Remember to rename these classes and interfaces! @@ -88,14 +88,16 @@ export default class ObsidianSyncNotionPlugin extends Plugin { 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 Upload2Notion(this); + 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); } - const res = await upload.syncMarkdownToNotion(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}`); diff --git a/src/icon.ts b/src/ui/icon.ts similarity index 100% rename from src/icon.ts rename to src/ui/icon.ts diff --git a/src/BaseUpload2Notion.ts b/src/upload/BaseUpload2Notion.ts similarity index 100% rename from src/BaseUpload2Notion.ts rename to src/upload/BaseUpload2Notion.ts diff --git a/src/Upload2Notion.ts b/src/upload/Upload2NotionGeneral.ts similarity index 91% rename from src/Upload2Notion.ts rename to src/upload/Upload2NotionGeneral.ts index 20a87a6..5a3e85f 100644 --- a/src/Upload2Notion.ts +++ b/src/upload/Upload2NotionGeneral.ts @@ -6,7 +6,7 @@ import * as yamlFrontMatter from "yaml-front-matter"; // import * as yaml from "yaml" import MyPlugin from "src/main"; -export class Upload2Notion extends UploadBase { +export class Upload2NotionGeneral extends UploadBase { constructor(plugin: MyPlugin) { super(plugin); } @@ -155,7 +155,7 @@ export class Upload2Notion extends UploadBase { } } - async syncMarkdownToNotion(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, markdown: string, nowFile: TFile, app: App, settings: any): Promise { + async syncMarkdownToNotionGeneral(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, markdown: string, nowFile: TFile, app: App, settings: any): Promise { let res: any const yamlContent: any = yamlFrontMatter.loadFront(markdown); const __content = yamlContent.__content diff --git a/src/Upload2Notion_NN.ts b/src/upload/Upload2NotionNext.ts similarity index 95% rename from src/Upload2Notion_NN.ts rename to src/upload/Upload2NotionNext.ts index aa94f54..a38972f 100644 --- a/src/Upload2Notion_NN.ts +++ b/src/upload/Upload2NotionNext.ts @@ -155,7 +155,7 @@ export class Upload2NotionNext extends UploadBase { } } - async syncMarkdownToNotion(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, markdown: string, nowFile: TFile, app: App, settings: any): Promise { + async syncMarkdownToNotionNext(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, markdown: string, nowFile: TFile, app: App, settings: any): Promise { let res: any const yamlContent: any = yamlFrontMatter.loadFront(markdown); const __content = yamlContent.__content