diff --git a/manifest.json b/manifest.json index 11978db..eb9096c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "pocketbook-cloud-highlight-importer", "name": "Pocketbook Cloud Highlight Importer", - "version": "0.1.1", + "version": "0.1.2", "minAppVersion": "1.1.16", "description": "Imports notes and highlights from your Pocketbook Cloud account.", "author": "Lena BrĂ¼der", diff --git a/package-lock.json b/package-lock.json index a210b42..7a525b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "epub-cfi-resolver": "^1.0.1", - "yaml": "^2.2.1" + "epub-cfi-resolver": "^1.0.1" }, "devDependencies": { "@types/node": "^16.11.6", @@ -5031,6 +5030,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "dev": true, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index f820b03..40435ac 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "typescript": "4.7.4" }, "dependencies": { - "epub-cfi-resolver": "^1.0.1", - "yaml": "^2.2.1" + "epub-cfi-resolver": "^1.0.1" } } diff --git a/src/import.ts b/src/import.ts index caea2d2..2e29ded 100644 --- a/src/import.ts +++ b/src/import.ts @@ -1,5 +1,4 @@ -import { App, Notice, TFile } from 'obsidian'; -import { stringify } from 'yaml'; +import { App, Notice, TFile, stringifyYaml } from 'obsidian'; import { PocketbookCloudApiClient, PocketbookCloudLoginClient } from './apiclient'; import PocketbookCloudHighlightsImporterPlugin from './main'; import { PocketbookCloudHighlightsImporterPluginSettings } from './settings'; @@ -60,7 +59,7 @@ export class PocketbookCloudHighlightsImporter { }; const content = // not using multiline strings because they mess up indentation '---\n' + - stringify(book_yaml_frontmatter) + + stringifyYaml(book_yaml_frontmatter) + '---\n\n' + '```dataviewjs\n' + 'dv.header(2, dv.current().title)\n' + @@ -105,7 +104,7 @@ export class PocketbookCloudHighlightsImporter { }; const content = // not using multiline strings because they mess up indentation '---\n' + - stringify(highlight_yaml_frontmatter) + + stringifyYaml(highlight_yaml_frontmatter) + '---\n\n' + `> [!quote]\n> ${highlight.quotation?.text ?? ''}\n\n` + // (highlight.note?.text ? `> [!note]\n> ${highlight.note?.text ?? ''}\n` : ''); diff --git a/src/main.ts b/src/main.ts index 5d51d05..6dde5df 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,8 +2,6 @@ import { Plugin } from 'obsidian'; import { PocketbookCloudHighlightsImporter } from './import'; import { DEFAULT_SETTINGS, PocketbookCloudHighlightsImporterPluginSettings, PocketbookCloudHighlightsImporterSettingTab } from './settings'; -// Remember to rename these classes and interfaces! - export default class PocketbookCloudHighlightsImporterPlugin extends Plugin { settings: PocketbookCloudHighlightsImporterPluginSettings; importer: PocketbookCloudHighlightsImporter; @@ -14,7 +12,7 @@ export default class PocketbookCloudHighlightsImporterPlugin extends Plugin { // This adds a simple command that can be triggered anywhere this.addCommand({ - id: 'pocketbook-cloud-importer-perform-import', + id: 'perform-import', name: 'Import highlights & notes', callback: () => { this.importer.importHighlights(); diff --git a/versions.json b/versions.json index e571774..93b3b37 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "0.1.1": "1.1.16" + "0.1.1": "1.1.16", + "0.1.2": "1.1.16" }