Skip to content

Commit cc3cee6

Browse files
committed
refactor: 💬 update settings text and documentation for consistency
1 parent d73b97a commit cc3cee6

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

CHANGELOG.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,50 @@
11
# Changelog
22

3-
## 2.x.x
3+
## 2.0.0
44

55
Version 2.x.x is a major rewrite of the plugin, with a focus on implementing a deduplication logic, more atomic upgrades (keeping existing additional or protected frontmatter intact) and handling of special characters in filenames.
66

77
> [!WARNING]
8-
> Readwise Mirror 2.0 is a major rewrite of the plugin which might break things due to changes how filenames are generated and validated. If you update without following the steps in the documentation, you might break links to items in your Readwise library.
9-
> Below is step-by-step guide how you can prepare an existing Readwise library by adding the `uri` tracking property to your items before upgrading to ensure links to items in your Readwise library will be updated after an upgrade.
8+
>If you update to 2.0.0 without following these steps, you will likely end up with duplicate notes for the same Readwise item or, if you delete the whole Readwise folder in your Obsidian vault first, will likely lose any existing internal links to notes created by the plugin.
9+
>
10+
>If you plan to upgrade the plugin from v1.x.x to v2.0.0, and want to make sure any internal links in your Obsidian vault to notes created by the plugin remain intact, then you should ensure all your notes have the file tracking property in their frontmatter before the upgrade.
1011
11-
1. Make sure you have a backup of your vault (or at least your Readwise Mirror folder)
12-
2. In the plugin settings, add the `uri` tracking property to the Frontmatter template. Just add the following at the end of the template and enable Frontmatter[^1]:
12+
Below is a step-by-step guide how you can prepare an existing Readwise library by adding the `uri` tracking property to your items before upgrading to ensure links to items in your Readwise library will be updated after an upgrade.
13+
14+
1. Make sure you have a backup of your Obsidian vault (or at least your Readwise mirror folder with the notes created by this plugin).
15+
2. In the plugin settings in v1.x.x, add the `uri` tracking property (or whatever property key you plan to use for file tracking) to the Frontmatter template. You can replace (recommended) the frontmatter template with the following, and enable Frontmatter[^1]:
1316

1417
```yaml
18+
---
1519
uri: {{ highlights_url }}
20+
---
1621
```
1722

18-
3. Run **a full sync** to establish proper tracking properties (this will overwrite your local changes, but will preserve the filenames of your existing files according to the way version 1.4.11 of the plugin creates them)
23+
3. Run **a full sync** to establish proper tracking properties (this will overwrite your local changes based on the current settings for the colon, but it will preserve the filenames of your existing files according to the way v1.4.11 of the plugin creates these. In consequence, all internal links will remain valid).
24+
25+
4. Upgrade the plugin to `2.0.0` and enable file tracking (this will ensure the tracking property will always be added to newly created or updated notes).
26+
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).
27+
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.
1928

20-
4. Upgrade the plugin to 2.x.x and enable File Tracking
29+
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.
2130

22-
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 generated filenames change with the new version of the plugin.
31+
>[!TIP]
32+
>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.
2333
2434
### Major Changes
2535

2636
- Switched to using Readwise's "export" API, providing access to document summaries and additional metadata (implements #39)
2737
- Completely rewrote the deduplication logic to handle edge cases like special characters and items with identical titles
28-
- Implemented consistent use of `normalizedPath()` throughout for better filename handling
29-
- Added robust frontmatter validation and preservation during updates
30-
- Introduced file tracking using unique Readwise URLs for reliable deduplication
38+
- Implemented consistent use of `normalizedPath()` throughout for better filename generation and handling (BREAKING CHANGE)
39+
- Added robust frontmatter creation, validation and preservation during note creation and updates, resulting in more reliable generation of valid frontmatter (precondition for using frontmatter as reliable basis for file tracking)
40+
- Introduced file tracking using unique Readwise URLs for reliable deduplication and internal linking in Obsidian
3141
- Implemented `/api_auth` endpoint for token retrieval, you can now retrieve your token from the plugin settings page
42+
- Implemented filters for use with Readwise notes
3243

3344
### New Features
3445

3546
- Added Q&A parsing with new `is_qa` and `qa` nunjucks filters for `.qa` action tags in Readwise
36-
- Improved title, author, and frontmatter template handling
47+
- Improved title, author, and frontmatter template handling to persistently create valid frontmatter
3748
- Added slugify option for filenames (implements #27)
3849
- Implemented `filenamify` for valid filenames with 255 character limit (implements #37)
3950
- Enhanced documentation and settings UI with template explanations
@@ -44,14 +55,12 @@ Your subsequent syncs will then use the `uri` property to track unique files and
4455
### Developer Updates
4556

4657
- Implemented semantic-release workflow using `brianrodri/semantic-release-obsidian-plugin`
47-
- Added local deploy and release actions
48-
- Restructured codebase for better modularity
58+
- Added local deploy and release actions (`npm run deploy:local`))
59+
- Restructured codebase
4960
- Added GitHub workflow for automated releases
50-
- Moved semantic-release config to separate `.releaserc.yaml`
51-
- Improved code organization and modularity
5261
- Separated settings from main class
5362

54-
BREAKING: This is a major rewrite that changes how filenames are generated and validated. Please consult the documentation for migrating existing libraries, particularly regarding the new URL-based tracking system.
63+
BREAKING CHANGE: This is a major rewrite that changes how filenames are generated and validated. Please consult the documentation for migrating existing libraries, particularly regarding the new URL-based tracking system.
5564

5665
## 1.4.11 (2023-10-28)
5766
- UI: Update "Open in Readwise" text to "View Highlight", to better align with official plugin expected behavior

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ Readwise can contain multiple items sharing the same title but with different ID
560560
## Upgrading from 1.x.x to 2.x.x
561561

562562
>[!WARNING]
563-
>If you update to 2.x.x without following these steps, you will likely end up with duplicate notes for the same Readwise item or, if you delete the whole Readwise folder in your Obsidian vault first, will likely lose any internal links to notes created by the plugin.
563+
>If you update to 2.x.x without following these steps, you will likely end up with duplicate notes for the same Readwise item or, if you delete the whole Readwise folder in your Obsidian vault first, will likely lose any existing internal links to notes created by the plugin.
564564
565565
If you plan to upgrade the plugin from v1.x.x to v2.x.x, and want to make sure any internal links in your Obsidian vault to notes created by the plugin remain intact, then you should ensure all your notes have the file tracking property in their frontmatter before the upgrade.
566566

src/ui/settings-tab.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
741741
.setClass('indent')
742742
.setName('Tracking property')
743743
.setDesc(
744-
'Frontmatter property to store the unique Readwise URL (default: uri). This field will be automatically managed in the frontmatter.'
744+
'Frontmatter property used to track the unique Readwise URL across syncs (default: uri). This field will be automatically managed in the frontmatter.'
745745
)
746746
.addText((text) =>
747747
text.setValue(this.plugin.settings.trackingProperty).onChange(async (value) => {
@@ -756,7 +756,7 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
756756
.setDesc(
757757
createFragment((fragment) => {
758758
fragment.appendText(
759-
'When enabled, duplicate files will be removed. Otherwise, they will be marked with duplicate: true in frontmatter.'
759+
'When enabled, duplicate files with the same Readwise URL in the tracking property will be removed. Otherwise, they will be marked with duplicate: true in frontmatter.'
760760
);
761761
fragment.createEl('br');
762762
fragment.createEl('blockquote', {
@@ -873,7 +873,7 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
873873
.setName('Frontmatter settings')
874874
.setDesc(
875875
createFragment((fragment) => {
876-
fragment.appendText('Controls the YAML metadata at the top of each note.');
876+
fragment.appendText('Controls the YAML metadata at the top of each note');
877877
})
878878
)
879879
.setHeading();
@@ -908,8 +908,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
908908
createFragment((fragment) => {
909909
fragment.appendText('Update frontmatter when syncing existing files');
910910
fragment.createEl('br');
911+
fragment.createEl('br');
911912
fragment.appendText(
912-
'When enabled, frontmatter of existing files will be updated, keeping additional fields that are not present in the template. Works best with Deduplication enabled.'
913+
'When enabled, frontmatter of existing files will be updated, keeping additional fields that are not present in the template. Works best with file tracking enabled.'
913914
);
914915
})
915916
)
@@ -1047,10 +1048,10 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
10471048
['tags_nohash', 'Tags without # prefix (compatible with frontmatter)'],
10481049
['highlight_tags', 'Tags from highlights with # prefix'],
10491050
['hl_tags_nohash', 'Tags from highlights without # prefix (compatible with frontmatter)'],
1050-
['highlights_url', 'Readwise URL (auto-injected if deduplication enabled)'],
1051+
['highlights_url', 'Readwise URL (auto-injected if file tracking enabled)'],
10511052
[
10521053
'Note:',
1053-
'If deduplication is enabled, the specified property will be automatically added or updated in the frontmatter template.',
1054+
'If file tracking is enabled, the specified tracking property will be automatically added or updated in the frontmatter template, independent of the frontmatter settings.',
10541055
],
10551056
])
10561057
);
@@ -1186,6 +1187,7 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
11861187
])
11871188
)
11881189
.addTextArea((text) => {
1190+
// TODO: Add header template validation resp. preview
11891191
const initialRows = 15;
11901192
text.inputEl.addClass('settings-template-input');
11911193
text.inputEl.rows = initialRows;
@@ -1238,6 +1240,7 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
12381240
])
12391241
)
12401242
.addTextArea((text) => {
1243+
// TODO: Add settings template validation resp. preview
12411244
const initialRows = 12;
12421245
text.inputEl.addClass('settings-template-input');
12431246
text.inputEl.rows = initialRows;

0 commit comments

Comments
 (0)