Skip to content

Commit

Permalink
capitalized and fixed itemtype
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanopagliari committed Aug 1, 2022
1 parent 0e3565b commit ac77ebf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bibnotes",
"name": "BibNotes Formatter",
"version": "0.9.208",
"version": "0.9.209",
"minAppVersion": "0.12.0",
"description": "Plugin to import and format annotations from Zotero.",
"author": "Stefano Pagliari",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bibnotes",
"version": "0.9.208",
"version": "0.9.209",
"description": "Plugin to export and format annotations from Zotero into Obsidian",
"main": "main.js",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"builtin-modules": "^3.2.0",
"esbuild": "^0.13.12",
"esbuild": "^0.13.15",
"obsidian": "^0.12.17",
"tslib": "2.3.1",
"typescript": "^4.4.4"
Expand Down
14 changes: 14 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,20 @@ export default class MyPlugin extends Plugin {

}

//Fix itemType
if(selectedEntry.itemType == "journalArticle"){selectedEntry.itemType = "Journal Article"}
if(selectedEntry.itemType == "report"){selectedEntry.itemType = "Report"}
if(selectedEntry.itemType == "bookSection"){selectedEntry.itemType = "Book Section"}
if(selectedEntry.itemType == "newspaperArticle"){selectedEntry.itemType = "Newspaper Article"}
if(selectedEntry.itemType == "book"){selectedEntry.itemType = "Book"}
//Capitalize the first letter
selectedEntry.itemType = selectedEntry.itemType.charAt(0).toUpperCase() + selectedEntry.itemType.slice(1);






//create field file
//if (selectedEntry.hasOwnProperty("attachment.")){
selectedEntry.file = createLocalFileLink(selectedEntry);
Expand Down

0 comments on commit ac77ebf

Please sign in to comment.