Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Open Data Handbook
Python JavaScript
Pull request Compare This branch is 70 commits behind okfn:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.tx
bin
source
translation
.gitignore
.gitmodules
Makefile
README.rst
bootstrap-dropdown.js
index.html

README.rst

Open Data Handbook

Introduction

Welcome to the source text of the Open Data Handbook. The handbook is a project of the Open Knowledge Foundation. If you are reading this it is likely you are looking to contribute in some way, whether that's translation, feedback, editing or adding more content. If you just want to read the handbook, then please head over to the http://opendatahandbook.org/.

Contributing

We have several ways you can help. The project is split into a few roles. Our authors write content, editors merge those submissions into the handbook, designers help beautify it and translators bring the handbook to all countries of the world.

Our wiki is a great place to get started. It contains a large number of tasks for people with half an hour as well as larger tasks.

Resources

Home Page:http://wiki.okfn.org/Projects/Open_Data_Handbook
Mailing List:http://lists.okfn.org/mailman/listinfo/open-data-manual
Source:https://github.org/okfn/opendatahandbook
Translations:https://www.transifex.net/projects/p/opendatahandbook/

About our tools

The handbook is written the ReStructured Text format. ReStructured Text allows us to write files in plain text files, which can be nicely rendered as a website or a PDF using Sphinx.

Project Layout

Outline:

opendatahandbook/
  source/
  bin/
  build/
  translation/

Details:

opendatahandbook is the base directory.

source is where we keep the plain text source files.

bin is short for binaries, or executable commands. This folder holds handy scripts.

build is where rendered, or "built", HTML files live.

translation is where our i18n files are kept

Rendering the handbook

  1. Move into the base directory of the project:

    cd opendatahandbook
    
  1. Install Sphinx, with a minimum version of 0.6. Instructions for Debian and Ubuntu:

    apt-get install python-sphinx
    
  2. Render the HTML, using make:

    make html
    

Building for Translation (i18n)

Important. You will need to install Sphinx >= v1.1 for this to work.

Generating pot files

  1. Extract translateable sentences/paragraphs:

    make gettext
    
  2. Add or update the translated/all.pot file as a resource on https://www.transifex.net/projects/p/opendatahandbook/.

Adding a new language

We use transifex for this.

  1. Go to https://www.transifex.net/projects/p/opendatahandbook/
  2. Add translation for specified language (and a team)

Building a translation of the handbook

  1. Download the translated all.pot file and copy it to (where lang is a 2-digit ISO code):

    translation/{lang}/LC_MESSAGES/all.po
    
  2. Build the mo file:

    make msgfmt lang={lang}
    
  3. Symlink from all.mo (sphinx expects us to have kept with original file names generated by gettext rather than concatenating):

    make linkpot lang={lang}
    
  4. Build the translation:

    make html lang={lang}
    

Updating the Translation with New Source Text

Simple version: just upload a new all.pot to transifex.

WARNING: this will immediately update all translation files and will usually discard any translations of strings that have changed however the trivial the change is.

Deploying the Handbook

We use github pages to host the handbook at the present (in the past we have used s3 and readthedocs).

As such the exact version of the html we want served should be in the gh-pages branch of this repo.

The following as walkthrough of a deployment:

# change gh-pages branch and get all latest changes to material
git checkout gh-pages
git merge master

# build the relevant languages (if not already built)
make html lang={your-lang}
# copies build version to /{lang}/ so it is right location for website
# also does some tidying up (delete files that are not needed)
make github lang={your-lang}

## now you will want to commit changes
# take a look at what has changed
git status
# add relevant files
# e.g. add *all* changes for the lang you updated git add -u {lang}
git add {relevant-files}
git commit -m "[build][s]: build latest version of language ..."

# push changes up
# this will auto-update http://opendatahandbook.org/
# up until this moment nothing will have changed on the website
git push
Something went wrong with that request. Please try again.
https://github.com/johnjohndoe/opendatahandbook
github.com
crawl=CC-MAIN-2015-48
49821
application/http; msgtype=response
sha1:DL6HCGNJOXIDBZ3Y6L2LEDS7UYDUMEDM
<urn:uuid:eb42819b-c2f9-49bc-9f11-4ad58fc99cab>
2015-11-25T10:34:27Z
192.30.252.130
sha1:UVWKUI7SSSOLVJBHQJKVWXPB367YHUWU
<urn:uuid:0ac45ccc-29e5-46ab-ba0f-2452d70fffe3>
https://github.com/johnjohndoe/opendatahandbook
length
response
<urn:uuid:735594ef-0e67-41fc-901b-aa9c3fc0c3f2>
robots: classic
hostname: ip-10-71-132-137.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2015-48
operator: CommonCrawl Admin
description: Wide crawl of the web for Nov 2015
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf