A python Quran viewer
Project description
Overview
Noor is a program written in Python for viewing quran. You can specify translation files; If specified the translation of each aya is shown after it. These are the interfaces that come with noor:
Interface |
Description |
---|---|
noorgtk |
Uses PyGtk library |
noorhtmls |
Outputs quran in html files in the output directory |
noorcgi |
Can be used as a CGI script in web servers |
noortxt |
Outputs a sura to a text file |
New Features
Added noorhtmls interface for generating html files
Changing translation font for noorcgi and noorhtmls interfaces
The noorhtmls interface can be used to output quran in html files in a directory. All you should do is to run:
noorhtmls.py output_folder
The index.html file will contain the list of suras and 001.html through 114.html files will contain the suras. Note that the configurations specified in the ~/.noor file are considered when generating the pages.
Now you can change the translation font for noorcgi and noorhtmls interfaces by setting translation_font config in the html section of ~/.noor:
[html] translation_font = myfont
Getting Started
For using the GTK interface you need to install Python and PyGTK (they are installed by default in some linux distributions like Ubuntu). You can start it by running noorgtk.py script either from the command line or by double clicking it in the extracted folder. That is, no installation is necessary.
But if you like, you can run python setup.py install to install Noor. After that you’ll be able to run noorgtk.py in the terminal from any location.
Installing the CGI script, noorcgi.py, is like installing any other CGI script. You probably have to copy it to the cgi-bin directory of your web server. But before that you should either install noor as described in the previous paragraph or change the line in noorcgi.py file which looks like:
# Add noor to the python path if its not installed: sys.path.append('/noor/extracted/folder/')
to point to the folder in which you’ve extracted noor. Note that if you want to use the CGI interface you no longer need to install PyGTK.
Adding Translations
You can edit the ~/.noor file:
[common] translation = /path/to/translation/file
The translation file can be in two formats. It can be either a zip file in the same format as Zekr translation files which can be obtained from http://siahe.com/zekr/resources.html or it can be a utf-8 text file with translation of each aya in one line.
Changing Font
You can change the GTK or html fonts in ~/.noor file:
[gtk] font = nazli 19 [html] font = nazli 6 translation_font = homa 4
Note that “html” section of config file is applied to both noorcgi and noorhtmls interfaces.
noorgtk keys
These keys can be used in the GTK interface for moving the text. Note that C- stands for control key, M- for alt key and S- for shift key.
Action |
Keys |
---|---|
move down |
j, C-n |
move up |
k, C-p |
next page |
space, C-v, PgUp |
previous page |
S-space, M-v, PgDn |
quit |
q |