Extracting your Hypothesis Annotations as Structured Notes

I like Hypothes.is. I’ve used it to return feedback to students, and I’m trying to be more mindful about what I read online in that I should annotate the damned stuff and keep everything handy in one locale. Since you can get a stream of your annotations, one way I’ve tried to keep things together is to put the feed on my open notebook. It works, but it ain’t pretty. It’s not particularly useful either  in that part of the point of keeping an open notebook is that I can start crosslinking my notes as I write in atom.

So over on the hypothesis blog I read this account of extracting annotations as structured information. I forked the script, and adapted it to extract some of my annotations from Paul Reilly’s article on additive manufacturing & archaeology. If you’ve got the plugin installed, you’ll be able to see all of my annotations. You’ll notice that some of them have some odd-ish tags. My script looks for these tags: Title, Subject Keytheme, keylit, item (see lines 82 to 86). Each time I use those tags, I have to add a colon, thus Keytheme:1 Keytheme:2 etc. (nb if you don’t differentiate like this you’ll get an error about index length when you run the script). A little further down, the script makes a lovely little table in order to summarize your annotations. To use that part, you structure your annotation itself so that it contains the headers from the table (see line 105 to adapt this to your own needs). Your annotation will look like this:

Screen Shot 2016-05-05 at 12.53.39 PM

So: note the tag, item:1, and note how I’ve used the headers from the table to organize my thoughts in the annotation. Clearly, these are not useful thoughts on my part, but I’m only concerned with getting the script to work as I have received it. I’ll customize things in due course. Speaking of customization: change up line 43 to point to whatever thing on the web it is you’ve annotated. Finally, the script outputs an html file that’ll look like this:

Screen Shot 2016-05-05 at 12.38.54 PM

Now, given that I have an open notebook that I’m writing in markdown and then using jekyll to stitch together, I’ve changed the last line of the script to save as .md rather than .html, and then I just copy the generated html into one of my notecard templates, like so. The html mucks up some of my notebook styling, but what the hey. Getting there, eh?

 

Advertisements