Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document annotator plugin #208

Merged
merged 15 commits into from May 17, 2013
Merged

document annotator plugin #208

merged 15 commits into from May 17, 2013

Conversation

edsu
Copy link
Contributor

@edsu edsu commented May 13, 2013

The document plugin extracts metadata from HTML pages (Dublin Core, Facebook OpenGraph Protocol, Google Scholar, link relations) to be sent along as part of the JSON payload for the annotation.

It is part of some work being done at Hypothesis to enable the annotation of documents independent of their format (e.g. html, pdf) and location (URL, DOI, etc). But, as a plugin, with unit tests, it is a discrete bit of functionality that I think can be considered for inclusion in Annotator.

Feedback welcome!


# hack to get a absolute url from a possibly relative one

_absoluteUrl: (url) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this honor the tag, if one is found?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Github is stripping what it thinks is HTML from my comment. I mean this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets a little bit tricky when needing to account for '../../' etc no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind. I didn't read carefully to see the trick you're using. At least in Chrome this trick is affected by the base tag anyway, so it's all handled.

@edsu
Copy link
Contributor Author

edsu commented May 16, 2013

How about we do another pull request for this deduping behavior, since it's not really part of the Document plugin?

@tilgovi
Copy link
Member

tilgovi commented May 16, 2013

+1

@edsu
Copy link
Contributor Author

edsu commented May 17, 2013

Ok, I took a stab at deduping/updating and sent a separate pull request: #209

@tilgovi
Copy link
Member

tilgovi commented May 17, 2013

@nickstenning, @aron thoughts?

@nickstenning
Copy link
Member

This looks great. Is it worth adding canonical URL data to this plugin (see #86) or do you reckon that would be a separate plugin? I guess I'd lean slightly towards the latter... (and certainly shouldn't be a blocker on a merge).

@edsu
Copy link
Contributor Author

edsu commented May 17, 2013

The plugin does extract rel="canonical" links but until the last commit it didn't look for rel="bookmark". Thanks!

tilgovi added a commit that referenced this pull request May 17, 2013
document annotator plugin
@tilgovi tilgovi merged commit 3636b46 into openannotation:master May 17, 2013
@tilgovi
Copy link
Member

tilgovi commented May 17, 2013

Great work, @edsu! Merged!

@nickstenning
Copy link
Member

Hey @AnnaGerber, look! We merge stuff. (Hint hint.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants