From 99965519f6b936d5de8d804bbbe6687fd04f6099 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Fri, 23 Dec 2022 13:06:56 +0800 Subject: [PATCH] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index ae831f6..5d684c8 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,23 @@ The plugin template provides new APIs for bootstrap plugins. We have two reasons There are more advanced APIs for creating elements in batch: `creatElementsFromJSON`. Input an element tree in JSON and return a fragment/element. These elements are also maintained by this plugin template. +#### Extra Column in Library + +Using [Zotero Plugin Toolkit:ItemTreeTool](https://github.com/windingwind/zotero-plugin-toolkit/blob/HEAD/docs/zotero-plugin-toolkit.itemtreetool.md) to register an extra column in `src/views.ts`. + +```ts +this._Addon.toolkit.ItemTree.registerExample(); +``` +This will register a column with dataKey `test`. Looks like: + +![image](https://user-images.githubusercontent.com/33902321/209274492-7aa94912-af38-4154-af46-dc8f59640de3.png) + +Remember to unregister it when exiting. + +```ts +this._Addon.toolkit.ItemTree.unregister("test"); +``` + ### Directory Structure This section shows the directory structure of a template.