Add support for notion link display in the front matter.

This commit is contained in:
Jiaxin Peng
2024-07-03 22:35:47 +01:00
parent 24ebb0bf8a
commit 70f30f0713
4 changed files with 13 additions and 33 deletions

View File

@@ -33,6 +33,8 @@ export const en = {
NotionUserDesc: NotionUserDesc:
"Collect from share link likes:https://username.notion.site. Your notion id is [username]", "Collect from share link likes:https://username.notion.site. Your notion id is [username]",
NotionUserText: "Enter your notion ID", NotionUserText: "Enter your notion ID",
NotionLinkDisplay: "Notion Link Display",
NotionLinkDisplayDesc: "Default is ON, if you want to hide the link in the front matter, please turn it off",
NotionGeneralSettingHeader: "General Notion Database Settings", NotionGeneralSettingHeader: "General Notion Database Settings",
NotionGeneralButton: "Notion General Sync", NotionGeneralButton: "Notion General Sync",
NotionGeneralButtonDesc: "Open this option, Sync to Notion General Database command will be displayed in the command palette (default: ON)", NotionGeneralButtonDesc: "Open this option, Sync to Notion General Database command will be displayed in the command palette (default: ON)",

View File

@@ -31,6 +31,8 @@ export const ja = {
NotionUser: "Notion IDユーザー名、任意", NotionUser: "Notion IDユーザー名、任意",
NotionUserDesc: "共有リンクから取得https://username.notion.site。Notion IDは[username]です", NotionUserDesc: "共有リンクから取得https://username.notion.site。Notion IDは[username]です",
NotionUserText: "Notion IDを入力", NotionUserText: "Notion IDを入力",
NotionLinkDisplay: "Notionリンク表示",
NotionLinkDisplayDesc: "デフォルトはONです。front matterにリンクを非表示にしたい場合は、オフにしてください",
NotionGeneralSettingHeader: "一般的なNotionデータベース設定", NotionGeneralSettingHeader: "一般的なNotionデータベース設定",
NotionGeneralButton: "一般的なNotion同期", NotionGeneralButton: "一般的なNotion同期",
NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されますデフォルトON", NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されますデフォルトON",

View File

@@ -33,6 +33,8 @@ export const zh = {
NotionUserDesc: NotionUserDesc:
"数据库分享链接类似https://username.notion.site/。你的 Notion ID 是 [username]", "数据库分享链接类似https://username.notion.site/。你的 Notion ID 是 [username]",
NotionUserText: "输入你的 Notion ID", NotionUserText: "输入你的 Notion ID",
NotionLinkDisplay: "Notion 链接显示",
NotionLinkDisplayDesc: "默认开启如果你不想在front matter中显示链接请关闭",
NotionGeneralSettingHeader: "普通 Notion 数据库设置", NotionGeneralSettingHeader: "普通 Notion 数据库设置",
NotionGeneralButton: "普通数据库同步", NotionGeneralButton: "普通数据库同步",
NotionGeneralButtonDesc: "打开此选项,同步到普通数据库命令将显示在命令面板中(默认:开)", NotionGeneralButtonDesc: "打开此选项,同步到普通数据库命令将显示在命令面板中(默认:开)",

View File

@@ -13,6 +13,7 @@ export interface PluginSettings {
databaseIDNext: string; databaseIDNext: string;
bannerUrl: string; bannerUrl: string;
notionUser: string; notionUser: string;
NotionLinkDisplay: boolean;
proxy: string; proxy: string;
GeneralButton: boolean; GeneralButton: boolean;
tagButton: boolean; tagButton: boolean;
@@ -37,7 +38,7 @@ export interface DatabaseDetails {
tagButton: boolean; tagButton: boolean;
customTitleButton: boolean; customTitleButton: boolean;
customTitleName: string; customTitleName: string;
customProperties:{ customName: string, customType: string }[]; customProperties:{ customName: string, customType: string, index: number}[];
// customValues: string; // customValues: string;
saved: boolean; saved: boolean;
} }
@@ -48,6 +49,7 @@ export const DEFAULT_SETTINGS: PluginSettings = {
databaseIDNext: "", databaseIDNext: "",
bannerUrl: "", bannerUrl: "",
notionUser: "", notionUser: "",
NotionLinkDisplay: true,
proxy: "", proxy: "",
GeneralButton: true, GeneralButton: true,
tagButton: true, tagButton: true,
@@ -84,6 +86,10 @@ export class ObsidianSettingTab extends PluginSettingTab {
this.createSettingEl(containerEl, i18nConfig.NotionUser, i18nConfig.NotionUserDesc, 'text', i18nConfig.NotionUserText, this.plugin.settings.notionUser, 'notionUser') this.createSettingEl(containerEl, i18nConfig.NotionUser, i18nConfig.NotionUserDesc, 'text', i18nConfig.NotionUserText, this.plugin.settings.notionUser, 'notionUser')
this.createSettingEl(containerEl, i18nConfig.NotionLinkDisplay, i18nConfig.NotionLinkDisplayDesc, 'toggle', i18nConfig.NotionLinkDisplay, this.plugin.settings.NotionLinkDisplay, 'NotionLinkDisplay')
// TODO: add toggle to enable or disable link display
// add new button // add new button
@@ -132,38 +138,6 @@ export class ObsidianSettingTab extends PluginSettingTab {
// list all created database // list all created database
this.showDatabase(); this.showDatabase();
// // notion next database settings
//
// const NextTabs = new SettingNextTabs(this.app, this.plugin, this);
//
// NextTabs.display();
//
//
// // General Database Settings
// const GeneralTabs = new SettingGeneralTabs(this.app, this.plugin, this);
//
// GeneralTabs.display();
// Custom Database Settings
// containerEl.createEl('h2', {text: i18nConfig.NotionCustomSettingHeader});
//
// new Setting(containerEl)
// .setName(i18nConfig.NotionCustomButton)
// .setDesc(i18nConfig.NotionCustomButtonDesc)
// .addToggle((toggle) =>
// toggle
// .setValue(this.plugin.settings.CustomButton)
// .onChange(async (value) => {
// this.plugin.settings.CustomButton = value;
// await this.plugin.saveSettings();
// })
// );
} }
// create a function to create a div with a style for pop over elements // create a function to create a div with a style for pop over elements