|
1 | 1 | # Zotero Plugin Registry |
2 | 2 |
|
3 | | -> A self-hosted registry and store for Zotero plugins based on their `update.json` manifests. |
| 3 | +**Zotero Plugin Registry** is a self-hosted, structured registry that aggregates plugin metadata by collecting and parsing developers' self-hosted `update.json` files. |
4 | 4 |
|
5 | | -## Overview |
| 5 | +This project is the successor to the plugin listing functionality in [`zotero-chinese/zotero-plugins`](https://github.com/zotero-chinese/zotero-plugins), which was primarily designed to cache and mirror `.xpi` files hosted on GitHub to support users in mainland China. However, that system did not automatically parse plugin versions or compatibility information from `update.json`, nor did it support plugins hosted outside GitHub. |
6 | 6 |
|
7 | | -Zotero Plugin Registry is a self-hosted platform that aggregates Zotero plugins by collecting developers' self-hosted `update.json` files. |
8 | | -It provides a unified service for users to browse, search, and get version and compatibility information about Zotero plugins. |
| 7 | +In contrast, this new repository: |
| 8 | + |
| 9 | +- Collects only essential metadata for each plugin (`meta.json`) and the URL to its `update.json` |
| 10 | +- Automatically fetches and parses version and compatibility info from the `update.json` |
| 11 | +- Generates structured JSON outputs for frontend applications or indexing |
| 12 | +- Serves as the canonical data source for a new, internationalized Zotero plugin store frontend |
| 13 | + |
| 14 | +The previous [frontend site](https://github.com/zotero-chinese/website) and [zotero-plugins project](https://github.com/zotero-chinese/zptero-plugins) created by the Zotero Chinese community will continue to serve Chinese users with a localized interface and GitHub mirror links. This project aims to power a new global plugin ecosystem, with improved automation, wider plugin support, and international accessibility. |
9 | 15 |
|
10 | 16 | ## Project Structure |
11 | 17 |
|
12 | 18 | ```plain |
13 | | -main/ |
| 19 | +. |
14 | 20 | └── plugins/ |
15 | | -└── <plugin-id>/ |
16 | | - ├── meta.json # Base plugin metadata (manually maintained) |
17 | | - ├── meta.generated.json # Generated metadata including versions |
18 | | - ├── latest.json # Generated latest version info |
19 | | - └── icon.png # Optional plugin icon |
| 21 | + └── <plugin-id>/ |
| 22 | + ├── meta.json # Base plugin metadata (manually maintained) |
| 23 | + ├── meta.generated.json # Generated metadata including versions |
| 24 | + └── icon.png # Optional plugin icon |
20 | 25 | scripts/ |
21 | | -└── build.ts # Build script to generate aggregated data |
22 | | -.gitignore # Ignore generated JSON files |
23 | | -package.json # Project config and dependencies |
24 | | -README.md # This document |
| 26 | +└── build.ts # Build script to generate aggregated data |
| 27 | +package.json # Project config and dependencies |
| 28 | +README.md # This document |
25 | 29 | ``` |
26 | 30 |
|
27 | | -## Quick Start |
28 | | - |
29 | | -1. Clone the repository and install dependencies |
30 | | - |
31 | | - ```bash |
32 | | - git clone https://github.com/zotero-plugin-dev/zotero-plugin-registry.git |
33 | | - cd zotero-plugin-registry |
34 | | - pnpm install |
35 | | - ``` |
36 | | - |
37 | | -2. Add plugin metadata in `main/plugins/<plugin-id>/meta.json`, example: |
38 | | - |
39 | | - ```json |
40 | | - { |
41 | | - |
42 | | - "name": "Zotero Format Metadata", |
43 | | - "update_json": "https://example.com/path/to/update.json", |
44 | | - "description": "A useful Zotero plugin.", |
45 | | - "homepage": "https://github.com/northword/zotero-format-metadata", |
46 | | - "tags": ["metadata"] |
47 | | - } |
48 | | - ``` |
49 | | - |
50 | | -3. Run the build script to generate aggregated data |
| 31 | +## Submitting Plugins |
| 32 | + |
| 33 | +[](https://codespaces.new/zotero-plugin-dev/zotero-plugin-registry?quickstart=1) |
| 34 | + |
| 35 | +> [!NOTE] |
| 36 | +> |
| 37 | +> How to add a plugin that hasn't been included? |
| 38 | +> |
| 39 | +> Add plugin metadata in `./plugins/<plugin-id>/meta.json`, the basic format is shown below, and existing items can also be used as references. |
| 40 | +> |
| 41 | +> After editing, commit and pull request. We will process it as soon as possible. |
| 42 | +
|
| 43 | +```json |
| 44 | +{ |
| 45 | + |
| 46 | + "name": "Zotero Format Metadata", |
| 47 | + "update_json": "https://example.com/path/to/update.json", |
| 48 | + "description": "A useful Zotero plugin.", |
| 49 | + "homepage": "https://github.com/northword/zotero-format-metadata", |
| 50 | + "tags": ["metadata"] |
| 51 | +} |
| 52 | +``` |
51 | 53 |
|
52 | | - ```bash |
53 | | - pnpm run build |
54 | | - ``` |
| 54 | +## Development Guide |
55 | 55 |
|
56 | | -4. After building, `meta.generated.json` and `latest.json` files will be created inside each plugin directory, ready for deployment or frontend consumption. |
| 56 | +Before starting development, you need to create a [GitHub personal access token](https://docs.github.com/zh/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) and store it in the local environment variable `GITHUB_TOKEN`. |
57 | 57 |
|
58 | | -## Build Script Usage |
| 58 | +```bash |
| 59 | +# Clone the repository |
| 60 | +git clone https://github.com/zotero-plugin-dev/zotero-plugin-registry.git |
| 61 | +cd zotero-plugin-registry |
59 | 62 |
|
60 | | -- Build all plugins: |
| 63 | +# Install dependencies |
| 64 | +corepack enable |
| 65 | +pnpm install |
61 | 66 |
|
62 | | -```bash |
| 67 | +# Build all plugins: |
63 | 68 | pnpm run build |
| 69 | + |
| 70 | +# Build a specific plugin by ID: |
| 71 | + |
64 | 72 | ``` |
65 | 73 |
|
66 | | -- Build a specific plugin by ID: |
| 74 | +After script run, `meta.generated.json` and `latest.json` files will be created inside each plugin directory, ready for deployment or frontend consumption. |
67 | 75 |
|
68 | | -```bash |
69 | | -pnpx ts-node scripts/build.ts --only [email protected] |
70 | | -``` |
| 76 | +> [!NOTE] |
| 77 | +> |
| 78 | +> How to use this project as a dependency for secondary development? |
| 79 | +> |
| 80 | +> Developers can use the dist files like `index.json` from the `publish` branch. |
71 | 81 |
|
72 | 82 | ## Contributing |
73 | 83 |
|
|
0 commit comments