From f4bdc56d715a25ea2f6df1868a0f3e65158a9d47 Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Sun, 10 Apr 2022 04:01:03 +0000 Subject: [PATCH 1/5] typos in en.ts follwoing --> following valut --> vault --- src/lang/locale/en.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 1bc9a92..ef17665 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -264,11 +264,11 @@ export default { MD_CSS_DESC: "The filename of the CSS to apply to markdown embeds. Provide the filename with extension (e.g. 'md-embed.css'). The css file may also be a plain " + "markdown file (e.g. 'md-embed-css.md'), just make sure the content is written using valid css syntax. " + - "If you need to look at the HTML code you are applying the CSS to, then open Obsidian Developer Console (CTRL+SHIFT+i) and type in the follwoing command: " + + "If you need to look at the HTML code you are applying the CSS to, then open Obsidian Developer Console (CTRL+SHIFT+i) and type in the following command: " + '"ExcalidrawAutomate.mostRecentMarkdownSVG". This will display the most recent SVG generated by Excalidraw. ' + "Setting the font-family in the css is has limitations. By default only your operating system's standard fonts are available (see README for details). " + "You can add one custom font beyond that using the setting above. " + - 'You can override this css setting by adding the following frontmatter-key to the embedded markdown file: "excalidraw-css: css_file_in_valut|css-snippet".', + 'You can override this css setting by adding the following frontmatter-key to the embedded markdown file: "excalidraw-css: css_file_in_vault|css-snippet".', EMBED_HEAD: "Embed & Export", EMBED_REUSE_EXPORTED_IMAGE_NAME: "If found, use the already exported image for preview", EMBED_REUSE_EXPORTED_IMAGE_DESC: From 014179098507524b9de62da1307ecf6406203b1c Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Sun, 10 Apr 2022 04:19:50 +0000 Subject: [PATCH 2/5] Replace "suggestor" with "suggester" Replaced all instances of "suggestor" with "suggester" in the code and renamed src/FieldSuggestor.ts -> src/FieldSuggester.ts and src/SuggestorInfo.ts -> src/SuggesterInfo.ts --- src/{FieldSuggestor.ts => FieldSuggester.ts} | 8 ++++---- src/{SuggestorInfo.ts => SuggesterInfo.ts} | 8 ++++---- src/lang/locale/en.ts | 6 +++--- src/lang/locale/zh-cn.ts | 4 ++-- src/main.ts | 4 ++-- src/settings.ts | 12 ++++++------ 6 files changed, 21 insertions(+), 21 deletions(-) rename src/{FieldSuggestor.ts => FieldSuggester.ts} (94%) rename src/{SuggestorInfo.ts => SuggesterInfo.ts} (99%) diff --git a/src/FieldSuggestor.ts b/src/FieldSuggester.ts similarity index 94% rename from src/FieldSuggestor.ts rename to src/FieldSuggester.ts index 2072407..dc8d39a 100644 --- a/src/FieldSuggestor.ts +++ b/src/FieldSuggester.ts @@ -6,14 +6,14 @@ import { EditorSuggestTriggerInfo, TFile, } from "obsidian"; -import { FRONTMATTER_KEYS_INFO } from "./SuggestorInfo"; +import { FRONTMATTER_KEYS_INFO } from "./SuggesterInfo"; import { EXCALIDRAW_AUTOMATE_INFO, EXCALIDRAW_SCRIPTENGINE_INFO, -} from "./SuggestorInfo"; +} from "./SuggesterInfo"; import type ExcalidrawPlugin from "./main"; -export class FieldSuggestor extends EditorSuggest { +export class FieldSuggester extends EditorSuggest { plugin: ExcalidrawPlugin; suggestType: "ea" | "excalidraw" | "utils"; latestTriggerInfo: EditorSuggestTriggerInfo; @@ -28,7 +28,7 @@ export class FieldSuggestor extends EditorSuggest { editor: Editor, _: TFile, ): EditorSuggestTriggerInfo | null { - if (this.plugin.settings.fieldSuggestor) { + if (this.plugin.settings.fieldSuggester) { const sub = editor.getLine(cursor.line).substring(0, cursor.ch); const match = sub.match(/^excalidraw-(.*)$/)?.[1] ?? diff --git a/src/SuggestorInfo.ts b/src/SuggesterInfo.ts similarity index 99% rename from src/SuggestorInfo.ts rename to src/SuggesterInfo.ts index c31bb58..907cc8a 100644 --- a/src/SuggestorInfo.ts +++ b/src/SuggesterInfo.ts @@ -9,14 +9,14 @@ import { FRONTMATTER_KEY_MD_STYLE, } from "./Constants"; -type SuggestorInfo = { +type SuggesterInfo = { field: string; code: string; desc: string; after: string; }; -export const EXCALIDRAW_AUTOMATE_INFO: SuggestorInfo[] = [ +export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [ { field: "plugin", code: null, @@ -487,7 +487,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggestorInfo[] = [ }, ]; -export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggestorInfo[] = [ +export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggesterInfo[] = [ { field: "inputPrompt", code: "inputPrompt: (header: string, placeholder?: string, value?: string, buttons?: [{caption:string, action:Function}]);", @@ -505,7 +505,7 @@ export const EXCALIDRAW_SCRIPTENGINE_INFO: SuggestorInfo[] = [ }, ]; -export const FRONTMATTER_KEYS_INFO: SuggestorInfo[] = [ +export const FRONTMATTER_KEYS_INFO: SuggesterInfo[] = [ { field: "plugin", code: null, diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index ef17665..30c1ce0 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -340,9 +340,9 @@ export default { EXPERIMENTAL_HEAD: "Experimental features", EXPERIMENTAL_DESC: "Some of these setting will not take effect immediately, only when the File Explorer is refreshed, or Obsidian restarted.", - FIELD_SUGGESTOR_NAME: "Enable Field Suggestor", - FIELD_SUGGESTOR_DESC: - "Field Suggestor borrowed from Breadcrumbs and Templater plugins. The Field Suggestor will show an autocomplete menu " + + FIELD_SUGGESTER_NAME: "Enable Field Suggester", + FIELD_SUGGESTER_DESC: + "Field Suggester borrowed from Breadcrumbs and Templater plugins. The Field Suggester will show an autocomplete menu " + "when you type excalidraw- or ea. with function description as hints on the individual items in the list.", FILETYPE_NAME: "Display type (✏️) for excalidraw.md files in File Explorer", FILETYPE_DESC: diff --git a/src/lang/locale/zh-cn.ts b/src/lang/locale/zh-cn.ts index b4c95e9..07167b7 100644 --- a/src/lang/locale/zh-cn.ts +++ b/src/lang/locale/zh-cn.ts @@ -331,8 +331,8 @@ export default { EXPERIMENTAL_HEAD: "实验性功能", EXPERIMENTAL_DESC: "以下部分设置不会立即生效,需要刷新文件资源管理器或者重启 Obsidian 才会生效。", - FIELD_SUGGESTOR_NAME: "开启 Field Suggestor", - FIELD_SUGGESTOR_DESC: + FIELD_SUGGESTER_NAME: "开启 Field Suggester", + FIELD_SUGGESTER_DESC: "开启后,当您在编辑器中输入 excalidraw- 或者 ea. 时,会弹出一个带有函数说明的自动补全提示菜单。
" + "该功能借鉴了 Breadcrumbs 和 Templater 插件。", FILETYPE_NAME: "在文件浏览器中为 excalidraw.md 文件添加类型标识符(如 ✏️)", diff --git a/src/main.ts b/src/main.ts index fe145d6..3e13705 100644 --- a/src/main.ts +++ b/src/main.ts @@ -91,7 +91,7 @@ import { markdownPostProcessor, observer, } from "./MarkdownPostProcessor"; -import { FieldSuggestor } from "./FieldSuggestor"; +import { FieldSuggester } from "./FieldSuggester"; import { ReleaseNotes } from "./ReleaseNotes"; import { debug } from "./Utils"; @@ -181,7 +181,7 @@ export default class ExcalidrawPlugin extends Plugin { this.registerCommands(); this.registerEventListeners(); this.initializeFourthFont(); - this.registerEditorSuggest(new FieldSuggestor(this)); + this.registerEditorSuggest(new FieldSuggester(this)); //inspiration taken from kanban: //https://github.com/mgmeyers/obsidian-kanban/blob/44118e25661bff9ebfe54f71ae33805dc88ffa53/src/main.ts#L267 diff --git a/src/settings.ts b/src/settings.ts index 54ad62c..b8b289f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -66,7 +66,7 @@ export interface ExcalidrawSettings { experimentalLivePreview: boolean; experimentalEnableFourthFont: boolean; experimantalFourthFont: string; - fieldSuggestor: boolean; + fieldSuggester: boolean; //loadCount: number; //version 1.2 migration counter drawingOpenCount: number; library: string; @@ -139,7 +139,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = { experimentalLivePreview: true, experimentalEnableFourthFont: false, experimantalFourthFont: "Virgil", - fieldSuggestor: true, + fieldSuggester: true, compatibilityMode: false, //loadCount: 0, drawingOpenCount: 0, @@ -1098,13 +1098,13 @@ export class ExcalidrawSettingTab extends PluginSettingTab { this.containerEl.createEl("p", { text: t("EXPERIMENTAL_DESC") }); new Setting(containerEl) - .setName(t("FIELD_SUGGESTOR_NAME")) - .setDesc(fragWithHTML(t("FIELD_SUGGESTOR_DESC"))) + .setName(t("FIELD_SUGGESTER_NAME")) + .setDesc(fragWithHTML(t("FIELD_SUGGESTER_DESC"))) .addToggle((toggle) => toggle - .setValue(this.plugin.settings.fieldSuggestor) + .setValue(this.plugin.settings.fieldSuggester) .onChange(async (value) => { - this.plugin.settings.fieldSuggestor = value; + this.plugin.settings.fieldSuggester = value; this.applySettingsUpdate(); }), ); From 902eda0d79bcca861e48668468926bccea9ac587 Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Sun, 10 Apr 2022 04:31:42 +0000 Subject: [PATCH 3/5] capitalization fix for "excalidraw" in en.ts --- src/lang/locale/en.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 30c1ce0..6a6037d 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -97,7 +97,7 @@ export default { "Full filepath to the Excalidraw template. " + "E.g.: If your template is in the default Excalidraw folder and it's name is " + "Template.md, the setting would be: Excalidraw/Template.md (or just Excalidraw/Template - you may ommit the .md file extension). " + - "If you are using Excalidraw in compatibility mode, then your template must be a legacy excalidraw file as well " + + "If you are using Excalidraw in compatibility mode, then your template must be a legacy Excalidraw file as well " + "such as Excalidraw/Template.excalidraw.", SCRIPT_FOLDER_NAME: "Excalidraw Automate script folder", SCRIPT_FOLDER_DESC: @@ -167,7 +167,7 @@ export default { "Specifies the mode how Excalidraw opens: Normal, Zen, or View mode. You may also set this behaviour on a file level by " + "adding the excalidraw-default-mode frontmatter key with a value of: normal,view, or zen to your document.", DEFAULT_PEN_MODE_NAME: "Pen mode", - DEFAULT_PEN_MODE_DESC: "Should pen mode be automatically enabled when opening excalidraw?", + DEFAULT_PEN_MODE_DESC: "Should pen mode be automatically enabled when opening Excalidraw?", ZOOM_TO_FIT_NAME: "Zoom to fit on view resize", ZOOM_TO_FIT_DESC: "Zoom to fit drawing when the pane is resized", ZOOM_TO_FIT_MAX_LEVEL_NAME: "Zoom to fit max ZOOM level", @@ -291,7 +291,7 @@ export default { "[[drawing.excalidraw|100x100]] format.", EMBED_TYPE_NAME: "Type of file to insert into the document", EMBED_TYPE_DESC: - "When you embed an image into a document using the command palette this setting will specify if Excalidraw should embed the original excalidraw file " + + "When you embed an image into a document using the command palette this setting will specify if Excalidraw should embed the original Excalidraw file " + "or a PNG or an SVG copy. You need to enable auto-export PNG / SVG (see below under Export Settings) for those image types to be available in the dropdown. For drawings that do not have a " + "a corresponding PNG or SVG readily available the command palette action will insert a broken link. You need to open the original drawing and initiate export manually. " + "This option will not autogenerate PNG/SVG files, but will simply reference the already existing files.", @@ -320,8 +320,8 @@ export default { EXPORT_SVG_DESC: "Automatically create an SVG export of your drawing matching the title of your file. " + "The plugin will save the *.SVG file in the same folder as the drawing. " + - "Embed the .svg file into your documents instead of excalidraw making you embeds platform independent. " + - "While the auto-export switch is on, this file will get updated every time you edit the excalidraw drawing with the matching name.", + "Embed the .svg file into your documents instead of Excalidraw making you embeds platform independent. " + + "While the auto-export switch is on, this file will get updated every time you edit the Excalidraw drawing with the matching name.", EXPORT_PNG_NAME: "Auto-export PNG", EXPORT_PNG_DESC: "Same as the auto-export SVG, but for *.PNG", COMPATIBILITY_HEAD: "Compatibility features", @@ -364,7 +364,7 @@ export default { FOURTH_FONT_NAME: "Forth font file", FOURTH_FONT_DESC: "Select a .ttf, .woff or .woff2 font file from your vault to use as the fourth font. " + - "If no file is selected excalidraw will use the Virgil font by default.", + "If no file is selected Excalidraw will use the Virgil font by default.", SCRIPT_SETTINGS_HEAD: "Settings for installed Scripts", //openDrawings.ts From c7acb45f8586f689a5f68b4bdc9c20109e9b816c Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Sun, 10 Apr 2022 04:32:46 +0000 Subject: [PATCH 4/5] missing comma in en.ts --- src/lang/locale/en.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 6a6037d..c3b8868 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -364,7 +364,7 @@ export default { FOURTH_FONT_NAME: "Forth font file", FOURTH_FONT_DESC: "Select a .ttf, .woff or .woff2 font file from your vault to use as the fourth font. " + - "If no file is selected Excalidraw will use the Virgil font by default.", + "If no file is selected, Excalidraw will use the Virgil font by default.", SCRIPT_SETTINGS_HEAD: "Settings for installed Scripts", //openDrawings.ts From 1ca8e482780173ee267375171d5d69239e7e7316 Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Sun, 10 Apr 2022 04:45:40 +0000 Subject: [PATCH 5/5] more typo fixes --- src/lang/locale/en.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index c3b8868..00729e0 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -96,7 +96,7 @@ export default { TEMPLATE_DESC: "Full filepath to the Excalidraw template. " + "E.g.: If your template is in the default Excalidraw folder and it's name is " + - "Template.md, the setting would be: Excalidraw/Template.md (or just Excalidraw/Template - you may ommit the .md file extension). " + + "Template.md, the setting would be: Excalidraw/Template.md (or just Excalidraw/Template - you may omit the .md file extension). " + "If you are using Excalidraw in compatibility mode, then your template must be a legacy Excalidraw file as well " + "such as Excalidraw/Template.excalidraw.", SCRIPT_FOLDER_NAME: "Excalidraw Automate script folder", @@ -164,7 +164,7 @@ export default { "If this option is enabled open Excalidraw pane will switch to light/dark mode when Obsidian theme changes. ", DEFAULT_OPEN_MODE_NAME: "Default mode when opening Excalidraw", DEFAULT_OPEN_MODE_DESC: - "Specifies the mode how Excalidraw opens: Normal, Zen, or View mode. You may also set this behaviour on a file level by " + + "Specifies the mode how Excalidraw opens: Normal, Zen, or View mode. You may also set this behavior on a file level by " + "adding the excalidraw-default-mode frontmatter key with a value of: normal,view, or zen to your document.", DEFAULT_PEN_MODE_NAME: "Pen mode", DEFAULT_PEN_MODE_DESC: "Should pen mode be automatically enabled when opening Excalidraw?", @@ -204,7 +204,7 @@ export default { }${FRONTMATTER_KEY_CUSTOM_URL_PREFIX}: "🌐 " to the file's frontmatter.`, HOVERPREVIEW_NAME: "Hover preview without CTRL/CMD key", HOVERPREVIEW_DESC: - "Toggle On: Hover preview for [[wiki links]] is shown immedately, without the need to hold the CTRL/CMD key.
Toggle Off: Hover preview is shown only when you hold the CTRL/CMD key while hovering the link.", + "Toggle On: Hover preview for [[wiki links]] is shown immediately, without the need to hold the CTRL/CMD key.
Toggle Off: Hover preview is shown only when you hold the CTRL/CMD key while hovering the link.", LINKOPACITY_NAME: "Opacity of link icon", LINKOPACITY_DESC: "Opacity of the link indicator icon in the top right corner of an element. 1 is opaque, 0 is transparent.", @@ -242,7 +242,7 @@ export default { MD_TRANSCLUDE_HEIGHT_NAME: "Default maximum height of a transcluded markdown document", MD_TRANSCLUDE_HEIGHT_DESC: - "The embedded image will be as high as the markdown text requries, but not higher than this value. " + + "The embedded image will be as high as the markdown text requires, but not higher than this value. " + "You can override this value by editing the embedded image link in markdown view mode with the following syntax [[filename#^blockref|WIDTHxMAXHEIGHT]].", MD_DEFAULT_FONT_NAME: "The default font typeface to use for embedded markdown files.", @@ -346,9 +346,9 @@ export default { "when you type excalidraw- or ea. with function description as hints on the individual items in the list.", FILETYPE_NAME: "Display type (✏️) for excalidraw.md files in File Explorer", FILETYPE_DESC: - "Excalidraw files will receive an indicator using the emojii or text defined in the next setting.", + "Excalidraw files will receive an indicator using the emoji or text defined in the next setting.", FILETAG_NAME: "Set the type indicator for excalidraw.md files", - FILETAG_DESC: "The text or emojii to display as type indicator.", + FILETAG_DESC: "The text or emoji to display as type indicator.", INSERT_EMOJI: "Insert an emoji", LIVEPREVIEW_NAME: "Immersive image embedding in live preview editing mode", LIVEPREVIEW_DESC: @@ -358,8 +358,8 @@ export default { ENABLE_FOURTH_FONT_NAME: "Enable fourth font option", ENABLE_FOURTH_FONT_DESC: "By turning this on, you will see a fourth font button on the properties panel for text elements. " + - "Files that use this fourth font will (partly) lose their paltform independence. " + - "Depending on the cutom font set in settings, they will look differently when loaded in another vault, or at a later time. " + + "Files that use this fourth font will (partly) lose their platform independence. " + + "Depending on the custom font set in settings, they will look differently when loaded in another vault, or at a later time. " + "Also the 4th font will display as system default font on excalidraw.com, or other Excalidraw versions.", FOURTH_FONT_NAME: "Forth font file", FOURTH_FONT_DESC: