Package: noor
OverviewNooris a small Quran viewer written inPython.  It shows the
translation of each aya, if specified, right after it.  These are the
interfaces that come with noor:InterfaceDescriptionnoorgtkUsesPyGtklibrarynoorhtmlsOutputs quran in html files in the output directorynoorcgiCan be used as a CGI script in web serversnoortxtOutputs a sura to a text fileNew Featurescopy current aya/translation to clipboardsupport for vi-like marksGetting StartednoorgtkFor using the GTK interface you need to installPythonandPyGTK(they are installed by default in some linux distributions like
Ubuntu).  You can start it by runningnoorgtk.pywscript 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 runpython setup.py installto install
Noor.  After that you’ll be able to runnoorgtk.pywin the terminal
from any location.noorhtmlsThe noorhtmls interface can be used to output quran in html files in a
directory.  All you should do is to run:noorhtmls.py output_folderTheindex.htmlfile will contain the list of suras and001.htmlthrough114.htmlfiles will contain the suras.  Note
that the configuration specified in the~/.noorfile is considered
when generating the pages.noorcgiInstalling the CGI script,noorcgi.py, is like installing any
other CGI script.  You probably have to copy it to thecgi-bindirectory of your web server.  But before that you should either
install noor as described in thenoorgtksection or change the line
innoorcgi.pyfile 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 installPyGTK.Noorgtk TutorialAfter startingnoorgtkas described above, you’ll be asked to
select a sura to view.  (Usegtk.ask_sura_at_startconfig or give
a command line argument to skip that).Now you see the sura you’ve chosen.  Use up and down keys to move the
text.  Pressakey; you’ll be asked to enter an aya number.  After
pressing enter you’ll be moved to that aya.Now pressc.  A dialog pops up in which you can select a sura.Presssthis time; Noor will ask you to insert a sura number to
go to.  AlsoJ(that is capital j) moves you to the start of a
juz.Now pressC-M-norC-j(whichever you’re most comfortable
with).  Noor will show the next sura.  LikewiseC-M-porC-kcan be used for previous sura.Some commands need an integer argument, such as goto aya, goto the
page before aya, goto sura and goto juz.  If you type a number before
using these commands, that number will be assumed to be the argument
and Noorwon’task the number in a dialog.Note that many of Noor commands can be done in more than one way and
have more than one key-binding.  See thenoorgtk keysand try its
commands.Also you can tell noorgtk to start from a sura and aya using command
line arguments.  For instancenoorgtk.pyw 100 3goes to the third
aya of the 100th sura.Adding TranslationsYou can edit the~/.noorfile:[common]
translation = /path/to/translation/fileThe translation file can be in two formats.  It can be either a zip
file in the same format asZekrtranslation files which can be
obtained fromhttp://siahe.com/zekr/resources.htmlor it can be a
utf-8 text file with translation of each aya in one line.Changing FontYou can change the GTK or html fonts in~/.noorfile:[gtk]
font = me_quran 23
translation_font = Dejavu Sans Mono size:14 fgcolor:#001100 fgcolor:#DDDDFF

[html]
font = me_quran 6 fgcolor:554444
translation_font = Dejavu Sans Mono 4 fgcolor:444455A font has face, size, fgcolor and bgcolor attributes.  These
attributes can be set usingattr:valueformat whereattris
attribute name.  The old format still works; that ismyfont 16is
the same asmyfont size:16and also the same asface:myfont size:16.NotesYou can add notes to suras and ayas.  You can usegtk.show_notesvariable to enable this feature; add this to your~/.noor:[gtk]
show_notes = 1When enabled, notes panel is shown right above the status bar.UsingAkey (that isshift-a), moves the focus tonotespanel (you can also use the mouse).  You can useNto toggle note
panel visibility.Notes are saved ingtk.notes_dirdirectory (~/.noornotes, by
default) when either the focus moves out of notes panel or when you
pressC-s.  Notes are saved in:notes for kth sura will be written ink.txtnotes for the kth aya of jth sura will be written inj-k.txtChanging The LanguageYou can change the language of noorgtk dialogs and noorhtmls pages;
for instance:[common]
lang = enwill use English.  The value ofcommon.langconfig should be a two
letter symbol of a language.  Currently Arabic (ar), English
(en), Farsi (fa) and Pashto (ps) are supported.  If you
like, you can translate noor to other languages (ask the mailing list
if you need help).Playing RecitationYou can usegtk.play_ayaandgtk.play_surato play sura and
aya recitation.  For instance:[gtk]
play_aya = mplayer -noconsolecontrols /path/to/folder/${sura}${aya}.mp3${sura}and${aya}are replaced with zero filled sura and aya
number.You can also ask noor to follow ayas; that is when the player finishes
with zero return value noor goes to the next aya.  For this to work
you need to set thegtk.follow_ayasoption:[gtk]
follow_ayas = 1You can use theKkey to stop following ayas.Hiding Noorgtk PartsYou can hide most GUI parts of noorgtk.  For instance:[gtk]
menu_bar = 0
status_bar = 0
toolbar = 0
scrollbar = 0
task_pane = 0
show_notes = 0
hide_buttons = 1Will hide things like menu bar, status bar and toolbar.Noorgtk KeysThese keys can be used in the GTK interface.  Note thatC-stands
for control key,M-for alt key,S-for shift key andC-Mfor control and alt key pressed together.  For instanceC-nmeans
pressingnkey while holding the control key.ActionKeysmove downdown, j, C-n, C-f, C-dmove upup, k, C-p, C-b, C-dnext pagepage-down, space, C-vprevious pagepage-up, S-space, M-vsura starthome, C-asura endend, C-enext suraC-M-n, C-jchoose suracprevious suraC-M-p, C-knext ayanprevious ayapcurrent aya.copy ayaycopy aya translationYappend digit to numberdigits; [0-9]clear numberescape, C-ggoto n-th ayaa, return, M-g, Ggoto the page before n-th ayab, S-return, M-Ggoto n-th suras, C-return, C-M-g, sgoto n-th juz startJ, C-M-return, C-M-GbackC-[, M-leftforwardC-], M-rightadd bookmarkBjump to bookmarkMadd markmjump to mark‘, `fullscreenf, F11search forward/, C-ssearch backwards?, C-rstop the playerKtoggle notesNwrite noteAaboutrquitqNotenhere means the number typed so far.  Actually by pressing
digits you prefix commands.  For instance pressing2followed by1and followed byC-M-return, you tell noor to go to the start
of the 21st juz.If no prefix is typed for prefixed commands, noor will ask it in a
dialog.Configuration FileYou can specify configuration options in~/.noorfile.  See the
end ofnoor/uihelpers.pyfile for the default contents of~/.noorfile (the default~/.noorwill be created if it does
not exist).Note thathtmlsection of the config file is applied to bothnoorcgiandnoorhtmlsinterfaces.BookmarksNoor supports aya bookmarks.  When you add a bookmark, the location
and its name is saved so that you can jump to that location from thelist bookmarksdialog.Noor saves bookmarks in a~/.noor.bmkby default.  You can change
that by usinggtk.bookmark_fileoption.  Each line of this file
can contain a bookmark like:sura_number:aya_number bookmark_nameYou can edit this file manually to change them.