mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 08:08:34 +08:00
modify the directory structure and rename the function
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
14
src/main.ts
14
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}`);
|
||||
|
||||
@@ -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<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
|
||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||
const __content = yamlContent.__content
|
||||
@@ -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
|
||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||
const __content = yamlContent.__content
|
||||
Reference in New Issue
Block a user