Open Knesset Templates
Python JavaScript
Pull request Compare This branch is 1 commit ahead, 1 commit behind daonb:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Open Knesset Templates

This repository holds the code for Open Knesset templates, sample data and code to run as development server. You are invited to fork the code, improve the design and send a pull request

Quick Start

  • Clone the repo: git clone
  • if you don't have python installed (you can test for it by typing python on your prompt) get it from Version 2.7.2 is best
  • Change your working directory to the project's: cd ok-templates
  • Start the local server: python
  • Browse to http://localhost:8000/agenda/1;s


the templates themselves are located at the templates folder and written in Mustache logicless templating language. The templates have a .mustache ending and are rendered using a context based on a general context.yaml` on the project's root and a template specific json file.


The repository includes a agenda_detail.mustache file that is based on a 1.0 template and all the required template tags and include files. To see the template, point your browser at http://locahost:8000/agenda/1;s and you will see a page rendered based on the template and a context file from fixtures/agenda/1.json. Behind the scenes, when the server identify a url that ends with ;s it eaves most of the rendering to the client and uses template/small_base.mustache to render a page with basic html and the javascript needed to render the page on the client. Without the ;s rendering is done on the server, using pystache. This mode is not tested and is less usuable as pystache does not return meaningfull errors (yet?).

I18N & L10N

The templates support i18n through gnu's gettext. You can test if you have it installed by running gettext --version. If you don't, the easiest way is to run apt-get install gettext on Linux or brew install gettext for the OSX, and for the less fortunate ones, try the setup file here. To use static text in the the template, use natural language and wrap it in {{#_}}Natural Language{{/_}}. Once you've added strings to be translated you need to update the .po file. First run python to update the file locale/he/LC_MESSAGES/mustache.po with the new strings. Next, edit the file using a text editor or poedit and translate the strings. Fianlly, you need to compile the file using ./compilemsgs.

Once stasified with your changes, commit your changes to your fork with a meaningful commit message and send a pull request to hasadna's fork