From d6c2e8083569eb238ba94270e1e186c609bc48aa Mon Sep 17 00:00:00 2001
From: xiangyu <3170102889@zju.edu.cn>
Date: Thu, 9 Jun 2022 22:55:55 +0800
Subject: [PATCH] update: readme
---
README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++
src/views.ts | 2 +-
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2b1e27e..c5979ca 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,50 @@ Documentation:
This add-on is built on the Zotero Addon Template of [zotero-pdf-translate](https://github.com/windingwind/zotero-pdf-translate).
+### Build
+
+```shell
+# A release-it command: version increase, npm run build, git push, and GitHub release
+# You need to set the environment variable GITHUB_TOKEN https://github.com/settings/tokens
+# release-it: https://github.com/release-it/release-it
+npm run release
+```
+
+Alternatively, build it directly using build.js: `npm run build`
+
+### Build Steps
+
+1. Clean `./builds`
+2. Copy `./addon` to `./builds`
+3. Esbuild to `./builds/addon/chrome/content/scripts`
+4. Replace `__buildVersion__` and `__buildTime__` in `./builds/addon`
+5. Zip the `./builds/addon` to `./builds/*.xpi`
+
+### Debug
+
+1. Copy zotero command line config file. Modify the commands.
+
+```sh
+cp zotero-cmd-default.json zotero-cmd.json
+```
+
+2. Setup addon development environment following this [link](https://www.zotero.org/support/dev/client_coding/plugin_development#setting_up_a_plugin_development_environment).
+
+3. Build addon and restart Zotero with this npm command.
+
+```sh
+npm run restart
+```
+
+You can also debug code in these ways:
+
+- Test code segments in Tools->Developer->Run Javascript;
+- Debug output with `Zotero.debug()`. Find the outputs in Help->Debug Output Logging->View Output;
+- UI debug. Zotero is built on the Firefox XUL framework. Debug XUL UI with software like [XUL Explorer](https://udn.realityripple.com/docs/Archive/Mozilla/XUL_Explorer).
+ > XUL Documents:
+ > https://www.xul.fr/tutorial/
+ > http://www.xulplanet.com/
+
## Disclaimer
Use this code under AGPL (open source required). No warranties are provided. Keep the laws of your locality in mind!
diff --git a/src/views.ts b/src/views.ts
index cb74ae0..375b154 100644
--- a/src/views.ts
+++ b/src/views.ts
@@ -26,7 +26,7 @@ class AddonViews extends AddonBase {
export: ``,
close: ``,
openWorkspaceCollectionView: ``,
- tabIcon: ``,
+ tabIcon: ``,
};
this.currentOutline = OutlineType.treeView;
this._initIframe = Zotero.Promise.defer();