diff --git a/src/addon.ts b/src/addon.ts index 9160e7d..9df0454 100644 --- a/src/addon.ts +++ b/src/addon.ts @@ -1,3 +1,7 @@ +/* + * This file defines the plugin's structure. + */ + import AddonEvents from "./zotero/events"; import ZoteroViews from "./zotero/views"; import ReaderViews from "./reader/annotationButton"; diff --git a/src/editor/editorUI.ts b/src/editor/editorUI.ts index 649bdfa..a8cc500 100644 --- a/src/editor/editorUI.ts +++ b/src/editor/editorUI.ts @@ -1,3 +1,7 @@ +/* + * This file contains note editor UI code. + */ + import Knowledge4Zotero from "../addon"; import { CopyHelper, EditorMessage } from "../utils"; import AddonBase from "../module"; diff --git a/src/editor/noteExportController.ts b/src/editor/noteExportController.ts index ae34a1b..b0b4986 100644 --- a/src/editor/noteExportController.ts +++ b/src/editor/noteExportController.ts @@ -1,3 +1,7 @@ +/* + * This file realizes note export. + */ + import Knowledge4Zotero from "../addon"; import { pick } from "../utils"; import AddonBase from "../module"; @@ -341,9 +345,11 @@ class NoteExport extends AddonBase { private _getFileName(noteItem: Zotero.Item) { return ( - this._Addon.TemplateController.renderTemplate("[ExportMDFileName]", "noteItem", [ - noteItem, - ]) as string + this._Addon.TemplateController.renderTemplate( + "[ExportMDFileName]", + "noteItem", + [noteItem] + ) as string ).replace(/\\/g, "-"); } } diff --git a/src/editor/noteExportWindow.ts b/src/editor/noteExportWindow.ts index ca9b697..94c7e8d 100644 --- a/src/editor/noteExportWindow.ts +++ b/src/editor/noteExportWindow.ts @@ -1,3 +1,7 @@ +/* + * This file contains note export window code. + */ + import Knowledge4Zotero from "../addon"; import AddonBase from "../module"; diff --git a/src/editor/noteParse.ts b/src/editor/noteParse.ts index 0b48863..86afaef 100644 --- a/src/editor/noteParse.ts +++ b/src/editor/noteParse.ts @@ -1,3 +1,7 @@ +/* + * This file realizes note parse (md, html, rich-text). + */ + import AddonBase from "../module"; import { HTML2Markdown, Markdown2HTML } from "./convertMD"; import TurndownService = require("turndown"); diff --git a/src/editor/noteUtils.ts b/src/editor/noteUtils.ts index 32b705e..653175c 100644 --- a/src/editor/noteUtils.ts +++ b/src/editor/noteUtils.ts @@ -1,3 +1,7 @@ +/* + * This file realizes note tools. + */ + import Knowledge4Zotero from "../addon"; import AddonBase from "../module"; diff --git a/src/index.ts b/src/index.ts index 35ea863..a223088 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,7 @@ +/* + * This file is the esbuild entrance. + */ + import Knowledge4Zotero from "./addon"; Zotero.Knowledge4Zotero = new Knowledge4Zotero(); diff --git a/src/module.ts b/src/module.ts index 3f5c7cb..688141b 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,3 +1,8 @@ +/* + * This file defines the modules' base class. + */ + + import Knowledge4Zotero from "./addon"; class AddonBase { diff --git a/src/reader/annotationButton.ts b/src/reader/annotationButton.ts index 710d34d..cf4d981 100644 --- a/src/reader/annotationButton.ts +++ b/src/reader/annotationButton.ts @@ -1,3 +1,7 @@ +/* + * This file contains reader annotation pane code. + */ + const CryptoJS = require("crypto-js"); import Knowledge4Zotero from "../addon"; import AddonBase from "../module"; diff --git a/src/sync/syncController.ts b/src/sync/syncController.ts index 9ccade1..13c7a10 100644 --- a/src/sync/syncController.ts +++ b/src/sync/syncController.ts @@ -1,3 +1,7 @@ +/* + * This file realizes the sycn feature. + */ + import Knowledge4Zotero from "../addon"; import AddonBase from "../module"; diff --git a/src/sync/syncInfoWindow.ts b/src/sync/syncInfoWindow.ts index ca0b2cc..cacb2be 100644 --- a/src/sync/syncInfoWindow.ts +++ b/src/sync/syncInfoWindow.ts @@ -1,3 +1,7 @@ +/* + * This file contains sync info window related code. + */ + import Knowledge4Zotero from "../addon"; import AddonBase from "../module"; diff --git a/src/sync/syncListWindow.ts b/src/sync/syncListWindow.ts index 4db2e8f..86868c6 100644 --- a/src/sync/syncListWindow.ts +++ b/src/sync/syncListWindow.ts @@ -1,3 +1,7 @@ +/* + * This file contains sync list window related code. + */ + import Knowledge4Zotero from "../addon"; import AddonBase from "../module"; @@ -154,9 +158,10 @@ class SyncListWindow extends AddonBase { return; } if (this.useRelated()) { - let noteIds: number[] = await this._Addon.SyncController.getRelatedNoteIdsFromNotes( - selectedItems - ); + let noteIds: number[] = + await this._Addon.SyncController.getRelatedNoteIdsFromNotes( + selectedItems + ); selectedItems = Zotero.Items.get(noteIds) as Zotero.Item[]; } for (const note of selectedItems) { diff --git a/src/template/templateController.ts b/src/template/templateController.ts index 9fc3fd1..500e303 100644 --- a/src/template/templateController.ts +++ b/src/template/templateController.ts @@ -1,3 +1,7 @@ +/* + * This file realizes the template feature. + */ + import Knowledge4Zotero from "../addon"; import { NoteTemplate } from "../utils"; import AddonBase from "../module"; diff --git a/src/template/templateWindow.ts b/src/template/templateWindow.ts index c5df2e4..9d47562 100644 --- a/src/template/templateWindow.ts +++ b/src/template/templateWindow.ts @@ -1,3 +1,7 @@ +/* + * This file contains template window related code. + */ + import Knowledge4Zotero from "../addon"; import { NoteTemplate } from "../utils"; import AddonBase from "../module"; diff --git a/src/utils.ts b/src/utils.ts index dade643..3e2a35b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,3 +1,7 @@ +/* + * This file contains definitions of commonly used structures. + */ + class EditorMessage { public type: string; public content: { diff --git a/src/wizard.ts b/src/wizard.ts index ce95a1f..62d89b7 100644 --- a/src/wizard.ts +++ b/src/wizard.ts @@ -1,5 +1,5 @@ /* - * This file contains the first-run wizard window code + * This file contains the first-run wizard window code. */ import Knowledge4Zotero from "./addon"; diff --git a/src/workspace/workspaceMenu.ts b/src/workspace/workspaceMenu.ts index 5c0595e..539ccb1 100644 --- a/src/workspace/workspaceMenu.ts +++ b/src/workspace/workspaceMenu.ts @@ -1,3 +1,7 @@ +/* + * This file contains workspace menu related code. + */ + import Knowledge4Zotero from "../addon"; import { OutlineType } from "../utils"; import AddonBase from "../module"; diff --git a/src/workspace/workspaceOutline.ts b/src/workspace/workspaceOutline.ts index 8439be7..7564800 100644 --- a/src/workspace/workspaceOutline.ts +++ b/src/workspace/workspaceOutline.ts @@ -1,3 +1,7 @@ +/* + * This file contains workspace ontline related code. + */ + import Knowledge4Zotero from "../addon"; import { OutlineType } from "../utils"; import AddonBase from "../module"; diff --git a/src/workspace/workspaceWindow.ts b/src/workspace/workspaceWindow.ts index 01ce1f9..b845119 100644 --- a/src/workspace/workspaceWindow.ts +++ b/src/workspace/workspaceWindow.ts @@ -1,3 +1,7 @@ +/* + * This file contains workspace window related code. + */ + import Knowledge4Zotero from "../addon"; import { EditorMessage, OutlineType } from "../utils"; import AddonBase from "../module"; diff --git a/src/zotero/events.ts b/src/zotero/events.ts index 5b2b95b..b8ddbed 100644 --- a/src/zotero/events.ts +++ b/src/zotero/events.ts @@ -1,3 +1,7 @@ +/* + * This file contains the life-time and UI events. + */ + import Knowledge4Zotero from "../addon"; import { CopyHelper, EditorMessage } from "../utils"; import AddonBase from "../module"; diff --git a/src/zotero/views.ts b/src/zotero/views.ts index 44beed4..7913dc1 100644 --- a/src/zotero/views.ts +++ b/src/zotero/views.ts @@ -1,3 +1,7 @@ +/* + * This file contains the Zotero UI code. + */ + import Knowledge4Zotero from "../addon"; import { EditorMessage } from "../utils"; import AddonBase from "../module";