obsidian-hypothesis-plugin icon indicating copy to clipboard operation
obsidian-hypothesis-plugin copied to clipboard

Change in hypothes annotation note does not re-sync

Open tedblizzard100 opened this issue 2 years ago • 7 comments

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

tedblizzard100 avatar Jun 06 '22 21:06 tedblizzard100

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 .

allworldg avatar Jun 15 '22 08:06 allworldg

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 avatar Jul 01 '22 06:07 nhan000

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 %}

allworldg avatar Jul 01 '22 08:07 allworldg

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?

paskie1234 avatar Jul 03 '22 13:07 paskie1234

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

allworldg avatar Jul 03 '22 14:07 allworldg

image

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

andromedarabbit avatar Jan 04 '23 09:01 andromedarabbit

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 %}

MIKarstens avatar Apr 12 '23 15:04 MIKarstens