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

Change in hypothes annotation note does not re-sync #55

Open
tedblizzard100 opened this issue Jun 6, 2022 · 7 comments
Open

Change in hypothes annotation note does not re-sync #55

tedblizzard100 opened this issue Jun 6, 2022 · 7 comments

Comments

@tedblizzard100
Copy link

tedblizzard100 commented Jun 6, 2022

Is the data supposed to be a sync? I made a change to an annotation note and the data in Obsidian did NOT change despite manual resync. Is this by design? Thank you

@allworldg
Copy link

Is the data supposed to be a sync? I made a change to an annotation note and the data in Obsidian did NOT change despite manual resync. Is this by design? Thank you

Because the Hightlights template use

{% if is_new_article %}
xxxx
{% endif %}

you can delete some of them where you need to update .

@nhan000
Copy link

nhan000 commented Jul 1, 2022

could you please clarify on how new highlights can be synced to my vault (I'm a noob)? What's the template you use? and is it that I need to use different template depending on if I want to sync new articles or new highlights for old articles that was synced before?

@allworldg
Copy link

allworldg commented Jul 1, 2022

could you please clarify on how new highlights can be synced to my vault (I'm a noob)? What's the template you use? and is it that I need to use different template depending on if I want to sync new articles or new highlights for old articles that was synced before?

@nhan000 Here it is.The point is that I delete {% if is_new_article %}{% endif %} around {% for highlight in highlights -%}

{% 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 'Private' != highlight.group %} — Group: #{{highlight.group | replace(" ", "-")}}{% endif %}
{% if highlight.tags | length %}    - Tags: {% for tag in highlight.tags %} #{{tag | replace(" ", "-")+" "}}{% endfor %}
{% endif -%}
{% if highlight.annotation %}    - Annotation: {{highlight.annotation}}{% endif %}
{% endfor %}

@paskie1234
Copy link

Thanks @allworldg this worked for me, it now syncs when I slash command sync deleted files(although I have to select the file and everyone is called "object Promise"?) . The other issue I now have is that it duplicates the highlights already there. Do you know a way around this?

@allworldg
Copy link

@paskie1234 Sorry, I have no idea. Did you use the template I provided ? Or maybe you can try to turn on this option.
image

@andromedarabbit
Copy link

image

This might be helpful for investigating "object Promise" error case.

@MIKarstens
Copy link

MIKarstens commented Apr 12, 2023

Hi I'd love to get your plugin running (such a life saver!). I cannot get later additional/ deleted annotations via hypothesis to sync after obsidian has created the initial file. I tried the above proposed solution, not sure if this was supposed to fix it.

I want my notes to get updated when I change my annotations, if a previous annotation gets deleted later, I would like it to not show up in the obsidian file (If I didn't manage to finish a paper in one sitting for example, I need to add more another time).

After example above, I am left with the following code:

{% 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 %}
## Page Notes
{% for highlight in page_notes -%}
{{highlight.annotation}}
{%- if highlight.tags | length %}
Tags: {% for tag in highlight.tags -%} #{{tag | replace(" ", "-")+" "}}{%- endfor %}
{% endif %}
{% endfor %}
{%- endif -%}

## Highlights
{% for highlight in highlights -%}
- {{highlight.text}} — [Updated on {{highlight.updated}}]({{highlight.incontext}})
{%- if 'Private' != highlight.group %} — Group: #{{highlight.group | replace(" ", "-")}}{% endif %}
{% if highlight.tags | length %} - Tags: {% for tag in highlight.tags %} #{{tag | replace(" ", "-")+" "}}{% endfor %} {% endif -%}
{% if highlight.annotation %} - Annotation: {{highlight.annotation}}{% endif %}
`{% endfor %}

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

6 participants