You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-24
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Readwise Mirror Plugin
2
2
3
3
>[!WARNING]
4
-
>Readwise Mirror 2.x is a major rewrite of the plugin which will break internal links if you update right away. This is due to changes how the filenames for notes created by this plugin are generated and handled.
4
+
>Readwise Mirror 2.x is a major rewrite of the plugin which will break internal links if you update right away. This is due to changes how the filenames for notes created by this plugin are generated and handled.
5
5
>The documentation contains a step-by-step guide how you can prepare an existing Readwise library for an upgrade to 2.x.x by adding the `uri` tracking property to the frontmatter of your notes before upgrading. This will ensure links to notes synced from your Readwise library can be updated by Obsidian after the upgrade. You can find the guide [here](#upgrading-from-1xx-to-2xx).
6
6
7
-
**Readwise Mirror** is an unoffical open source plugin for the powerful note-taking and knowledge-base application [Obsidian](http://obsidian.md/). This plugin allows a user to "mirror" their entire Readwise library by automatically downloading all highlights/notes and syncing changes directly into an Obsidian vault.
7
+
**Readwise Mirror** is an unoffical open source plugin for the powerful note-taking and knowledge-base application [Obsidian](http://obsidian.md/). This plugin allows a user to "mirror" their entire Readwise library by automatically downloading all highlights/notes and syncing changes directly into an Obsidian vault.
8
8
9
9
Its advanced features allow you to keep internal links to your Readwise notes intact across syncs, protect or update frontmatter properties in your notes, and define custom filenames based on each Readwise item's properties.
10
10
@@ -101,7 +101,7 @@ The current recommended way to test beta features is through frozen beta version
101
101
2. Open BRAT settings and add the beta repository:
102
102
- Click "Add Beta Plugin with frozen version"
103
103
- Enter `jsonMartin/readwise-mirror`
104
-
- Select the preferred (pre-)release or `latest` in the version dropdown (available from BRAT `1.1.0`)
104
+
- Select the preferred (pre-)release or `latest` in the version dropdown (available from BRAT `1.1.0`)
105
105
- Click "Add Plugin"
106
106
107
107
### Manual Download
@@ -113,34 +113,36 @@ The current recommended way to test beta features is through frozen beta version
113
113
- In Obsidian, go to Settings, scroll down to Community Plug-ins, and activate it.
114
114
- If it refuses to activate with an error message, open the developer console (with Ctrl-Shift-I) and check for error messages.
115
115
116
-
## Advanced features
116
+
## Advanced features
117
+
117
118
### File tracking
118
119
119
-
When File Tracking is enabled (via the File tracking settings on the "File tracking and naming" settings tab), the plugin uses the unique `highlights_url` field of a Readwise item to track unique documents from Readwise.[^4]
120
+
When File Tracking is enabled (via the File tracking settings on the "File tracking and naming" settings tab), the plugin uses the unique `highlights_url` field of a Readwise item to track unique documents from Readwise.[^4]
120
121
121
122
File tracking enables to key features in Readwise mirror:
122
123
123
-
- Updated internal links to your Readwise notes, and
124
+
- Updated internal links to your Readwise notes, and
124
125
- Robust handling of note filenames in case of duplicate filenames
125
126
126
127
#### Updated internal links
127
-
Linking between notes is an essential feature of Obsidian and file tracking enables that links to your Readwise notes are updated and working even if the filename of a note changes between sync runs.
128
128
129
-
If a user renames an Obsidian note or if a plugin programatically renames it, and if "Automatically update internal links" is enabled, Obsidian will ensure that all links to that note will be changed accordingly.
129
+
Linking between notes is an essential feature of Obsidian and file tracking enables that links to your Readwise notes are updated and working even if the filename of a note changes between sync runs.
130
+
131
+
If a user renames an Obsidian note or if a plugin programatically renames it, and if "Automatically update internal links" is enabled, Obsidian will ensure that all links to that note will be changed accordingly.
130
132
131
133
>[!IMPORTANT]
132
134
>File tracking searches existing Readwise notes with the tracking property **across your whole Obsidian vault**. If you have file tracking enabled and you move a note with the tracking property created by the plugin to another folder outside of the Readwise library folder, it will still be found and updated (overwritten) by the plugin if the original item has changes that trigger a sync. You have to remove the tracking property (`uri` or whatever you chose) from the note to sever the tracking. Future versions might offer an option to limit tracking to the Readwise library folder.
133
135
134
136
#### Duplicate notes
135
137
136
-
If for some reason, syncing would create two note files with the same filename in your Readwise folder, the plugin will ensure these are handled based on the plugin settings. It will either:
138
+
If for some reason, syncing would create two note files with the same filename in your Readwise folder, the plugin will ensure these are handled based on the plugin settings. It will either:
137
139
138
-
- ensure a unique filename for the duplicate note file, or
140
+
- ensure a unique filename for the duplicate note file, or
139
141
- delete a duplicate note file
140
142
141
-
The plugin will ensure you get one note file for each Readwise item, even in cases of two or more notes created from different Readwise items (i.e. items with a different `id`) end up having the same filename (e.g. because you use the default filename template which is baed on the `title` field and you have two Readwise items with the same title in your library).[^3]
143
+
The plugin will ensure you get one note file for each Readwise item, even in cases of two or more notes created from different Readwise items (i.e. items with a different `id`) end up having the same filename (e.g. because you use the default filename template which is baed on the `title` field and you have two Readwise items with the same title in your library).[^3]
142
144
143
-
Note files are grouped by their path (category (e.g. "Article", "Book", etc.)). Handling of duplicate filenames will be done at category level. Different items with the same filename in different categories are left untouched (say if you have highlights in "De iure belli ac pacis" both in Books and Supplemental Books).
145
+
Note files are grouped by their path (category (e.g. "Article", "Book", etc.)). Handling of duplicate filenames will be done at category level. Different items with the same filename in different categories are left untouched (say if you have highlights in "De iure belli ac pacis" both in Books and Supplemental Books).
144
146
145
147
This may still lead to situations where two notes in your Obsidian vault have the same filename, but with a different path. This is standard and expected behavior in Obsidian.
146
148
@@ -178,7 +180,7 @@ When multiple files share the same path:
178
180
179
181
### Custom filenames
180
182
181
-
You can define a template for custom filenames that can include various fields (e.g. `title`, `author`) which is used by the plugin to build a custom filename. You can also use filters to format certain fields.
183
+
You can define a template for custom filenames that can include various fields (e.g. `title`, `author`) which is used by the plugin to build a custom filename. You can also use filters to format certain fields.
182
184
183
185
For example, the following template will create a filename with an "ID" based on the date and time the Readwise document was created:
184
186
@@ -201,7 +203,7 @@ Using custom filenames can be viable strategy to create unique filenames, e.g. b
201
203
202
204
The plugin provides an option to "slugify" filenames. This means converting the filenames into a URL-friendly format by replacing spaces and special characters with hyphens or other safe characters.
203
205
204
-
If enabled, the plugin converts the filenames to a slugified format after it has applied the settings for custom filenames and the colon replacement character.
206
+
If enabled, the plugin converts the filenames to a slugified format after it has applied the settings for custom filenames and the colon replacement character.
205
207
206
208
For example, `My Book Title` becomes `my-book-title`. You can select a separator and whether the filename will be all lowercase.
207
209
@@ -397,7 +399,8 @@ The plugin provides filters that can be used in all templates (including in the
397
399
|`parse_authors`| Get array of authors from an author field |`{{ author \| parse_authors }}`|
398
400
399
401
#### Blockquote filter
400
-
If your highlight or note in Readwise spans multiple paragraphs, it can be difficult to get it as a proper blockquote in Obsidian as each paragraph, and the empty lines between, must begin with the quote character (`>`).
402
+
403
+
If your highlight or note in Readwise spans multiple paragraphs, it can be difficult to get it as a proper blockquote in Obsidian as each paragraph, and the empty lines between, must begin with the quote character (`>`).
401
404
402
405
The blockquote filter (`bq`) can will ensure that every new line in the filtered text starts with the quote character.
403
406
@@ -456,7 +459,7 @@ Rendered output:
456
459
457
460
#### Date format
458
461
459
-
The plugin provides a `date` filter which builds on [`moment.js`](https://momentjs.com/). It allow you to format any date with a template (e.g. `{{ created | date("YYYYMMDDD")}}` would result in `13 Apr 10125` to be formatted as `20250413`).
462
+
The plugin provides a `date` filter which builds on [`moment.js`](https://momentjs.com/). It allow you to format any date with a template (e.g. `{{ created | date("YYYYMMDDD")}}` would result in `13 Apr 10125` to be formatted as `20250413`).
@@ -497,13 +501,13 @@ The templating is based on the [`nunjucks`](https://mozilla.github.io/nunjucks/t
497
501
498
502
## Frontmatter management
499
503
500
-
The plugin provides powerful frontmatter management, including an update mode which keeps additional frontmatter properties that are not part of the plugin's frontmatter template untouched and optionally protected from accidential overwrites.
504
+
The plugin provides powerful frontmatter management, including an update mode which keeps additional frontmatter properties that are not part of the plugin's frontmatter template untouched and optionally protected from accidential overwrites.
501
505
502
506
This is particularly useful as it allows for example to protect a property field where you put links to other notes. A rerun of the sync for a specific note will always overwrite the body of the note. All links to other notes you might have added in the body manually will be lost during the next syny. But a protected frontmatter property with links to other notes will keep thes across the sync runs.
503
507
504
508
### Frontmatter template validation
505
509
506
-
Frontmatter in Obsidian is based on "YAML" syntax. This requires that property values are properly stored, for example to ensure newlines in a vlaue do not lead to invalid frontmatter. We therefore validate the frontmatter template using sample date, to ensure valid frontmatter is generated.
510
+
Frontmatter in Obsidian is based on "YAML" syntax. This requires that property values are properly stored, for example to ensure newlines in a vlaue do not lead to invalid frontmatter. We therefore validate the frontmatter template using sample date, to ensure valid frontmatter is generated.
507
511
508
512
### Update frontmatter
509
513
@@ -514,7 +518,7 @@ When enabled, the plugin updates frontmatter in already existing files during sy
514
518
When disabled, existing frontmatter will always completely be overwritten, and any additional properties added between sync runs will be lost.
515
519
516
520
>[!IMPORTANT]
517
-
>Frontmatter update works best with file tracking enabled to ensure consistent file and duplicates handling, even if the filenames change between sync runs.
521
+
>Frontmatter update works best with file tracking enabled to ensure consistent file and duplicates handling, even if the filenames change between sync runs.
518
522
>
519
523
>If file tracking is disabled, the plugin will overwrite whenever a file with the same name exists already, but will update its frontmatter. In very rare circumstances, this might lead to a case where duplicates in your Readwise library will be overwritten by each other in subsequent sync runs.[^3]
520
524
@@ -590,15 +594,15 @@ If you plan to upgrade the plugin from v1.x.x to v2.x.x, and want to make sure a
590
594
591
595
4. Upgrade the plugin to `2.x.x` and enable file tracking (this will ensure the tracking property will always be added to newly created or updated notes).
592
596
5. Rebuild the frontmatter templates and adjust the filename settings to your liking (you can also reset the templates to their default: simply delete the whole template value).
593
-
6. Run **a full sync** to rebuild all the notes according to the new settings and enjoy the new features of Readwise mirror 2.x.x.
597
+
6. Run **a full sync** to rebuild all the notes according to the new settings and enjoy the new features of Readwise mirror 2.x.x.
594
598
595
599
Your subsequent syncs will then use the `uri` property to track unique files and ensure links to items in your Readwise library will be updated, even if the note filenames change with the new version of the plugin.
596
600
597
601
>[!TIP]
598
602
>If you are unsure what the plugin will do to your Obsidian Obsidian vault after the upgrade, we would recommend that you create a copy of the Obsidian vault and run a test upgrade according to the steps described above.
599
603
600
-
[^1]: You might want to ensure that properties like `author` are omitted from the template as these have a tendency to break frontmatter. Alternatively, you can run a plugin like "Linter" to check and fix all your Readwise notes before upgrading, or you simply remove all properties except `uri` from your template and rebuild it after a successful upgrade.
604
+
[^1]: You might want to ensure that properties like `author` are omitted from the template as these have a tendency to break frontmatter. Alternatively, you can run a plugin like "Linter" to check and fix all your Readwise notes before upgrading, or you simply remove all properties except `uri` from your template and rebuild it after a successful upgrade.
601
605
[^2]: There are different cases where this can happen. For example, you can manually change Metadata of Reader and Readwise items. Without tracking, this would create a new file during the next sync. With tracking, we can rename the file based on the new metadata, and also based on whatever you chose as custom filename template.
602
-
[^3]: Readwise has a quite elaborate deduplication strategy itself where a number of factors outside of our control define if a new item is created for a highlight or if it ends up being appended to an existing item. It is therefore entirely possible, although usually unlikely, that a Readwise library contains different items of the same type with the same title.
606
+
[^3]: Readwise has a quite elaborate deduplication strategy itself where a number of factors outside of our control define if a new item is created for a highlight or if it ends up being appended to an existing item. It is therefore entirely possible, although usually unlikely, that a Readwise library contains different items of the same type with the same title.
603
607
[^4]: The use of `highlights_url` is a deliberate choice over the `id` value alone, both because, as an URL, it contains a namespace (allowing differention from other ID values) and because it allows the user to jump directly to the Readwise item in question.
604
-
[^5]: If at all possible, it is always better to change mistakes at the source, that is in Readwise itself. If, for example, Readwise has not correctly parsed an author's name, you might want to change this in the metadata in Readwise instead of manually updating (and protecting) the `author` property in Readwise. Nevertheless, there might be use cases where a *sync once, protect afterwards* approach might be useful.
608
+
[^5]: If at all possible, it is always better to change mistakes at the source, that is in Readwise itself. If, for example, Readwise has not correctly parsed an author's name, you might want to change this in the metadata in Readwise instead of manually updating (and protecting) the `author` property in Readwise. Nevertheless, there might be use cases where a *sync once, protect afterwards* approach might be useful.
0 commit comments