weichenw / obsidian-hypothesis-plugin Goto Github PK
View Code? Open in Web Editor NEWAn Obsidian.md plugin that syncs highlights from Hypothesis.
License: MIT License
An Obsidian.md plugin that syncs highlights from Hypothesis.
License: MIT License
As it is, the list is not structured, and not sorted. Would be nice to at least sort it. Better yet, allow incremental search and a hierarchical display of folders. BTW, great plugin!
I have two requirements, and I didn't find how to implement them when I read the documentation.
My usage in Obsidian looks like this:
I need to set the title of the article to (take the SimpRead application as an example):
Extract-SR{{Id}}-{{Title}}
This indicates:
I don't know if my idea is reasonable, but it is effective in my practice.
Currently, annotations added as follows would not be synced:
It would be great if annotations added after syncing the file can be updated into the existing file.
Love that you made this and it works great on desktop/computers. However on iOS version of Obsidian, it creates the folder but doesn't put anything in it so it's empty. Let me know how I can help debug this.
Thank you!
Ray
website: https://www.w3.org/publishing/epub32/epub-packages.html
I highlighted several sentences in this website, for example: The package element is the root element of the Package Document and defines various aspects of the EPUB Package
However, the synced highlight text becomes:
As you can see, there are strange whitespaces.
I have checked on my personal page to make sure that the highlight text on hypothes.is server does not have so many whitespaces.
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
It would be great that you can resync new notes on an article as you do on Omnivore Obsidian app for example.
I'm trying to create 2 metadata fields with the creation and update date that is compatible with dataview, but I can't.
Could you help me?
The integration works just fine, however, annotations and highlights are not detected
even tho I have 10 highlights and annotations in my Hypothesis.is
the plugin detects my groups no problem, but it just doesn't detect the content
It's worth mentioning I tried restarting Obsidian, tried reconnecting the API, but to no avail
Hi I don't know what's wrong with my setup but the plugin doesn't do anything.
I have clicked the hypothesis icon on the ribbon and run command to trigger manual sync but nothing happened.
I have close and restart Obsidian, tried the plugin on multiple vaults, and restart my PC, but nothing worked.
Please let me know where I have set things up wrong.
Edit: After posting this I got it to run somehow on 1 of the 3 vaults I tried. However, it still didn't do anything
I certainly have highlights in my hypothesis account, but no idea why it doesn't sync.
Is it possible to have the creation date as backlink [[YYYY-MM-DD]] in a template, so that my daily note would show it at linked mentions?
For instance, if a file name is File: A
, then the created note would be File
, i.e. everything after :
would be omitted. As a result, if there would be a new file called File: B
, then all highlights corresponding to File: B
would be synced into File
as well.
Therefore, it would be great if special symbols like :
would be handled properly. For instance, symbols like :
can be replaced by _
or spaces.
What I am referring is the same thing as the "sort top-level annotations by" setting in this prototype built by a member of the Hypothesis team when set to "document location".
Notes:
Your plugin works fine but I have noticed a problem:
At the end of the loop there is no instruction that creates a line break, so the highlights after the first are written on the same line corresponding to the last. That last line break instruction is required.
If you could add a variable whose function is the line break that would be great.
PD. At the moment I have partially solved it with double <br>
at some point in the template.
how do i add/sync page notes
It would be great if the multiple-line notes can be synced as sub list items, to better style multiple-line notes.
The note:
First line
Second line
The desired synced note: (This is also the Readwise Official plugin handles multiple-line notes.)
- [ ] First line
- Second line
The template:
{% if is_new_article %}# {{title}}
{% if is_new_article %}## Metadata{% endif %}
{% if is_new_article %}{% if author %}- Author:: [{{author}}]({{authorUrl}}){% endif %}
- Title:: {{title}}
- Category Hypothesis:: Article{% endif %}
{% if url %}- Source URL:: {{url}}{% endif %}{% endif %}
{% if is_new_article %}## Highlights{% endif %}
{% for highlight in highlights %}> {{highlight.text}} (View Highlight [{{highlight.location}}]({{highlight.incontext}})) ^hs{{highlight.id}}{% if highlight.tags | length %}
- Tag: {% for tag in highlight.tags %}#{{tag| replace(" ", "-")}} {% endfor %}{% endif %}{% if highlight.annotation %}
- [ ] {{highlight.annotation}}{% endif %}{% if highlight.created %}
- Highlighted on {{highlight.created}}{% endif %}{% if highlight.updated %}
- Updated on {{highlight.updated}}{% endif %}
{% endfor %}
This is a great plugin for obsidian, but this limit is realy unbearable.
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.
Thanks for creating this plugin! It synced my hypothesis highlights correctly. (Edit: I found out later that it's not syncing all my page highlights: some but not all highlights belonging to a self-owned private group got lost. This got solved by #58 (comment) )
However, it also for some reason synced 1 public annotations and 1 page notes from other users:
https://stackoverflow.com/questions/57369700/how-do-i-add-permissions-to-activestorage
https://arxiv.org/pdf/1409.3478.pdf
Could this phenomenon be avoided if I save my hypothesis highlights in a group other than the Public group?
For example, 3 minutes sync one time.
The {{created}} and {{updated}} fields never appear to be filled. Do they depend on information from the article or is the time of the import used? If the former, is it possible that none of the articles I have been highlighting have this information? If that is so, then this is not a bug, but it would be nice to fill these in with the current timestamp if not provided by the article. Cheers.
My notes usually have created
and updated
fields in the frontmatter as part of the core Templates (which are then kept up to date by obsidian-linter).
It would be nice if the template setting actually included the current frontmatter that's injected by this plugin, so that I can add my own fields (also want to add tags:
).
It would be even nicer too if the updated date could be filled in to be the most recent date of all the highlights/annotations that are synced. As for the created date, maybe it could be set to the oldest date.
I got the following error messages when trying to sync the highlights into Obsidian:
Uncaught (in promise) TypeError: Cannot read property '2' of undefined
at eval (eval at <anonymous> (app.js:1), <anonymous>:2:128829)
at Array.reduce (<anonymous>)
at eval (eval at <anonymous> (app.js:1), <anonymous>:2:128552)
at et.startSync (eval at <anonymous> (app.js:1), <anonymous>:2:128958)
at async at.startSync (eval at <anonymous> (app.js:1), <anonymous>:2:131252)
Re-starting Obsidian did not resolve the issue either.
Thanks a lot for this great plugin! 👏
Would it be possible, though, to provide an option in the settings to customise how file names of imports are generated? As far as I can tell, this currently is essentially the {{title}} variable cleansed of forbidden characters. However, if one has several workflows for generating source notes in place, it may be valuable to facilitate sticking to a joint naming convention. Ideally, Nunjucks could be used in the specified naming pattern?
For reference, this is what such an option looks like in the settings of the Zotero Desktop Connector plugin:
Hi, This is not an issue
Firstly, thank you so much for this plugin - it's a huge help to myself and my students.
When collaborating in hypothesis you can create different groups, say for a research dissertation and another for, perhaps crisis management - I was wondering if it is possible to have those groups sync to specific folders or different vaults in obsidian.
for e.g. my critical research students collaborate on a group but use different vaults for other modules and hypothesis groups.
Hope this makes sense!
Thanks again
C
Thanks for the wonderful plugin!
I noticed that the plugin only imports my own annotations. I was wondering whether there is a way to capture annotations contributed by other members of a group.
Thank you!
It would be amazing to be able to sync the highlights from a local PDF. I know you wrote "Have not tested to sync annotations on PDFs." so I tested it. The highlights show in hypothes.is webpage but they are not syncing to Obsidian vault. Do you think there is a way to fix this?
Currently, I have the created date in the format like 2021-10-20T00:00:00.000000+00:00
. Is it possible to customize it into something like 2021-10-20T00:00:00
?
I tried to look for this in the Nunjucks template, but did not figure out how to do this.
Hello,
This plugin is no longer syncing my Hypothes.is account, quite randomly. Things I have tried:
I am using the latest version of the app on Obsidian v.0.12.19.
Any help would be fantastic!
Thanks.
I deleted an article & then restored it. It didn't sync any highlights from the article now.
Why is that?
Like title. Can i do that? Thank you.
I just installed the plugin, but unfortunately the synchronization doesn't work on my latest AppImage on Ubuntu.
I think this either happens because of this fact or because of the fact that all annotations I made are for a local pdf file?
But furthermore, I've now created an annotation on a public website, still, it didn't sync on start-up although that box was checked.
Also, the reset button does not solve this. It still says it never synced.
In case it only syncs if the user does something proactively using the templater tool you mentioned later on in your ReadMe, can you please state this anywhere if that's the case?
Otherwise, you have to reset the history, delete all the synced files. Then when you sync again, it will recreate everything again.
Is it possible to only re-sync a specific file, instead of deleting all synced files first and syncing all files again?
The sync mechanism reminds me of two Readwise-related plugins:
The first one mainly works as follows:
The second one just mirrors/downloads all old and new highlights to Obsidian.
Originally posted by @wenlzhang in #1 (comment)
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.
Thanks again for your effort. Even with the above issues this plugin is a great help.
Cheers
Priyam
A note's frontmatter's url will have some weird characters
---
doc_type: hypothesis-highlights
url: >-
https: //forum.obsidian.md/t/embedding-cloud-hosted-documents-and-working-collaboratively-in-teams/30641
---
It should be
---
doc_type: hypothesis-highlights
url: https://forum.obsidian.md/t/embedding-cloud-hosted-documents-and-working-collaboratively-in-teams/30641
---
https://help.raindrop.io/highlights
today raindrop add a new feature to highlight on the web like hypothesis,hope the highlights can asycn on obsidian too.thank you very much
It would be great if one can customize file names, e.g. with a timestamp File - 202111111200
.
The highlight.annotation
seems to be of the format {comment} - {quoted}
. Is is this a limitation of the hypothesis API not splitting these two parts up in the returned annotation.text
?
I was trying to regex around this in the templating, but it doesn't work when the quoted text includes a hyphen.
{% if highlight.annotation %} - Annotation:
{% set regExpQuote = r/(.+)(\-.+)$/g %}
{{ regExpQuote.exec(highlight.annotation)[0] }}
> {{ regExpQuote.exec(highlight.annotation)[1] }}{%- endif -%}
In my workflow, highlights order is very important as it gives context to other highlights - crucial for long articles.
As I am aware that preserving order and existing edits is technically challenging, it's more of a mirror workflow, like https://github.com/jsonMartin/readwise-mirror . I don't edit those mirrored files, just reference them by persistent highlight id at the end.
Hypothesis is one of the few platforms that allow for extracting this order through the API.
Readwise makes use of it in https://github.com/readwiseio/obsidian-readwise, but it has many issues of its own and is an unnecessary intermediary.
So, it would be great if you could implement following story:
When highlighting the README page of Hypothesis like the following, the highlighted part cannot be styled well.
Not sure if the indentation of list items can be kept the same way as the source, but it would be great if the quotation (in the following example) can be kept for the highlighted text.
The improved/desired annotations:
The template:
{% if is_new_article %}# {{title}}
{% if is_new_article %}## Metadata{% endif %}
{% if is_new_article %}{% if author %}- Author:: [{{author}}]({{authorUrl}}){% endif %}
- Title:: {{title}}
- Category Hypothesis:: Article{% endif %}
{% if url %}- Source URL:: {{url}}{% endif %}{% endif %}
{% if is_new_article %}## Highlights{% endif %}
{% for highlight in highlights %}> {{highlight.text}} (View Highlight [{{highlight.location}}]({{highlight.incontext}})) ^hs{{highlight.id}}{% if highlight.tags | length %}
- Tag: {% for tag in highlight.tags %}#{{tag| replace(" ", "-")}} {% endfor %}{% endif %}{% if highlight.annotation %}
- [ ] {{highlight.annotation}}{% endif %}{% if highlight.created %}
- Highlighted on {{highlight.created}}{% endif %}{% if highlight.updated %}
- Updated on {{highlight.updated}}{% endif %}
{% endfor %}
I get a sync error everytime I start up Obsidian if I have both plugins enabled.
The error is in the file obsidian-hypothesis-plugin\data.json.
It concerns the following line:
"lastSyncDate": "2022-04-08T04:20:14.319Z"
Could it be the case that the hypothesis plugin syncs just before de git plugin?
If so, it could maybe be solved if there was an option for the hypothesis plugin to start about 30s after startup of Obsidian.
As this plugin is inspired by Obsidian Kindle Plugin, I think it is good to post the idea here.
As of the new update of Obsidian Kindle Plugin, the plugin recognizes the files based on front matter data,instead of filenames, this gives extra advantages, for example: we can move files anywhere in the vault and also rename, still the plugin recognizes the file.
But in the hypothes.is plugin, we can't move or rename the files. If we do, the plugin thinks the item is deleted (Command: resync deleted files confirms that) and shows it on the deleted list. So, I think recognizing files based on metadata should be more convenient for most users.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.