diff --git a/README.md b/README.md index 0cd4a77..2919fda 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,21 @@ To develop the project: - Start the development server with `bun dev`. - Format and lint (with autofixes) with `bun fix`. +The build process generates main.js and places it in the root of the repo. +I commit this file to Github for simplicity. + +To create a release: + +- Increment the version: `bun version `, where the name is e.g., `1.0.0-beta4`. +- Commit the (now-changed) package.json and manifest.json files. +- Create a new tag with the same name: `git tag -a -m ` +- Push the commit(s) & tag. + +In response to pushing the tag, Github Actions will create a new release that includes the main.js & manifest.json files.. + ## Releases -I have not released this plugin and don't plan to. -If you're interested in using this plugin, please install it via the excellent and community-maintained [BRAT](https://github.com/TfTHacker/obsidian42-brat) +I have created beta releases to support installation with the excellent, community-maintained [BRAT](https://github.com/TfTHacker/obsidian42-brat). +I don't plan to submit this as an official plugin unless there is interest from not-just-me. Issues, PRs, and discussions are welcome. +If you like this, please let me know! diff --git a/main.js b/main.js index 097a476..a65b638 100644 --- a/main.js +++ b/main.js @@ -123,13 +123,13 @@ class DailyHighlightsPlugin extends obsidian.Plugin { * highlight. This uses the Readwise plugin settings, which already map book titles * to book IDs for the usual syncing. */ - findFile({ bookId }) { + findFile({ bookId, title }) { const { booksIDsMap } = this.getOfficialPluginSettings(); const bookTitle = Object.keys(booksIDsMap).find( - (title) => booksIDsMap[title] === bookId.toString() + (title2) => booksIDsMap[title2] === bookId.toString() ); if (!bookTitle) { - throw new Error(`No book found for id ${bookId}`); + throw new Error(`No book found for '${title}' with id ${bookId}`); } const maybeFile = this.app.vault.getAbstractFileByPath(bookTitle); if (maybeFile instanceof obsidian.TFile) @@ -155,6 +155,7 @@ class DailyHighlightsPlugin extends obsidian.Plugin { const highlightsWithLinks = blocks.flatMap( (x) => x.status === "fulfilled" ? [x.value] : [] ); + console.log(blocks, highlightsWithLinks); const modalContents = highlightsWithLinks.map((x) => ({ highlightId: x.block.id, text: x.highlight.text, diff --git a/src/main.ts b/src/main.ts index bde0d45..315a24f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -141,7 +141,7 @@ export default class DailyHighlightsPlugin extends Plugin { * highlight. This uses the Readwise plugin settings, which already map book titles * to book IDs for the usual syncing. */ - findFile({ bookId }: Highlight): TFile { + findFile({ bookId, title }: Highlight): TFile { const { booksIDsMap } = this.getOfficialPluginSettings(); // Find the key/value pair where the value matches the book ID @@ -149,7 +149,7 @@ export default class DailyHighlightsPlugin extends Plugin { (title) => booksIDsMap[title] === bookId.toString(), ); if (!bookTitle) { - throw new Error(`No book found for id ${bookId}`); + throw new Error(`No book found for '${title}' with id ${bookId}`); } const maybeFile = this.app.vault.getAbstractFileByPath(bookTitle);