jsonMartin / readwise-mirror

MIT License
52 stars 11 forks source link

Bug? Highlight Template does not export tags by default #28

Closed tdnzr closed 11 months ago

tdnzr commented 1 year ago

Thanks for making an amazing plugin! I really wished for an ability to sync-export updated highlights, and this plugin does that whereas the official one does not.

Problem: If you define a highlight-specific tag (not a document tag) in Readwise, then Readwise Mirror's default Highlight Template does not export them.

Suggested solution: Adjust the default Highlight Template (including in the documentation here, plus in the suggested Blockquote filter) by appending a block similar to the "if note" block, i.e. as follows:

Current Highlight Template syntax

{{ text }}{%- if category == 'books' %} ([{{ location }}]({{ location_url }})){%- endif %}{%- if color %} %% Color: {{ color }} %%{%- endif %} ^{{id}}{%- if note %}

Note: {{ note }}
{%- endif %}

---

Suggested Highlight Template syntax

{{ text }}{%- if category == 'books' %} ([{{ location }}]({{ location_url }})){%- endif %}{%- if color %} %% Color: {{ color }} %%{%- endif %} ^{{id}}{%- if note %}

Note: {{ note }}
{%- endif %}{%- if tags %}

Tags: {{ tags }}
{%- endif %}

---
jsonMartin commented 12 months ago

Hi @tdnzr , thank you for the suggestion. I think that is a good idea to show the tags by default.

Since you already know the correct places to make the changes, would you feel comfortable making a PR for this? I'd be happy to merge it in

tdnzr commented 11 months ago

Hi @jsonMartin, I'm sufficiently unfamiliar with Github that I don't even know how to make a pull request which includes more than one file. So I've submitted two separate pull requests for the plugin and the readme. Hopefully they still make sense.

jsonMartin commented 11 months ago

Hi @tdnzr, thank you for your submitted PRs; no problem on creating separate pull requests, I'm glad you were able to figure it out, it's a good learning exercise. For larger pull requests, it's much more productive to use the Github CLI (though the learning curve is higher), but for small updates like this one Github's site is sufficient.

I just got back from out of town and had a chance to start reviewing the PRs. Congratulations, your tag changes have been accepted and will be incorporated into the next release of the software! Thank you for your contribution.