@future-scholars/paperlib-format-pubname-extension 0.0.6 → 0.0.7
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.
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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-format-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.
|
|
3
|
+
"version": "0.0.7",
|
|
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
|
@@ -89,7 +89,7 @@ Use `\format_pubnames` command to format publication names for all existing pape
|
|
|
89
89
|
### Project Structure
|
|
90
90
|
|
|
91
91
|
```
|
|
92
|
-
paperlib-
|
|
92
|
+
paperlib-format-pubname-extension/
|
|
93
93
|
├── src/
|
|
94
94
|
│ └── main.ts # Main extension code
|
|
95
95
|
├── dist/ # Built extension (generated)
|