@@ -14,132 +14,9 @@ This project is under active development, and some APIs may change. However, it
1414
1515For best practices regarding this package, please refer to [ zotero-plugin-template] ( https://github.com/windingwind/zotero-plugin-template ) .
1616
17- ## Using in a blank project
17+ ## Documentation
1818
19- <details >
20-
21- <summary >WIP: Not yet implemented</summary >
22-
23- ``` bash
24- # npm
25- npx zotero-plugin create
26- # pnpm
27- pnpm dlx zotero-plugin create
28- ```
29-
30- </details >
31-
32- ## Using in an existing project
33-
34- ### 01. Install
35-
36- #### From NPM
37-
38- ``` bash
39- npm install -D zotero-plugin-scaffold
40-
41- yarn add -D zotero-plugin-scaffold
42-
43- pnpm add -D zotero-plugin-scaffold
44- ```
45-
46- #### From source code
47-
48- ``` bash
49- # clone this repo
50- git clone https://github.com/northword/zotero-plugin-scaffold.git zotero-plugin-scaffold/
51- cd zotero-plugin-scaffold/
52-
53- # build
54- pnpm install
55- pnpm build # or pnpm dev
56-
57- # npm link
58- cd your-plugin-work-dir/
59- pnpm link ../zotero-plugin-scaffold
60- ```
61-
62- ### 02. Create a config file
63-
64- The configuration file needs to be stored in the following location.
65-
66- ``` bash
67- zotero-plugin.config.ts # also avaliable in *.js *.mjs *.cjs *.ts
68- ```
69-
70- You can import helper ` defineConfig ` to get type hints. If no value is specified for an optional property, the default value will be used.
71-
72- ``` ts
73- import { defineConfig } from " zotero-plugin-scaffold" ;
74-
75- export default defineConfig ({
76- name: " the plugin name" ,
77- id: " the plugin id" ,
78- namespace: " the plugin namespace" ,
79- build: {
80- esbuildOptions: [
81- {
82- entryPoints: [" src/index.ts" ],
83- bundle: true ,
84- target: " firefox115" ,
85- },
86- ],
87- },
88- });
89- ```
90-
91- Full config please refrence in [ src/types] ( ./src/types/index.ts ) .
92-
93- ### 03. Create a env file
94-
95- This file defines Zotero's runtime configuration such as binary paths, profile paths, and environment variables required for Node scripts to run.
96-
97- NOTE: Do not check-in this file to the repository!
98-
99- ``` bash
100- .env
101- ```
102-
103- ``` ini
104- # The path of the Zotero binary file.
105- # The path is `*/Zotero.app/Contents/MacOS/zotero` for macOS.
106- ZOTERO_PLUGIN_ZOTERO_BIN_PATH = /path/to/zotero.exe
107-
108- # The path of the profile used for development.
109- # Start the profile manager by `/path/to/zotero.exe -p` to create a profile for development.
110- # @see https://www.zotero.org/support/kb/profile_directory
111- ZOTERO_PLUGIN_PROFILE_PATH = /path/to/profile
112- ```
113-
114- ### 04. Add scripts to package.json
115-
116- ``` json
117- {
118- "scripts" : {
119- "start" : " zotero-plugin serve" ,
120- "build" : " zotero-plugin build" ,
121- "release" : " zotero-plugin release"
122- }
123- }
124- ```
125-
126- ### 05. Run
127-
128- ``` bash
129- pnpm run start
130- pnpm run build
131- ```
132-
133- ## Using in NodeJS code
134-
135- ``` ts
136- import { Build , Config } from " zotero-plugin-scaffold" ;
137-
138- const config = await Config .loadConfig ();
139-
140- const Builder = new Build (config );
141- await Builder .run ();
142- ```
19+ [ Read the Docs to Learn More.] ( https://northword.github.io/zotero-plugin-scaffold )
14320
14421## Contributing
14522
0 commit comments