Skip to content

Commit

Permalink
Express RIS format as an alternate link element
Browse files Browse the repository at this point in the history
In theory Zotero should be able to detect the link by
mime-type and offer to save the full citation accordingly...

Signed-off-by: Dan Scott <[email protected]>
  • Loading branch information
dbs committed May 1, 2019
1 parent d8105f0 commit 63202f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ris2web
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class RIS:
self.url = record[24]
self.volume = record[25]
self.access_date = record[26]
self.zotero_key = record[27]
self.init_authors(authors)
self.kw = kw
self.notes = notes
Expand Down Expand Up @@ -201,7 +202,8 @@ def citation_html(work_id):
pub_date, doi, pub_database, end_page, edition, issue_number, \
alternate_title, local_url, language, id_number, work_type, \
publisher, pub_year, isbn_issn, start_page, short_title, \
title2, title3, title, doc_type, url, volume, access_date \
title2, title3, title, doc_type, url, volume, access_date, \
zotero_key \
FROM citations \
WHERE id = %s", (work_id,))
record = works.fetchone()
Expand Down
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
{% block header %}{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" sizes="196x196" href="/favicon-196.png">
<link rel="apple-touch-icon-precomposed" href="/favicon-152.png">
Expand Down
1 change: 1 addition & 0 deletions templates/citation.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ _('Citation: ') }}{{ record.title|escape }}{% endblock %}
{% block header %}<link rel="alternate" type="application/x-research-info-systems" title="RIS citation" href="https://api.zotero.org/groups/290262/items/{{ record.zotero_key|escape }}?v=3&amp;format=ris">{% endblock %}
{%- macro author_block(author, heading, sprop) -%}
<tr>
<th>{{ heading }}</th>
Expand Down

0 comments on commit 63202f7

Please sign in to comment.