Skip to content

Commit 087d273

Browse files
feat(zotero-plugin-uts): add Zotero 7/8 compatible plugin with UTS APA 7th citation style
- Add CSL-based bibliography copy functionality - Implement Zotero 8 Menu API with legacy fallback for Zotero 7 - Add context menu, tools menu, and keyboard shortcut (Ctrl+Shift+U) - Add preference pane with about section and funding links - Add first-run welcome notification - Add plugin state management with encapsulated class - Add Result pattern for error handling in citation copy - Add vitest tests for utils and plugin state - Add path aliases (@/*) for clean imports - Configure ES2022 target with minification - Add manifest.json with author, homepage, icons, and update URL - Add package.json with funding info (GitHub Sponsors) - Reference UTS Library APA 7th Referencing Guide (Jan 2025) Amp-Thread-ID: https://ampcode.com/threads/T-019bff93-4aab-77ab-98d1-d838ab1a3fa9 Co-authored-by: Amp <amp@ampcode.com>
1 parent 2f61ce1 commit 087d273

31 files changed

Lines changed: 975 additions & 375 deletions

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"!**/apps/ng-daum-address-example/**/*.html",
1515
"!**/packages/mcp-cafe24-admin/src/assets/**/*.html",
1616
"!**/apps/mcp-cafe24-admin-example/next-env.d.ts",
17-
"!**/.opencode/mimic/state.json"
17+
"!**/.opencode/mimic/state.json",
18+
"!**/packages/zotero-plugin-uts/addon/*.js"
1819
]
1920
},
2021
"plugins": ["packages/biome-plugin/rules/no-relative-imports.grit"],

bun.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,64 @@
1-
# Zotero Plugin UTS
1+
# UTS APA 7th Copy - Zotero Plugin
22

3-
This is a Zotero plugin that adds a "Copy UTS APA 7th Citation" option to the item context menu.
3+
A Zotero plugin that copies bibliography in UTS APA 7th format to clipboard.
4+
5+
> **Citation Style Reference**: This plugin uses the citation format based on the
6+
> [APA 7th Referencing Guide (January 2025)](https://www.lib.uts.edu.au/help/referencing/apa-referencing-guide)
7+
> from UTS Library.
48
59
## Features
610

7-
- Copies the bibliography of selected items in APA 7th edition format (UTS standard).
8-
- Supports Zotero 7+.
11+
- 📋 **Context Menu**: Right-click on items → "Copy UTS APA 7th Citation"
12+
- 🔧 **Tools Menu**: Tools → "Copy UTS APA 7th Citation"
13+
- ⌨️ **Keyboard Shortcut**: `Ctrl+Shift+U` (Windows/Linux) or `Cmd+Shift+U` (Mac)
14+
- 🔔 **Notifications**: Visual feedback on copy success/failure
15+
- 🎨 **Icons**: Custom menu icons for easy identification
916

10-
## Development
17+
## Installation
18+
19+
1. Download the latest `.xpi` file from [Releases](https://github.com/gracefullight/pkgs/releases)
20+
2. In Zotero, go to Tools → Add-ons
21+
3. Click the gear icon → Install Add-on From File
22+
4. Select the downloaded `.xpi` file
23+
24+
## Compatibility
25+
26+
- Zotero 7.0+
27+
- Zotero 8.x
28+
29+
## Usage
1130

12-
### Build
31+
1. Select one or more items in your Zotero library
32+
2. Use any of the following methods:
33+
- Right-click and select "Copy UTS APA 7th Citation"
34+
- Go to Tools → "Copy UTS APA 7th Citation"
35+
- Press `Ctrl+Shift+U` (or `Cmd+Shift+U` on Mac)
36+
3. Paste the citation wherever you need it
37+
38+
## Development
1339

1440
```bash
41+
# Install dependencies
1542
bun install
43+
44+
# Run tests
45+
bun run test
46+
47+
# Build
1648
bun run build
1749
```
1850

19-
The built addon files are located in `addon/`.
51+
## Support Development
52+
53+
If you find this plugin helpful, please consider supporting:
54+
55+
- [♥ GitHub Sponsors](https://github.com/sponsors/gracefullight)
56+
- [☕ Buy Me a Coffee](https://buymeacoffee.com/gracefullight)
2057

21-
### Installation
58+
## License
2259

23-
1. Build the project.
24-
2. Zip the contents of the `addon` directory (not the directory itself, just the files inside).
25-
```bash
26-
cd addon && zip -r ../zotero-plugin-uts.xpi *
27-
```
28-
3. Open Zotero -> Tools -> Add-ons.
29-
4. Click the gear icon -> Install Add-on From File...
30-
5. Select the `.xpi` file.
60+
MIT License - see [LICENSE](../../LICENSE) for details.
3161

32-
## Structure
62+
## Author
3363

34-
- `addon/`: Contains the plugin manifest, bootstrap loader, and built assets.
35-
- `src/`: TypeScript source code.
36-
- `tsup.config.ts`: Bundler configuration.
64+
**gracefullight** - [GitHub](https://github.com/gracefullight)

packages/zotero-plugin-uts/addon/bootstrap.js

Lines changed: 1 addition & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE window>
3+
<window
4+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
5+
xmlns:html="http://www.w3.org/1999/xhtml"
6+
>
7+
<vbox id="uts-copy-preferences" class="main-section">
8+
<groupbox>
9+
<label><html:h2>UTS APA 7th Copy</html:h2></label>
10+
11+
<vbox class="uts-copy-about">
12+
<label value="Copy bibliography in UTS APA 7th format to clipboard" />
13+
<label value="Based on APA 7th Referencing Guide (Jan 2025) from UTS Library" />
14+
15+
<separator class="thin" />
16+
17+
<label><html:strong>Keyboard Shortcut</html:strong></label>
18+
<label value="Ctrl+Shift+U (Cmd+Shift+U on Mac)" />
19+
20+
<separator />
21+
22+
<label><html:strong>About</html:strong></label>
23+
<label value="Author: gracefullight" />
24+
<hbox>
25+
<label value="Homepage: " />
26+
<label
27+
class="zotero-text-link"
28+
value="GitHub"
29+
href="https://github.com/gracefullight/pkgs/tree/main/packages/zotero-plugin-uts"
30+
/>
31+
</hbox>
32+
33+
<separator />
34+
35+
<label><html:strong>Support Development</html:strong></label>
36+
<label value="If you find this plugin helpful, please consider supporting:" />
37+
38+
<hbox align="center">
39+
<button
40+
id="uts-copy-github-sponsor"
41+
label="♥ GitHub Sponsors"
42+
oncommand="Zotero.launchURL('https://github.com/sponsors/gracefullight')"
43+
/>
44+
<button
45+
id="uts-copy-coffee"
46+
label="☕ Buy Me a Coffee"
47+
oncommand="Zotero.launchURL('https://buymeacoffee.com/gracefullight')"
48+
/>
49+
</hbox>
50+
51+
<separator />
52+
53+
<label><html:strong>License</html:strong></label>
54+
<label value="MIT License" />
55+
</vbox>
56+
</groupbox>
57+
</vbox>
58+
</window>
Lines changed: 1 addition & 0 deletions
Loading

packages/zotero-plugin-uts/addon/index.global.js

Lines changed: 4 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/zotero-plugin-uts/addon/manifest.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,22 @@
33
"name": "UTS APA 7th Copy",
44
"version": "1.0.0",
55
"description": "Copy bibliography in UTS APA 7th format to clipboard",
6+
"author": "gracefullight",
7+
"homepage_url": "https://github.com/gracefullight/pkgs/tree/main/packages/zotero-plugin-uts",
8+
"developer": {
9+
"name": "gracefullight",
10+
"url": "https://github.com/gracefullight"
11+
},
12+
"icons": {
13+
"48": "icon.svg",
14+
"96": "icon.svg"
15+
},
616
"applications": {
717
"zotero": {
818
"id": "uts-copy@gracefullight.dev",
9-
"strict_min_version": "7.0"
19+
"update_url": "https://raw.githubusercontent.com/gracefullight/pkgs/main/packages/zotero-plugin-uts/updates.json",
20+
"strict_min_version": "7.0",
21+
"strict_max_version": "8.*"
1022
}
1123
}
1224
}

0 commit comments

Comments
 (0)