<commit_before>Opardum
=======

Opardum is an operational transforms based server for collaborative document editing, written entirely in literate haskell.

Generating Literate Sources
===========================

You will need lhs2tex, and a pdflatex implementation.

    cd lhs
    ./generate.sh


Building
========

Opardum is made up of several packages:

 * opardum -- the main server implementation
 * opardum-mongodb -- a MongoDB storage backend 
 * opardum-file (TBA) -- a flat file storage backend

To compile and install Opardum with the [Haskell Platform](http://hackage.haskell.org/platform/), simply type:

   cabal configure
   cabal build
   cabal install

The Setup.hs script can also be used.

To build the mongoDB package, simply run the same commands from the mongodb/ directory. 

Dependencies
------------

Dependencies of Opardum include:

  * Dyre
  * GHC
  * Network
  * MongoDB (for optional MongoDB backend)

Configuring
===========

Opardum is configured using the *dyre* package, enabling it to be configured in the Haskell language itself, in a way similar to
[xmonad](http://xmonad.org).

The configuration file will be located in $XDG_CONFIG_HOME/opardum/opardum.hs. On Linux systems, this is ~/.config/opardum/opardum.hs

A simple configuration file is as follows:

    import Opardum.Configuration

    main = opardum defaultConfig

By default, Opardum runs on port 9988, with the websocket protocol, and a null storage backend (document state is lost when all clients disconnect).

A more useful configuration file is as follows (using the mongoDB storage backend to enable permanent storage)

    import Opardum.Configuration
    import Opardum.Storage
    import qualified Opardum.Storage.MongoDB as M

    main = opardum defaultConfig { storage = M.mongoDB M.defaults }

See the file Opardum/Configuration.lhs for a full description of options.

Running opardum with a changed config file will cause it to recompile.<commit_msg>added note about bespin<commit_after>Opardum
=======

Opardum is an operational transforms based server for collaborative document editing, written entirely in literate haskell.

Generating Literate Sources
===========================

You will need lhs2tex, and a pdflatex implementation.

    cd lhs
    ./generate.sh


Building
========

Opardum is made up of several packages:

 * opardum -- the main server implementation
 * opardum-mongodb -- a MongoDB storage backend 
 * opardum-file (TBA) -- a flat file storage backend

To compile and install Opardum with the [Haskell Platform](http://hackage.haskell.org/platform/), simply type:

   cabal configure
   cabal build
   cabal install

The Setup.hs script can also be used.

To build the mongoDB package, simply run the same commands from the mongodb/ directory. 

Dependencies
------------

Dependencies of Opardum include:

  * Dyre
  * GHC
  * Network
  * MongoDB (for optional MongoDB backend)

Configuring
===========

Opardum is configured using the *dyre* package, enabling it to be configured in the Haskell language itself, in a way similar to
[xmonad](http://xmonad.org).

The configuration file will be located in $XDG_CONFIG_HOME/opardum/opardum.hs. On Linux systems, this is ~/.config/opardum/opardum.hs

A simple configuration file is as follows:

    import Opardum.Configuration

    main = opardum defaultConfig

By default, Opardum runs on port 9988, with the websocket protocol, and a null storage backend (document state is lost when all clients disconnect).

A more useful configuration file is as follows (using the mongoDB storage backend to enable permanent storage)

    import Opardum.Configuration
    import Opardum.Storage
    import qualified Opardum.Storage.MongoDB as M

    main = opardum defaultConfig { storage = M.mongoDB M.defaults }

See the file Opardum/Configuration.lhs for a full description of options.

Running opardum with a changed config file will cause it to recompile.

Web Client
==========

A simple, probably buggy testing client has been implemented as a web page with an embedded [Mozilla Bespin](https://bespin.mozillalabs.com/) editor. In order
to use the client, download Bespin Embedded DropIn, and place it in a directory entitled "bespin" under "Client", such that Client/bespin/BespinEmbedded.js can 
be found.

Then run a web server to serve up that HTML page and navigate there with a compliant browser such as Google Chrome. Note that advanced HTML5 features are required
for Bespin, and WebSockets are used for the transport protocol. Hence Firefox 3.5 and any version of IE will not work.
{'fraction_non_alphanumeric': 0.07996504260432598, 'fraction_numerical': 0.002840288398514311, 'mean_word_length': 4.030769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '998861', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1217, 'n_words': 569}