Skip to content

Commit

Permalink
v0.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiiiz committed May 25, 2024
2 parents 9b1b23d + 5ca6dce commit 98bf241
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-raindrop-highlights",
"name": "Raindrop Highlights",
"version": "0.0.21",
"version": "0.0.22",
"minAppVersion": "0.14.0",
"description": "Sync your Raindrop.io highlights.",
"author": "kaiiiz",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-raindrop-highlights",
"version": "0.0.21",
"version": "0.0.22",
"description": "Sync your Raindrop.io highlights.",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DEFAULT_TEMPLATE from "./assets/defaultTemplate.njk";
import type { RaindropPluginSettings } from "./types";

export const VERSION = "0.0.21";
export const VERSION = "0.0.22";

export const DEFAULT_SETTINGS: RaindropPluginSettings = {
version: VERSION,
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class RaindropPlugin extends Plugin {
name: "Sync this bookmark",
callback: async () => {
const file = app.workspace.getActiveFile();
await this.raindropSync.syncSingle({ file: file });
},
});

Expand Down
3 changes: 3 additions & 0 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type RenderTemplate = {
important: boolean;
creator: RenderCreator;
now: moment.Moment;
raindropUrl: string;
};

const FAKE_RENDER_CONTEXT: RenderTemplate = {
Expand Down Expand Up @@ -71,6 +72,7 @@ const FAKE_RENDER_CONTEXT: RenderTemplate = {
id: 10000,
},
now: Moment(),
raindropUrl: "https://example.com"
};

export default class Renderer {
Expand Down Expand Up @@ -171,6 +173,7 @@ ${fakeContent}`;
important: bookmark.important,
creator: bookmark.creator,
now: Moment(),
raindropUrl: `https://app.raindrop.io/my/${bookmark.collectionId}/item/${bookmark.id}/edit`,
};

const env = this.createEnv();
Expand Down
3 changes: 2 additions & 1 deletion src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class RaindropSync {
}
}

async syncSingle({ file }: { file: TFile }) {
async syncSingle({ file }: { file: TFile | null }) {
let raindropId: number;
if (file) {
const fmc = this.app.metadataCache.getFileCache(file)?.frontmatter;
Expand All @@ -55,6 +55,7 @@ export default class RaindropSync {
await this.updateFileContent(file, bookmark);
// Do not perform path sync here!
// Since we do not know which collection sync this bookmark (e.g. bookmark "b1" in "Collection 1" may also be synced if you enable "All Bookmarks" collection), which leads to ambiguity.
new Notice(`Sync ${bookmark.title} completed`);
}

private getSyncFolder(collection: SyncCollection) {
Expand Down
1 change: 1 addition & 0 deletions src/templates/templateInstructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<li><span class="u-pop">{{created}}</span> (Moment) - Created on</li>
<li><span class="u-pop">{{type}}</span> (string) - Article type</li>
<li><span class="u-pop">{{important}}</span> (bool) - Favorite article</li>
<li><span class="u-pop">{{raindropUrl}}</span> (string) - Link to raindrop page</li>
</ul>

Creator
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"0.0.18": "0.14.0",
"0.0.19": "0.14.0",
"0.0.20": "0.14.0",
"0.0.21": "0.14.0"
"0.0.21": "0.14.0",
"0.0.22": "0.14.0"
}

0 comments on commit 98bf241

Please sign in to comment.