@future-scholars/paperlib-format-pubname-extension 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/main.js +1 -1
  2. package/package.json +1 -1
  3. package/readme.md +277 -3
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty;var y=(a,t,e)=>t in a?b(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var l=(a,t)=>b(a,"name",{value:t,configurable:!0});var u=(a,t,e)=>(y(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=class p{constructor({id:t,defaultPreference:e}){u(this,"id");u(this,"defaultPreference");this.id=t,this.checkPreference(e),this.defaultPreference=e}checkPreference(t){if(typeof t!="object")throw new Error("Preference must be a dict");for(const e in t){if(!t[e].type||!["string","boolean","options","pathpicker"].includes(t[e].type))throw new Error(`Preference ${e} has wrong type ${t[e].type}`);if(!t[e].name)throw new Error(`Preference ${e} has no name`);if(!t[e].description)throw new Error(`Preference ${e} has no description`);if(t[e].value===void 0||t[e].value===null)throw new Error(`Preference ${e} has no default value`);if(t[e].type==="options"&&!t[e].options)throw new Error(`Preference ${e} has no options`)}}};l(p,"PLExtension");let f=p;const h=class h extends f{constructor(){super({id:"@future-scholars/paperlib-format-pubname-extension",defaultPreference:{removeYear:{type:"boolean",name:"Remove year",description:"Remove year string from publication names",value:!0,order:0},customFormat:{type:"string",name:"Custom format",description:"A json string to define your custom format for publication names. If the publication name contains the key, it will be replaced by the value.",value:"",order:1},customExactMatch:{type:"boolean",name:"Exact match",description:"If checked, the custom format will only be applied if the key is an exact match of the publication name.",value:!1,order:2}}});u(this,"disposeCallbacks");this.disposeCallbacks=[]}async initialize(){await PLExtAPI.extensionPreferenceService.register(this.id,this.defaultPreference),this.disposeCallbacks.push(PLAPI.hookService.hookModify("afterScrapeMetadata",this.id,"modifyPubnameHook")),this.disposeCallbacks.push(PLAPI.commandService.on("format_pubnames_event",e=>{this.formatLibrary()})),this.disposeCallbacks.push(PLAPI.commandService.registerExternel({id:"format_pubnames",description:"Format the publication names of your papers.",event:"format_pubnames_event"}))}async dispose(){PLExtAPI.extensionPreferenceService.unregister(this.id),this.disposeCallbacks.forEach(e=>e())}_modifyPubname(e,c,s,n=!1){for(const o of e)if(c&&(o.publication=o.publication.replace(/\s\d{4}\s/g," ").trim()),s)for(const i in s)n?o.publication===i&&(o.publication=s[i]):o.publication.toLowerCase().includes(i.toLowerCase())&&!o.publication.toLowerCase().includes("workshop")&&(o.publication=s[i]);return e}async modifyPubnameHook(e,c,s){const n=PLExtAPI.extensionPreferenceService.get(this.id,"removeYear"),o=PLExtAPI.extensionPreferenceService.get(this.id,"customFormat");let i;if(o)try{i=JSON.parse(o)}catch(m){PLAPI.logService.error("Error parsing custom format",m,!0,"FormatPubnameExt")}const r=PLExtAPI.extensionPreferenceService.get(this.id,"customExactMatch");return[this._modifyPubname(e,n,i,r),c,s]}async formatLibrary(){const e=await PLAPI.paperService.load("","addTime","desc"),c=PLExtAPI.extensionPreferenceService.get(this.id,"removeYear"),s=PLExtAPI.extensionPreferenceService.get(this.id,"customFormat");let n;if(s)try{n=JSON.parse(s)}catch(r){PLAPI.logService.error("Error parsing custom format",r,!0,"FormatPubnameExt")}const o=PLExtAPI.extensionPreferenceService.get(this.id,"customExactMatch"),i=[];for(const r of e){const m=r.publication,[P]=this._modifyPubname([r],c,n,o);P.publication!==m&&i.push(P)}for(let r=0;r<i.length;r+=10)await PLAPI.paperService.update(i.slice(r,r+10),!1,!0)}};l(h,"PaperlibFormatPubnameExtension");let d=h;async function v(){const a=new d;return await a.initialize(),a}l(v,"initialize");exports.initialize=v;
1
+ "use strict";var M=Object.defineProperty;var v=(r,n,e)=>n in r?M(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var g=(r,n)=>M(r,"name",{value:n,configurable:!0});var d=(r,n,e)=>(v(r,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=class L{constructor({id:n,defaultPreference:e}){d(this,"id");d(this,"defaultPreference");this.id=n,this.checkPreference(e),this.defaultPreference=e}checkPreference(n){if(typeof n!="object")throw new Error("Preference must be a dict");for(const e in n){if(!n[e].type||!["string","boolean","options","pathpicker","hidden","button"].includes(n[e].type))throw new Error(`Preference ${e} has wrong type ${n[e].type}`);if(!n[e].name)throw new Error(`Preference ${e} has no name`);if(!n[e].description)throw new Error(`Preference ${e} has no description`);if(n[e].value===void 0||n[e].value===null)throw new Error(`Preference ${e} has no default value`);if(n[e].type==="options"&&!n[e].options)throw new Error(`Preference ${e} has no options`)}}};g(L,"PLExtension");let p=L;const u={cv:{"Computer Vision and Pattern Recognition":"IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)",CVPR:"IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)","International Conference on Computer Vision":"IEEE/CVF International Conference on Computer Vision (ICCV)",ICCV:"IEEE/CVF International Conference on Computer Vision (ICCV)","European Conference on Computer Vision":"European Conference on Computer Vision (ECCV)",ECCV:"European Conference on Computer Vision (ECCV)"},ml:{"Neural Information Processing Systems":"Advances in Neural Information Processing Systems (NeurIPS)",NeurIPS:"Advances in Neural Information Processing Systems (NeurIPS)",NIPS:"Advances in Neural Information Processing Systems (NeurIPS)","International Conference on Learning Representations":"International Conference on Learning Representations (ICLR)",ICLR:"International Conference on Learning Representations (ICLR)","International Conference on Machine Learning":"International Conference on Machine Learning (ICML)",ICML:"International Conference on Machine Learning (ICML)","Conference on Learning Theory":"Conference on Learning Theory (COLT)",COLT:"Conference on Learning Theory (COLT)","International Conference on Artificial Intelligence and Statistics":"International Conference on Artificial Intelligence and Statistics (AISTATS)",AISTATS:"International Conference on Artificial Intelligence and Statistics (AISTATS)"},ai:{"AAAI Conference on Artificial Intelligence":"AAAI Conference on Artificial Intelligence (AAAI)",AAAI:"AAAI Conference on Artificial Intelligence (AAAI)","International Joint Conference on Artificial Intelligence":"International Joint Conference on Artificial Intelligence (IJCAI)",IJCAI:"International Joint Conference on Artificial Intelligence (IJCAI)","European Conference on Artificial Intelligence":"European Conference on Artificial Intelligence (ECAI)",ECAI:"European Conference on Artificial Intelligence (ECAI)","Conference on Uncertainty in Artificial Intelligence":"Conference on Uncertainty in Artificial Intelligence (UAI)",UAI:"Conference on Uncertainty in Artificial Intelligence (UAI)","International Conference on Human-Robot Interaction":"ACM/IEEE International Conference on Human-Robot Interaction (HRI)",HRI:"ACM/IEEE International Conference on Human-Robot Interaction (HRI)"},nlp:{"Association for Computational Linguistics":"Association for Computational Linguistics (ACL)",ACL:"Association for Computational Linguistics (ACL)","North American Chapter of the Association for Computational Linguistics":"Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL)",NAACL:"Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL)","Conference on Empirical Methods in Natural Language Processing":"Conference on Empirical Methods in Natural Language Processing (EMNLP)",EMNLP:"Conference on Empirical Methods in Natural Language Processing (EMNLP)","International Conference on Computational Linguistics":"International Conference on Computational Linguistics (COLING)",COLING:"International Conference on Computational Linguistics (COLING)","Journal of Computational Linguistics":"Journal of Computational Linguistics"},dm:{"Knowledge Discovery and Data Mining":"ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD)",KDD:"ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD)","International Conference on Data Mining":"IEEE International Conference on Data Mining (ICDM)",ICDM:"IEEE International Conference on Data Mining (ICDM)","International World Wide Web Conference":"International World Wide Web Conference (WWW)",WWW:"International World Wide Web Conference (WWW)","International Conference on Web Search and Data Mining":"ACM International Conference on Web Search and Data Mining (WSDM)",WSDM:"ACM International Conference on Web Search and Data Mining (WSDM)","Research and Development in Information Retrieval":"ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR)",SIGIR:"ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR)"},journal:{"IEEE Transactions on Pattern Analysis and Machine Intelligence":"IEEE Transactions on Pattern Analysis and Machine Intelligence (T-PAMI)","T-PAMI":"IEEE Transactions on Pattern Analysis and Machine Intelligence (T-PAMI)","IEEE Transactions on Image Processing":"IEEE Transactions on Image Processing (T-IP)","T-IP":"IEEE Transactions on Image Processing (T-IP)","IEEE Transactions on Neural Networks and Learning Systems":"IEEE Transactions on Neural Networks and Learning Systems (T-NNLS)","T-NNLS":"IEEE Transactions on Neural Networks and Learning Systems (T-NNLS)","IEEE Transactions on Cybernetics":"IEEE Transactions on Cybernetics","ACM Transactions on Intelligent Systems and Technology":"ACM Transactions on Intelligent Systems and Technology (T-IST)","T-IST":"ACM Transactions on Intelligent Systems and Technology (T-IST)","Journal of Machine Learning Research":"Journal of Machine Learning Research (JMLR)",JMLR:"Journal of Machine Learning Research (JMLR)","Transactions on Machine Learning Research":"Transactions on Machine Learning Research (TMLR)",TMLR:"Transactions on Machine Learning Research (TMLR)","Journal of Artificial Intelligence Research":"Journal of Artificial Intelligence Research (JAIR)",JAIR:"Journal of Artificial Intelligence Research (JAIR)"}},S=class S extends p{constructor(){super({id:"@future-scholars/paperlib-formatx-pubname-extension",defaultPreference:{removeYear:{type:"boolean",name:"Remove year",description:"Remove year string from publication names",value:!0,order:0},cvPreset:{type:"boolean",name:"CV Preset",description:"Computer Vision conferences (CVPR, ICCV, ECCV)",value:!1,order:1},mlPreset:{type:"boolean",name:"ML Preset",description:"Machine Learning conferences (NeurIPS, ICLR, ICML, AISTATS, COLT)",value:!1,order:2},aiPreset:{type:"boolean",name:"AI Preset",description:"Artificial Intelligence conferences (AAAI, IJCAI, ECAI, UAI, HRI)",value:!1,order:3},nlpPreset:{type:"boolean",name:"NLP Preset",description:"NLP conferences (ACL, EMNLP, NAACL, COLING)",value:!1,order:4},dmPreset:{type:"boolean",name:"DM Preset",description:"Data Mining & IR conferences (KDD, ICDM, WWW, WSDM, SIGIR)",value:!1,order:5},journalPreset:{type:"boolean",name:"Journal Preset",description:"Journals (T-PAMI, T-IP, T-NNLS, JMLR, TMLR, JAIR, etc.)",value:!1,order:6},customFormat:{type:"string",name:"Custom format",description:"A json string to define your custom format for publication names. Highest priority, matched first.",value:"",order:7},exactMatch:{type:"boolean",name:"Exact match",description:"If checked, the format will only be applied if the key is an exact match of the publication name. Applies to both presets and custom format.",value:!1,order:8}}});d(this,"disposeCallbacks");this.disposeCallbacks=[]}async initialize(){await PLExtAPI.extensionPreferenceService.register(this.id,this.defaultPreference),this.disposeCallbacks.push(PLAPI.hookService.hookModify("afterScrapeMetadata",this.id,"modifyPubnameHook")),this.disposeCallbacks.push(PLAPI.commandService.on("format_pubnames_event",e=>{this.formatLibrary()})),this.disposeCallbacks.push(PLAPI.commandService.registerExternel({id:"format_pubnames",description:"Format the publication names of your papers.",event:"format_pubnames_event"}))}async dispose(){PLExtAPI.extensionPreferenceService.unregister(this.id),this.disposeCallbacks.forEach(e=>e())}_matchKey(e,t,a){return a?e===t:e.toLowerCase().includes(t.toLowerCase())&&!e.toLowerCase().includes("workshop")}_getPresetMap(e){const t={};return e.cvPreset&&Object.assign(t,u.cv),e.mlPreset&&Object.assign(t,u.ml),e.aiPreset&&Object.assign(t,u.ai),e.nlpPreset&&Object.assign(t,u.nlp),e.dmPreset&&Object.assign(t,u.dm),e.journalPreset&&Object.assign(t,u.journal),t}_modifyPubname(e,t,a,c,f){for(const s of e){t&&(s.publication=s.publication.replace(/\s\d{4}\s/g," ").trim());let P=!1;if(a&&Object.keys(a).length>0){const l=Object.keys(a).sort((i,I)=>I.length-i.length);for(const i of l)if(this._matchKey(s.publication,i,f)){s.publication=a[i],P=!0;break}}if(!P&&Object.keys(c).length>0){const l=Object.keys(c).sort((i,I)=>I.length-i.length);for(const i of l)if(this._matchKey(s.publication,i,f)){s.publication=c[i];break}}}return e}async modifyPubnameHook(e,t,a){const c=PLExtAPI.extensionPreferenceService.get(this.id,"removeYear"),f=PLExtAPI.extensionPreferenceService.get(this.id,"cvPreset"),s=PLExtAPI.extensionPreferenceService.get(this.id,"mlPreset"),P=PLExtAPI.extensionPreferenceService.get(this.id,"aiPreset"),l=PLExtAPI.extensionPreferenceService.get(this.id,"nlpPreset"),i=PLExtAPI.extensionPreferenceService.get(this.id,"dmPreset"),I=PLExtAPI.extensionPreferenceService.get(this.id,"journalPreset"),m=PLExtAPI.extensionPreferenceService.get(this.id,"customFormat"),A=PLExtAPI.extensionPreferenceService.get(this.id,"exactMatch");let C;if(m)try{C=JSON.parse(m)}catch(h){PLAPI.logService.error("Error parsing custom format",h,!0,"FormatPubnameExt")}const o=this._getPresetMap({cvPreset:f,mlPreset:s,aiPreset:P,nlpPreset:l,dmPreset:i,journalPreset:I});return[this._modifyPubname(e,c,C,o,A),t,a]}async formatLibrary(){const e=await PLAPI.paperService.load("","addTime","desc"),t=PLExtAPI.extensionPreferenceService.get(this.id,"removeYear"),a=PLExtAPI.extensionPreferenceService.get(this.id,"cvPreset"),c=PLExtAPI.extensionPreferenceService.get(this.id,"mlPreset"),f=PLExtAPI.extensionPreferenceService.get(this.id,"aiPreset"),s=PLExtAPI.extensionPreferenceService.get(this.id,"nlpPreset"),P=PLExtAPI.extensionPreferenceService.get(this.id,"dmPreset"),l=PLExtAPI.extensionPreferenceService.get(this.id,"journalPreset"),i=PLExtAPI.extensionPreferenceService.get(this.id,"customFormat"),I=PLExtAPI.extensionPreferenceService.get(this.id,"exactMatch");let m;if(i)try{m=JSON.parse(i)}catch(o){PLAPI.logService.error("Error parsing custom format",o,!0,"FormatPubnameExt")}const A=this._getPresetMap({cvPreset:a,mlPreset:c,aiPreset:f,nlpPreset:s,dmPreset:P,journalPreset:l}),C=[];for(const o of e){const h=o.publication,[y]=this._modifyPubname([o],t,m,A,I);y.publication!==h&&C.push(y)}for(let o=0;o<C.length;o+=10)await PLAPI.paperService.update(C.slice(o,o+10),!1,!0)}};g(S,"PaperlibFormatPubnameExtension");let E=S;async function b(){const r=new E;return await r.initialize(),r}g(b,"initialize");exports.initialize=b;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@future-scholars/paperlib-format-pubname-extension",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "author": "Paperlib",
5
5
  "description": "This extension helps you automatically format the publication name. For example: 2017 ABC Conference -> ABC Conference.",
6
6
  "homepage": "https://github.com/Future-Scholars/paperlib-format-pubname-extension",
package/readme.md CHANGED
@@ -1,12 +1,286 @@
1
1
  # Paperlib Format Publication Name Extension
2
2
 
3
+ # Paperlib Format Publication Name Extension
4
+
3
5
  This extension helps you automatically format the publication name when you import a paper into your library.
4
6
  For example: 2017 ABC Conference -> ABC Conference.
5
7
  It also supports define your custom formats.
6
8
 
7
9
  For existing papers in your library, it provides a command `\format_pubnames`. Run it and boom!
8
10
 
9
- ## Custom Formats
11
+ ## Features
12
+
13
+ - **Multi-domain Presets**: Built-in presets for CV, ML, AI, NLP, Data Mining, and Journals
14
+ - **Custom Formats**: Define your own publication name formats with highest priority
15
+ - **Flexible Matching**: Support for exact match or fuzzy match
16
+ - **Year Removal**: Automatically remove year strings from publication names
17
+
18
+ ## Installation
19
+
20
+ ### Local Installation
21
+
22
+ 1. Clone or download this repository
23
+ 2. Install dependencies:
24
+ ```bash
25
+ pnpm install
26
+ ```
27
+ 3. Build the extension:
28
+ ```bash
29
+ pnpm build
30
+ ```
31
+ 4. In Paperlib, go to **Settings → Extensions → Install from local folder**
32
+ 5. Select the **project root directory** (the folder containing `package.json`)
33
+
34
+ ## Usage
35
+
36
+ ### Presets
37
+
38
+ Enable the presets you need in the extension preferences. Each preset covers a specific domain:
39
+
40
+ | Preset | Conferences/Journals |
41
+ |--------|---------------------|
42
+ | **CV Preset** | CVPR, ICCV, ECCV |
43
+ | **ML Preset** | NeurIPS, ICLR, ICML, AISTATS, COLT |
44
+ | **AI Preset** | AAAI, IJCAI, ECAI, UAI, HRI |
45
+ | **NLP Preset** | ACL, EMNLP, NAACL, COLING, CL Journal |
46
+ | **DM Preset** | KDD, ICDM, WWW, WSDM, SIGIR |
47
+ | **Journal Preset** | T-PAMI, T-IP, T-NNLS, JMLR, TMLR, JAIR, etc. |
48
+
49
+ ### Matching Priority
50
+
51
+ ```
52
+ Custom format → Presets (merged) → Original name
53
+ ```
54
+
55
+ 1. **Custom format** is matched first (highest priority)
56
+ 2. If no match, **enabled presets** are merged and matched
57
+ 3. Keys are sorted by length (longest first) for precise matching
58
+
59
+ ### Preferences
60
+
61
+ | Option | Type | Default | Description |
62
+ |--------|------|---------|-------------|
63
+ | **Remove year** | boolean | `true` | Remove year string from publication names |
64
+ | **CV Preset** | boolean | `false` | Computer Vision conferences |
65
+ | **ML Preset** | boolean | `false` | Machine Learning conferences |
66
+ | **AI Preset** | boolean | `false` | Artificial Intelligence conferences |
67
+ | **NLP Preset** | boolean | `false` | NLP conferences |
68
+ | **DM Preset** | boolean | `false` | Data Mining & IR conferences |
69
+ | **Journal Preset** | boolean | `false` | Journals |
70
+ | **Custom format** | string | `""` | Custom format JSON (highest priority) |
71
+ | **Exact match** | boolean | `false` | Exact match for both presets and custom format |
72
+
73
+ ### Custom Formats
74
+
75
+ Define custom formats in JSON. Custom formats have the highest priority and will override presets:
76
+
77
+ ```json
78
+ {"CVPR": "CVPR", "NeurIPS": "NeurIPS"}
79
+ ```
80
+
81
+ ### Command
82
+
83
+ Use `\format_pubnames` command to format publication names for all existing papers in your library.
84
+
85
+ ---
86
+
87
+ ## Developer Guide
88
+
89
+ ### Project Structure
90
+
91
+ ```
92
+ paperlib-formatX-pubname-extension/
93
+ ├── src/
94
+ │ └── main.ts # Main extension code
95
+ ├── dist/ # Built extension (generated)
96
+ ├── package.json # Package configuration
97
+ ├── tsconfig.json # TypeScript configuration
98
+ ├── vite.config.ts # Vite build configuration
99
+ └── readme.md # This file
100
+ ```
101
+
102
+ ### Code Architecture
103
+
104
+ ```typescript
105
+ // Presets are organized by domain
106
+ const PRESETS = {
107
+ cv: { /* CVPR, ICCV, ECCV */ },
108
+ ml: { /* NeurIPS, ICLR, ICML, ... */ },
109
+ ai: { /* AAAI, IJCAI, ECAI, UAI, HRI */ },
110
+ nlp: { /* ACL, EMNLP, NAACL, COLING */ },
111
+ dm: { /* KDD, ICDM, WWW, WSDM, SIGIR */ },
112
+ journal: { /* T-PAMI, JMLR, ... */ },
113
+ };
114
+ ```
115
+
116
+ ### Matching Flow
117
+
118
+ ```
119
+ ┌─────────────────────────────────────────────────────────────┐
120
+ │ Input: publication │
121
+ └─────────────────────────────────────────────────────────────┘
122
+
123
+
124
+ ┌─────────────────────────────────────────────────────────────┐
125
+ │ removeYear enabled? ──No──→ Skip │
126
+ │ │Yes │
127
+ │ ▼ │
128
+ │ Remove year (e.g., "2023 CVPR" → "CVPR") │
129
+ └─────────────────────────────────────────────────────────────┘
130
+
131
+
132
+ ┌─────────────────────────────────────────────────────────────┐
133
+ │ customFormat exists? ──No──→ Go to Step B │
134
+ │ │Yes │
135
+ │ ▼ │
136
+ │ Step A: Match in customFormat (sorted by key length) │
137
+ │ ┌─────────────────────────────────────────────┐ │
138
+ │ │ exactMatch? │ │
139
+ │ │ Yes: publication === key? │ │
140
+ │ │ No: publication.includes(key)? │ │
141
+ │ │ && !includes("workshop") │ │
142
+ │ └─────────────────────────────────────────────┘ │
143
+ │ │ │
144
+ │ ┌───────┴───────┐ │
145
+ │ ▼ ▼ │
146
+ │ Match found No match │
147
+ │ │ │ │
148
+ │ ▼ ▼ │
149
+ │ Return custom Continue to Step B │
150
+ │ result │
151
+ └─────────────────────────────────────────────────────────────┘
152
+
153
+
154
+ ┌─────────────────────────────────────────────────────────────┐
155
+ │ Step B: Check if any preset is enabled │
156
+ │ │
157
+ │ All presets disabled? ──Yes──→ Return original │
158
+ │ │No │
159
+ │ ▼ │
160
+ │ Merge all enabled presets → presetMap │
161
+ └─────────────────────────────────────────────────────────────┘
162
+
163
+
164
+ ┌─────────────────────────────────────────────────────────────┐
165
+ │ Step C: Match in presetMap (sorted by key length) │
166
+ │ ┌─────────────────────────────────────────────┐ │
167
+ │ │ exactMatch? │ │
168
+ │ │ Yes: publication === key? │ │
169
+ │ │ No: publication.includes(key)? │ │
170
+ │ │ && !includes("workshop") │ │
171
+ │ └─────────────────────────────────────────────┘ │
172
+ │ │ │
173
+ │ ┌───────┴───────┐ │
174
+ │ ▼ ▼ │
175
+ │ Match found No match │
176
+ │ │ │ │
177
+ │ ▼ ▼ │
178
+ │ Return preset Return original │
179
+ │ result publication │
180
+ └─────────────────────────────────────────────────────────────┘
10
181
  ```
11
- {"some keywords": "target name", "another keywords": "another target name"}
12
- ```
182
+
183
+ ### Adding New Presets
184
+
185
+ To add a new preset:
186
+
187
+ 1. Add a new key to `PRESETS` object in `src/main.ts`:
188
+ ```typescript
189
+ const PRESETS = {
190
+ // ... existing presets
191
+ newDomain: {
192
+ "Full Conference Name": "Formatted Name (Abbreviation)",
193
+ "Abbreviation": "Formatted Name (Abbreviation)",
194
+ },
195
+ };
196
+ ```
197
+
198
+ 2. Add corresponding preference in `defaultPreference`:
199
+ ```typescript
200
+ newDomainPreset: {
201
+ type: "boolean",
202
+ name: "New Domain Preset",
203
+ description: "Description of the preset",
204
+ value: false,
205
+ order: X, // appropriate order number
206
+ },
207
+ ```
208
+
209
+ 3. Update `_getPresetMap()` to include the new preset:
210
+ ```typescript
211
+ if (prefs.newDomainPreset) Object.assign(merged, PRESETS.newDomain);
212
+ ```
213
+
214
+ 4. Update the preference reading in `modifyPubnameHook()` and `formatLibrary()`
215
+
216
+ 5. Rebuild: `pnpm build`
217
+
218
+ ### Contributing
219
+
220
+ 1. Fork the repository
221
+ 2. Create a feature branch: `git checkout -b feature/new-feature`
222
+ 3. Make your changes
223
+ 4. Build and test: `pnpm build`
224
+ 5. Submit a pull request
225
+
226
+ ---
227
+
228
+ ## Preset Details
229
+
230
+ ### Computer Vision (CV Preset)
231
+
232
+ | Key | Formatted Name |
233
+ |-----|----------------|
234
+ | CVPR | IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) |
235
+ | ICCV | IEEE/CVF International Conference on Computer Vision (ICCV) |
236
+ | ECCV | European Conference on Computer Vision (ECCV) |
237
+
238
+ ### Machine Learning (ML Preset)
239
+
240
+ | Key | Formatted Name |
241
+ |-----|----------------|
242
+ | NeurIPS/NIPS | Advances in Neural Information Processing Systems (NeurIPS) |
243
+ | ICLR | International Conference on Learning Representations (ICLR) |
244
+ | ICML | International Conference on Machine Learning (ICML) |
245
+ | AISTATS | International Conference on Artificial Intelligence and Statistics (AISTATS) |
246
+ | COLT | Conference on Learning Theory (COLT) |
247
+
248
+ ### Artificial Intelligence (AI Preset)
249
+
250
+ | Key | Formatted Name |
251
+ |-----|----------------|
252
+ | AAAI | AAAI Conference on Artificial Intelligence (AAAI) |
253
+ | IJCAI | International Joint Conference on Artificial Intelligence (IJCAI) |
254
+ | ECAI | European Conference on Artificial Intelligence (ECAI) |
255
+ | UAI | Conference on Uncertainty in Artificial Intelligence (UAI) |
256
+ | HRI | ACM/IEEE International Conference on Human-Robot Interaction (HRI) |
257
+
258
+ ### Natural Language Processing (NLP Preset)
259
+
260
+ | Key | Formatted Name |
261
+ |-----|----------------|
262
+ | ACL | Association for Computational Linguistics (ACL) |
263
+ | NAACL | Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL) |
264
+ | EMNLP | Conference on Empirical Methods in Natural Language Processing (EMNLP) |
265
+ | COLING | International Conference on Computational Linguistics (COLING) |
266
+
267
+ ### Data Mining & Information Retrieval (DM Preset)
268
+
269
+ | Key | Formatted Name |
270
+ |-----|----------------|
271
+ | KDD | ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD) |
272
+ | ICDM | IEEE International Conference on Data Mining (ICDM) |
273
+ | WWW | International World Wide Web Conference (WWW) |
274
+ | WSDM | ACM International Conference on Web Search and Data Mining (WSDM) |
275
+ | SIGIR | ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR) |
276
+
277
+ ### Journals (Journal Preset)
278
+
279
+ | Key | Formatted Name |
280
+ |-----|----------------|
281
+ | T-PAMI | IEEE Transactions on Pattern Analysis and Machine Intelligence (T-PAMI) |
282
+ | T-IP | IEEE Transactions on Image Processing (T-IP) |
283
+ | T-NNLS | IEEE Transactions on Neural Networks and Learning Systems (T-NNLS) |
284
+ | JMLR | Journal of Machine Learning Research (JMLR) |
285
+ | TMLR | Transactions on Machine Learning Research (TMLR) |
286
+ | JAIR | Journal of Artificial Intelligence Research (JAIR) |