Skip to content

Commit 98bf241

Browse files
committed
v0.0.22
2 parents 9b1b23d + 5ca6dce commit 98bf241

8 files changed

+12
-5
lines changed

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "obsidian-raindrop-highlights",
33
"name": "Raindrop Highlights",
4-
"version": "0.0.21",
4+
"version": "0.0.22",
55
"minAppVersion": "0.14.0",
66
"description": "Sync your Raindrop.io highlights.",
77
"author": "kaiiiz",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-raindrop-highlights",
3-
"version": "0.0.21",
3+
"version": "0.0.22",
44
"description": "Sync your Raindrop.io highlights.",
55
"main": "main.js",
66
"scripts": {

src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import DEFAULT_TEMPLATE from "./assets/defaultTemplate.njk";
22
import type { RaindropPluginSettings } from "./types";
33

4-
export const VERSION = "0.0.21";
4+
export const VERSION = "0.0.22";
55

66
export const DEFAULT_SETTINGS: RaindropPluginSettings = {
77
version: VERSION,

src/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default class RaindropPlugin extends Plugin {
5151
name: "Sync this bookmark",
5252
callback: async () => {
5353
const file = app.workspace.getActiveFile();
54+
await this.raindropSync.syncSingle({ file: file });
5455
},
5556
});
5657

src/renderer.ts

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type RenderTemplate = {
3939
important: boolean;
4040
creator: RenderCreator;
4141
now: moment.Moment;
42+
raindropUrl: string;
4243
};
4344

4445
const FAKE_RENDER_CONTEXT: RenderTemplate = {
@@ -71,6 +72,7 @@ const FAKE_RENDER_CONTEXT: RenderTemplate = {
7172
id: 10000,
7273
},
7374
now: Moment(),
75+
raindropUrl: "https://example.com"
7476
};
7577

7678
export default class Renderer {
@@ -171,6 +173,7 @@ ${fakeContent}`;
171173
important: bookmark.important,
172174
creator: bookmark.creator,
173175
now: Moment(),
176+
raindropUrl: `https://app.raindrop.io/my/${bookmark.collectionId}/item/${bookmark.id}/edit`,
174177
};
175178

176179
const env = this.createEnv();

src/sync.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default class RaindropSync {
3636
}
3737
}
3838

39-
async syncSingle({ file }: { file: TFile }) {
39+
async syncSingle({ file }: { file: TFile | null }) {
4040
let raindropId: number;
4141
if (file) {
4242
const fmc = this.app.metadataCache.getFileCache(file)?.frontmatter;
@@ -55,6 +55,7 @@ export default class RaindropSync {
5555
await this.updateFileContent(file, bookmark);
5656
// Do not perform path sync here!
5757
// 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.
58+
new Notice(`Sync ${bookmark.title} completed`);
5859
}
5960

6061
private getSyncFolder(collection: SyncCollection) {

src/templates/templateInstructions.html

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<li><span class="u-pop">{{created}}</span> (Moment) - Created on</li>
2727
<li><span class="u-pop">{{type}}</span> (string) - Article type</li>
2828
<li><span class="u-pop">{{important}}</span> (bool) - Favorite article</li>
29+
<li><span class="u-pop">{{raindropUrl}}</span> (string) - Link to raindrop page</li>
2930
</ul>
3031

3132
Creator

versions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"0.0.18": "0.14.0",
2020
"0.0.19": "0.14.0",
2121
"0.0.20": "0.14.0",
22-
"0.0.21": "0.14.0"
22+
"0.0.21": "0.14.0",
23+
"0.0.22": "0.14.0"
2324
}

0 commit comments

Comments
 (0)