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

Preliminary fix for the issue that highlighted notes on web pages can only be synchronized once

Open BlueDementedTomCat opened this issue 2 years ago • 2 comments

Obsidian plugin settings Highlight template

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

{%- if is_new_article -%}
## 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 %}
{%- else -%}
{%- 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 %}{% endif %}

BlueDementedTomCat avatar Nov 18 '24 22:11 BlueDementedTomCat

However, it still can't solve the synchronization problem of highlighting note deletion and modification

BlueDementedTomCat avatar Nov 18 '24 22:11 BlueDementedTomCat

Optimized note layout and removed Page Note.

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

{% for highlight in highlights -%}
>[!note] Web : [Updated on {{highlight.updated}}]({{highlight.incontext}})
{%- if 'Private' != highlight.group %} #{{highlight.group | replace(" ", "-")}}{% endif %}
>> {{highlight.text}}
> 
{% if highlight.annotation %}> Annotation: {{highlight.annotation}}{% endif %}

{% endfor %}
{%- else -%}
{%- for highlight in highlights -%}
>[!note] Web : [Updated on {{highlight.updated}}]({{highlight.incontext}})
{%- if 'Private' != highlight.group %} #{{highlight.group | replace(" ", "-")}}{% endif %}
>> {{highlight.text}}
> 
{% if highlight.annotation %}> Annotation: {{highlight.annotation}}{% endif %}
{% endfor %}
{% endif %}

Clip_2024-11-19_08-13-01

BlueDementedTomCat avatar Nov 19 '24 00:11 BlueDementedTomCat