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

only sync with the first highlight in a webpage #58

Open
Ryangoabroad opened this issue Jul 10, 2022 · 3 comments
Open

only sync with the first highlight in a webpage #58

Ryangoabroad opened this issue Jul 10, 2022 · 3 comments

Comments

@Ryangoabroad
Copy link

Hi, I have multi-highlights & annotates in a webpage(https://sspai.com/post/72697).
but this plugin only synchronize the 1st highlight I made, and ignore others in the same webpage.

I check in the settings of this plugin,it shows all multi-highlights & annotations have been synchronized, but in obsidian there is only 1.

@chenyukang
Copy link
Contributor

chenyukang commented Jul 14, 2022

The default template has a bug,
please remove the checking around highlights and notes.

Make it to this:

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

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

@lanluo9
Copy link

lanluo9 commented Jul 15, 2022

@chenyukang This solution creates duplicates of the already existing notes and highlights. Is there a way to avoid this?

@chenyukang
Copy link
Contributor

@chenyukang This solution creates duplicates of the already existing notes and highlights. Is there a way to avoid this?

Actually I didn't meet this duplicated error, mostly because I open Obsidian almost all time and this plugin has an automatically sync option, when this option working it will fetch from remote in a increment way, so it won't create duplicated one。

But it's an issue that possibly happen when fetch from remote server not in incremental way。

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