Hypothes.is + Obsidian
A while back I came across RoamHacker’s work to dovetail Hypothes.is for use in Obsidian and finally managed to get it up and running with my Obsidian vault. I’ve previously outlined a method for pulling in my notes from Hypothes.is using RSS, however this doesn’t give one any formatting capabilities and it also doesn’t provide any of the Hypothes.is tags as RSS has no layer for taxonomies.
RoamHacker’s work, which leverages the Templater Plugin for Obsidian, fixes both of these problems. I suspect that I’ll keep my prior method in place to create the individual notes, but use this additional work to clean up my fleeting notes from Hypothes.is in my actual commonplace book. Since there’s no server involved, it’s harder to automate the entire process so that every time you create notes they’re automatically ported across either in real-time or in batches every few hours.
Formatting your notes
I did spend some time last night to modify some of RoamHacker’s code to re-format the annotations to better suit my current notes format and layout. I’m excerpting the most relevant part below, but the entire Gist can also be downloaded or further modified for easier copy/pasting into one’s own vault for the needed set up.
I’ve only modified the section of the original Gist at the bottom that follows the line:
/* TEMPLATE STARTS HERE */
The changes still keep all the relevant data fields, but reorder them and add a bit of formatting to fit the layout and the way I use my Obsidian notebook. I changed the formatting so that tags in Hypothes.is are turned into [[wikilinks]] rather than #hashtags as in the original. (The original also doesn’t do so well with multi-word tags, which I use quite a lot.)
Hopefully the small changes I’ve made and comparison with the original Gist will allow those who aren’t as code-savvy to better understand the template and potentially let them make changes to suit their own needs.
/* TEMPLATE STARTS HERE */ if (tp.file.content.length==0) { //likely a new document, insert front matter tR += `---\n`; tR += `fileType: HypothesisAnnotations\n`; tR += `creationDate: ${tp.date.now('YYYY-MM-DD')} \n`; tR += `annotationDate: ${articleAnnotations[0].created.substring(0,10)}\n`; tR += `uri: ${articleAnnotations[0].uri}\n`; tR += `---\n`; } tR += `# ${articleAnnotations[0].title}\n` tR += `URL: ${articleAnnotations[0].uri}\n\n` for( a of articleAnnotations) { let tags = ''; let user = ''; if(a.tags.length>0) tags = ' ' + (a.tags.map(t=> '[['+ t + ']]')).join(' '); if(insertUser) user = ' _(' + a.user.replace('acct:','').replace('@hypothes.is','') + ')_'; if(a.text) tR += `${a.text}\n—[[${user}]]\n\n`; tR += `## Source \n`; tR += `> ${a.highlight}[^1]\n\n`; tR += `[^1]: [${articleAnnotations[0].title}](${articleAnnotations[0].uri}) | [syndication link](tk) \n`; tR += `\n---\ntags: \nlinks: ${tags} \n- broader terms (BT): \n- narrower terms (NT): \n- related terms (RT): \n- used for (UF) or aliases: \nconnected ideas: \nMOC: \n\n---\n`; } %>
Downloading Obsidian now! OMG this looks so exciting!
@chrisaldrich been curious about both of those. If you had to recommend 1 to try first?? I’m increasingly stockpiling in Apple Notes, partly inspired by Ken Reitz, but interested in Obsidian efforts to link & make more actionable
Should take a look at it.
For now, a combination of Google Keep and Obsidian is morphing me into a new human being I didn’t know I could ever be :))
This Article was mentioned on maya.land
This is pretty slick and looks pretty in its published form. Great to see others are using clever set ups like this as posting interfaces.
I have a feeling that other TiddlyWiki users would love this sort of thing. While TW may not seem as au courant, it’s still got some awesome equivalent functionality and great UI which is what most of the users in the note taking space really care about.
I do still wish that there was a micropub set up for Hypothes.is to make this sort of thing easier for the non-technical users.
Syndicated copies:
I assume you’ve seen this, but for fellow newbie IndieWeb wanderers, the Obsidian Hypothes.is plugin works well too. It uses built-in (Nunjuck) templating rather than Templater.
@chrisaldrich …your script modification for hypothesis to obsidian is what we’re using in the class BTW. Thanks!