mirror of
https://github.com/lenalebt/obsidian-pocketbook-cloud-highlight-importer.git
synced 2026-07-22 07:40:24 +00:00
changes according to review comments
comments from https://github.com/obsidianmd/obsidian-releases/pull/1807#issuecomment-1486403991
This commit is contained in:
parent
2b5f7a67ce
commit
e0ba9f81d2
6 changed files with 10 additions and 13 deletions
|
|
@ -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",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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` : '');
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"0.1.1": "1.1.16"
|
||||
"0.1.1": "1.1.16",
|
||||
"0.1.2": "1.1.16"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue