the Hypothes.is quote bubble icon next to the purple obsidian gem-like icon

Hypothes.is + Obsidian = Hypothesidian for easier note taking and formatting

Anyone who knows me knows that I love Hypothes.is for all my online highlighting, annotating, and general note taking. They also know that if one isn’t actively using their notes to some better end, then it’s likely not worth having taken them at all, so I store mine in markdown in Obsidian for future-proofing and portability.

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

Published by

Chris Aldrich

I'm a biomedical and electrical engineer with interests in information theory, complexity, evolution, genetics, signal processing, IndieWeb, theoretical mathematics, and big history. I'm also a talent manager-producer-publisher in the entertainment industry with expertise in representation, distribution, finance, production, content delivery, and new media.

27 thoughts on “Hypothes.is + Obsidian = Hypothesidian for easier note taking and formatting”

  1. I have a cron script checking for my annotations (using the API) that creates .md files (and the accompanying .md.meta files) for my tiddlywiki. But I’m extra lazy so I also automated some frontmatter to make it quick to shove (using other cron scripts that look for TW tags) into my site, which uses Jekyll, to make posts like this one.

    Do you think any of that might be worth sharing? TW isn’t as au courant as Obsidian, so I don’t know if anyone else would end up using it.

    Sample output:

    ---
    title: "annotation of tesla patent reveals elon musk's 'table salt' lithium extraction process that could slash costs"
    layout: post
    category: responses
    tags: annotation
    replyto: "https://electrek.co/2021/07/09/tesla-patent-reveals-elon-musk-table-salt-lithium-extraction-process/"
    date: "2021-07-16T18:03:39.104738+00:00"
    hypothesislink: "https://hyp.is/JexCuOZgEeuUhP-n4wNMNA/electrek.co/2021/07/09/tesla-patent-reveals-elon-musk-table-salt-lithium-extraction-process/"
    ---
    
    
    
    > ...he way it has always been done. <em>We found that we can actually use table salt, sodium chloride, to basically extract the lithium from the ore. Nobody has done this before to the best of my knowledge.
    > He didn’t go into more details about the process, which raised quite a few eyebrows in the lithium industry.
    But now we have obtained a new patent application for Tesla’s new lithium extraction process, which comes with a lot more details about this mysterious “table salt” method.</em>
    In the patent application calle...
    
    Look, I hate Musk and Tesla about as much as anybody, but if new tech can reduce externalities even *on pace* with the rise in scale's increasing them, I'm glad to hear about it. 
    
    1. 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:

Reposts

  • Eleanor Konik
  • RoamHacker - exploring PKM and its future

Leave a Reply

Your email address will not be published. Required fields are marked *