Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Eliom's Distillery

Actually, the easiest way to initialize, compile, and run a project in Ocsigen/Eliom is to use the Eliom distillery eliom-distillery.

It should be self-documenting (refer to eliom-distillery -help and the generated README), but here is a bit information on how to work with it.

Project Initialization

The eliom-distillery creates projects from templates. Template "basic" create a very simple project (makefiles and configuration file and main service). There is also a template "mobile" for mobile apps.

To create your project, do:

$ eliom-distillery -name <name> -template basic [-target-directory <dir>]

This creates a project named <name> from the "basic" template in the directory <dir> or <name> by default. It contains the following files

  • <name>.eliom
    This is your initial source file. All Eliom files (*.eliom, *.eliomi) in this directory are automatically considered. To add a .ml/.mli file to your project, add it to the variable SERVER_FILES or CLIENT_FILES.
  • static/
    The content of this folder is statically served. It contains initially a basic CSS file for your project.
  • Makefile.options
    Configure your project here!
  • name.conf.in
    This file is a template for the configuration file for ocsigenserver. You will rarely have to edit itself - it takes its variables from the Makefile.options. This way, the installation rules and the configuration files are synchronized with respect to the different folders.
  • Makefile
    This contains all rules necessary to build, test, and run your Eliom application. You better don't touch it ;) See below for the relevant targets.
    The description on how to compile, test, install, and run your application

Please keep care that the name is a valid name for an OCaml compilation unit.

Compilation & Running: Read the README

Generally, just run

$ make test.byte (or test.opt)

to compile your project and run ocsigenserver with it.

However, please refer to the generated README file for further hints on how to work with your project!