modify the directory structure and rename the function

This commit is contained in:
Jiaxin Peng
2023-11-02 14:32:25 +00:00
parent 9be9b18efb
commit ae9e0c14fb
8 changed files with 13 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import { FuzzySuggestModal, FuzzyMatch } from 'obsidian'; import { FuzzySuggestModal, FuzzyMatch } from 'obsidian';
import MyPlugin from "./main"; import MyPlugin from "./main";
import {i18nConfig} from "./I18n"; import {i18nConfig} from "./lang/I18n";
/** /**
* Simple interface for what should be displayed and stored for suggester * Simple interface for what should be displayed and stored for suggester

View File

@@ -1,4 +1,4 @@
import {i18nConfig} from "src/I18n"; import {i18nConfig} from "src/lang/I18n";
import MyPlugin from "src/main"; import MyPlugin from "src/main";
import {Editor, MarkdownView} from "obsidian"; import {Editor, MarkdownView} from "obsidian";
import {FuzzySuggester, DatabaseList} from "./FuzzySuggester"; import {FuzzySuggester, DatabaseList} from "./FuzzySuggester";

View File

@@ -1,8 +1,8 @@
import {App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting} from "obsidian"; import {App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting} from "obsidian";
import {addIcons} from 'src/icon'; import {addIcons} from 'src/ui/icon';
import {Upload2Notion} from "src/Upload2Notion"; import {Upload2NotionGeneral} from "src/upload/Upload2NotionGeneral";
import {Upload2NotionNext} from "src/Upload2Notion_NN"; import {Upload2NotionNext} from "src/upload/Upload2NotionNext";
import {i18nConfig} from "src/I18n"; import {i18nConfig} from "src/lang/I18n";
import ribbonCommands from "src/NotionCommands"; import ribbonCommands from "src/NotionCommands";
// Remember to rename these classes and interfaces! // Remember to rename these classes and interfaces!
@@ -88,14 +88,16 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
if (markDownData) { if (markDownData) {
const {basename} = nowFile; const {basename} = nowFile;
let upload; let upload;
let res;
if (NNon) { if (NNon) {
upload = new Upload2NotionNext(this); 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 { } 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) { if (res.status === 200) {
new Notice(`${i18nConfig["sync-success"]}${basename}`); new Notice(`${i18nConfig["sync-success"]}${basename}`);

View File

@@ -6,7 +6,7 @@ import * as yamlFrontMatter from "yaml-front-matter";
// import * as yaml from "yaml" // import * as yaml from "yaml"
import MyPlugin from "src/main"; import MyPlugin from "src/main";
export class Upload2Notion extends UploadBase { export class Upload2NotionGeneral extends UploadBase {
constructor(plugin: MyPlugin) { constructor(plugin: MyPlugin) {
super(plugin); 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<any> { 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<any> {
let res: any let res: any
const yamlContent: any = yamlFrontMatter.loadFront(markdown); const yamlContent: any = yamlFrontMatter.loadFront(markdown);
const __content = yamlContent.__content const __content = yamlContent.__content

View File

@@ -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<any> { 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<any> {
let res: any let res: any
const yamlContent: any = yamlFrontMatter.loadFront(markdown); const yamlContent: any = yamlFrontMatter.loadFront(markdown);
const __content = yamlContent.__content const __content = yamlContent.__content