The gitit package

[Tags: gpl, library, program]

Gitit is a wiki program. HAppS is used for the web server and session state. Pages and uploaded files are stored in a git repository and may be modified either by using git's command-line tools or through the wiki's web interface. Pandoc's extended version of markdown is used as a markup language. Gitit can be configured to display TeX math (using jsMath) and highlighted source code. Ajax is used in a few places, but all the basic functionality is available even in browsers that do not support javascript.

[Skip to ReadMe]


Versions0.1.0.1, 0.1.1, 0.2, 0.2.1, 0.2.2,, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4,,, 0.4.1,,, 0.5, 0.5.1, 0.5.2, 0.5.3, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7, 0.7.1, 0.7.2,, 0.7.3,,,,,,,,,,,,, 0.8,, 0.8.1, 0.9,, 0.10,,, 0.10.1,,, 0.10.2, 0.10.3,, 0.10.4, 0.10.5,, 0.10.6,,,, 0.10.7, 0.11, 0.11.1,, 0.12,
Change logNone available
Dependenciesbase (>=3), bytestring, cgi, containers, Crypto, directory, filepath, HAppS-Data (==0.9.3.*), HAppS-Server (==0.9.3.*), HAppS-State (==0.9.3.*), highlighting-kate, HTTP, mtl, network, old-time, pandoc (>=1.1), parsec (<3), pretty, process, syb, utf8-string, xhtml [details]
AuthorJohn MacFarlane
UploadedThu Nov 13 01:46:06 UTC 2008 by JohnMacFarlane
DistributionsDebian:, FreeBSD:0.11.1, NixOS:
Downloads13267 total (426 in last 30 days)
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-11-19 [all 5 reports]


Maintainers' corner

For package maintainers and hackage trustees

Readme for gitit-


Gitit is a wiki program written in Haskell. It uses HAppS for the web server and session state, git for storage, history, search, diffs, and merging, and pandoc for markup processing. Pages can be added, changed, and removed either on the web or using git's command-line tools. Gitit uses pandoc's extended version of markdown as its markup language.

Getting started

Compiling and installing gitit

You'll need the GHC compiler and the cabal-install tool. GHC can be downloaded here. For cabal-install on *nix, follow the [quick install][] instructions.

If you want the syntax highlighting feature, you need to make sure that pandoc is compiled with support for it. First, make sure your system has the pcre library installed. Then:

cabal install pandoc -fhighlighting

You can skip this step if you don't care about highlighting support.

You can now install the latest release of gitit:

cabal update
cabal install gitit

To install a version of gitit checked out from the repository, change to the gitit directory and type:

cabal install

The cabal tool will automatically install all of the required haskell libraries. If all goes well, by the end of this process, the latest release of gitit will be installed in your local .cabal directory. You can check this by trying:

gitit --version

If that doesn't work, check to see that gitit is in your local cabal-install executable directory (usually ~/.cabal/bin). And make sure ~/.cabal/bin is in your system path.

Running gitit

To run gitit, you'll need git in your system path. Check this by doing

git --version

Switch to the directory where you want to run gitit. This should be a directory where you have write access, since two directories, static and wikidata, will be created here. To start gitit, just type:


If all goes well, gitit will do the following:

  1. Create a git repository, wikidata, and add a default front page.
  2. Create a static directory containing the scripts and CSS used by gitit.
  3. Start a web server on port 5001.

Check that it worked: open a web browser and go to http://localhost:5001.

Configuration options

You can set some configuration options when starting gitit, using the option -f [filename]. A configuration file takes the following form:

Config {
repositoryPath  = "wikidata",
staticDir       = "static",
wikiBanner      = "<img src=\"/images/bann.png\" alt=\"banner\"",
wikiTitle       = "Wiki",
wikiFooter      = "Powered by Gitit",
tableOfContents = False,
maxUploadSize   = 100000,
portNumber      = 5001,
passwordSalt    = "l91snthoae8eou2340987",
debugMode       = True,
frontPage       = ["Front Page"],
noEdit          = ["Help"],
noDelete        = ["Help", "Front Page"],
accessQuestion  = Just ("Enter the access code (to request a code, contact", ["abcd"])

For the most part, these options should be self-explanatory.

Configuring gitit

The static directory

If there is no wiki page or uploaded file corresponding to a request, gitit always looks last in the static directory. So, for example, a file foo.jpg in the images subdirectory of the static directory will be accessible at the url /images/foo.jpg. Pandoc creates two subdirectories of static, stylesheets and javascripts, which include the CSS and scripts it uses.

Changing the theme

To change the look of the wiki, modify gitit.css in static/stylesheets.

Adding support for math

Gitit is designed to work with jsMath to display LaTeX math in HTML. Download jsMath and jsMath Image Fonts from the jsMath download page. You'll have two .zip archives. Unzip them both in the static/javascripts directory (a new subdirectory, jsMath, will be created). You can test to see if math is working properly by clicking "help" on the top navigation bar and looking for the math example (the quadratic formula).

To write math on a wiki page, just enclose it in dollar signs, as in LaTeX:

Here is a formula:  $\frac{1}{\sqrt{c^2}}$

You can write display math by enclosing it in double dollar signs:


Highlighted source code

If gitit was compiled against a version of pandoc that has highlighting support (see above), you can get highlighted source code by using delimited code blocks:

~~~ {.haskell .numberLines}
qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
               qsort (filter (>= x) xs) 

To see what languages are available:

pandoc -v

Accessing the wiki via git

All the pages and uploaded files are stored in a git repository. By default, this lives in the wikidata directory (though this can be changed through configuration options). So you can interact with the wiki using git command line tools:

git clone ssh://
cd wikidata
vim Front\  # edit the page
git commit -m "Added message about wiki etiquette" Front\
git push 

If you now look at the Front Page on the wiki, you should see your changes reflected there. Note that the pages all have the extension .page.

Reporting bugs

There is no bug tracker as yet, so report bugs directly to the author, jgm at berkeley . edu


I borrowed some ideas about visual layout from Jeff Barczewski's fork of Simon Rozet's git-wiki.

The code in Gitit/State.hs is based on by mightybyte, as revised by dbpatterson.