Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of highlights and annotations #19

Closed
bpriyum opened this issue Nov 19, 2021 · 9 comments
Closed

Duplication of highlights and annotations #19

bpriyum opened this issue Nov 19, 2021 · 9 comments

Comments

@bpriyum
Copy link

bpriyum commented Nov 19, 2021

Hi,

First of all I would like to thank you for making this plugin. This has made live a lot easier for me. However, there are a few things I would like to bring to your attention.

  1. The highlights are being imported in duplicates.
  2. I don't know if this by design. An annotation is followed by the highlighted passage rather than the highlighted passage being followed by the annotation as in hypothes.is.
  3. All highlights are not being imported. My highlights from the last 7 days has not be imported.

Thanks again for your effort. Even with the above issues this plugin is a great help.

Cheers

Priyam

@weichenw
Copy link
Owner

Hi Priyam,

  1. The highlights are being imported in duplicates. -> I just tried and it seems to work fine. How is it duplicating?

  2. I don't know if this by design. An annotation is followed by the highlighted passage rather than the highlighted passage being followed by the annotation as in hypothes.is. -> Check out the nunjucks template if you want to change the way the highlights/annotations are created. Having said that, in Hypothesis annotations are stored under highlights.

  3. All highlights are not being imported. My highlights from the last 7 days has not be imported. -> Seems to work for me. Cna you check if you are getting error in the developer console?

Cheers

@bpriyum
Copy link
Author

bpriyum commented Nov 20, 2021 via email

@weichenw
Copy link
Owner

weichenw commented Nov 21, 2021

I can only suggest that you delete all the generated files and reset the sync. Copy the nunjucks template below. Then sync everything again.

Please make sure you got the latest version as well.

Below is the default nunjucks template that I am using personally. You can copy and paste it into your configuration.

{% if is_new_article %}# {{title}}

## Metadata
{% if author %}- Author: [{{author}}]({{authorUrl}}){% endif %}
- Title: {{title}}
{% if url %}- Reference: {{url}}{% endif %}
- Category: #article{% endif %}

{% if is_new_article -%}## Highlights{%- endif %}
{% for highlight in highlights -%}- {{highlight.text}} — [Updated on {{highlight.updated}}]({{highlight.incontext}})
{% if highlight.tags | length %}   - Tags: {% for tag in highlight.tags -%}#{{tag| replace(" ", "-")}} {%- endfor %}{%- endif %}
{% if highlight.annotation %}   - Annotation: {{highlight.annotation}}{%- endif -%}{%- endfor -%}

@mschrader15
Copy link
Contributor

mschrader15 commented Nov 30, 2021

Hi @weichenw , Thanks so much for making this plugin!

Unfortunately, I am seeing the same behavior that @bpriyum described. I tried deleting and syncing multiple times, as well as manipulating the template.

I use groups in Hypothesis, maybe that is leading to duplication somehow?

@weichenw
Copy link
Owner

Hi, there is a possibility that an error occurs before all the sync finishes. Could you please check if there are errors in the console?

https://forum.obsidian.md/t/how-to-access-the-console/16703

I just tried groups. It seems to work fine.

@weichenw weichenw reopened this Nov 30, 2021
@mschrader15
Copy link
Contributor

mschrader15 commented Dec 1, 2021

No errors in the console. To be clear, I am seeing both the duplication error and the not-pulling-recent error.

I wonder if it is on Hypothesis side...

@weichenw
Copy link
Owner

weichenw commented Dec 1, 2021

No errors in the console. To be clear, I am seeing both the duplication error and the not-pulling-recent error.

I wonder if it is on Hypothesis side...

Unfortunately, I am unable to replicate this issue. I have tried several times it works for me.

Just to confirm that you are on the latest version, reset the history and delete all the files before resyncing everything again.

mschrader15 added a commit to mschrader15/obsidian-hypothesis-plugin that referenced this issue Dec 1, 2021
This fixes the duplication and missing recent annotations seen in weichenw#19
weichenw added a commit that referenced this issue Dec 2, 2021
@weichenw
Copy link
Owner

weichenw commented Dec 2, 2021

@mschrader15 Thanks, mate. I have merged and bumped the version

@mschrader15
Copy link
Contributor

@weichenw no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants