add .gitignore and updated readme to include commands to run

This commit is contained in:
Mantao Huang 2026-03-07 17:22:19 -06:00
parent f882d1ea0e
commit 8da7784104
2 changed files with 45 additions and 2 deletions

21
.gitignore vendored Normal file
View File

@ -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?

View File

@ -19,10 +19,17 @@ Executes arbitrary JavaScript within Zotero's context.
**Body:** **Body:**
```json ```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` ### `/zotero-js-bridge/findPDFsForItems`
A specialized endpoint to trigger Zotero's "Find Available PDFs" feature for a specific list of item IDs. 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. - `manifest.json`: Zotero plugin manifest.
- `bootstrap.js`: Handles plugin lifecycle and endpoint registration. - `bootstrap.js`: Handles plugin lifecycle and endpoint registration.