From 8da778410410f93378ca51e9b4f55479980e5866 Mon Sep 17 00:00:00 2001 From: Mantao Huang Date: Sat, 7 Mar 2026 17:22:19 -0600 Subject: [PATCH] add .gitignore and updated readme to include commands to run --- .gitignore | 21 +++++++++++++++++++++ README.md | 26 ++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee79207 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# Build outputs +*.xpi +*.zip + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/README.md b/README.md index 024cef7..54ee17d 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,17 @@ Executes arbitrary JavaScript within Zotero's context. **Body:** ```json { - "code": "return await Zotero.Items.getAll();" + "code": "return await Zotero.Items.getAll(1, true, false);" } ``` +**Example Test:** +```bash +curl -X POST http://127.0.0.1:23119/zotero-js-bridge/execute \\ + -H 'Content-Type: application/json' \\ + -d '{"code": "return await Zotero.Items.getAll(1, true, false);"}' +``` + ### `/zotero-js-bridge/findPDFsForItems` A specialized endpoint to trigger Zotero's "Find Available PDFs" feature for a specific list of item IDs. @@ -35,7 +42,22 @@ A specialized endpoint to trigger Zotero's "Find Available PDFs" feature for a s } ``` -## Development +**Example Test:** +```bash +curl -X POST http://127.0.0.1:23119/zotero-js-bridge/findPDFsForItems \\ + -H 'Content-Type: application/json' \\ + -d '{"itemIds": [123]}' +``` + +## Development and Building + +To build the project into an installable Zotero add-on (`.xpi` file), run the following command from the root of this repository: + +```bash +rm -f zotero-js-bridge.xpi && zip -r zotero-js-bridge.xpi manifest.json bootstrap.js README.md +``` + +Then drag and drop the `zotero-js-bridge.xpi` file into the Zotero Add-ons manager to install it. - `manifest.json`: Zotero plugin manifest. - `bootstrap.js`: Handles plugin lifecycle and endpoint registration.