Given a RIS file, generate a web site that displays the citations.
Python HTML PLpgSQL CSS Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
static
templates
translations/fr/LC_MESSAGES
LICENCE_DATA.md
LICENSE
README.adoc
author_uris.sql
babel.cfg
cawls.ris
config.ini
create_bibdb
messages.pot
ris2sql
ris2web
sitemap_maker

README.adoc

RIS2WEB: Publishing a bibliography on the web

This project represents an effort to use a Zotero group library as the basis of creating a bibliography suitable for publishing on the web. The citations themselves express linked data through the http://schema.org vocabulary. URIs for authors are added to the database after the Zotero library has been processed, as Zotero itself offers no linked data support.

To improve visibility of the citations in general search engines, we also generate a sitemap and robots.txt file that advertises the sitemap.

Although any RIS file could be used as a source for the bibliography, the ris2sql processor assumes some quirks of Zotero (such as Editor = 'A3' and Series Editor = 'A2').

Licences

The code is licensed under the GNU General Public License (GPL) 3.

The data is licensed under the Open Data Commons - Attribution (ODC-BY) license.

Installing prerequisites on Ubuntu 14.04

sudo apt-get install git postgresql python3 python3-flask python3-pip nginx
sudo pip install psycopg2 flask-babelex

Installing prerequisites on Fedora 25

First we get the web server and database server up and running:

sudo dnf install nginx postgresql-server
sudo postgresql-setup --initdb --unit postgresql
sudo systemctl start nginx
sudo systemctl start postgresql

The we install the Python dependencies, and use virtualenv to avoid polluting the system site packages:

sudo dnf install python3-flask python3-psycopg2 python3-virtualenv
virtualenv-3 --system-site-packages ~/ris2web-env
. ~/ris2web-env/bin/activate
pip install flask-babelex

Getting up and running

The following instructions should more or less enable you to get a clone of this instance up and running on the default Flask port:

sudo su -c 'createuser -s <username>' postgres
sudo su -c 'createdb bibliography' postgres
git clone https://github.com/dbs/ris2web.git
cd ris2web
./create_bibdb && ./sitemap_maker && ./ris2web
pybabel compile -d translations/

Once ris2web is running, you should be able to access the site on the same machine using a browser pointed at http://localhost:5000.

Translating

Pybabel is the utility used to pull out translateable text from templates/py files. Simply extract and update to put in new translations.

A note about committing translations

When adding new messages to messages.pot or new translations to messages.po, ALWAYS make sure to only partially stage the actual messages added. Pybabel updates a header with the date of the last message extract, so it will cause a merge conflict if it’s staged into the commit.

Credits