Version française
Home     About     Download     Resources     Contact us    
Browse thread
Help with Elliom syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Help with Elliom syntax
Hello,

On 04-11-2010, Till Crueger <Till.Crueger@gmx.net> wrote:
> On Thu, 04 Nov 2010 13:31:35 +0100, Sylvain Le Gall <sylvain@le-gall.net>  
> wrote:
>
>> Most of the time you have an ~a parameter.
>>
>> Example:
>> div ~a:[a_class ["statistics"]] [ h2 [pcdata "Statistics"]; ... ]
>
> Thanks for the help again.
> Is there a place where such things are documented? Because I was not able  
> to figure out how to do this using the Elliom developer manual.
>

Well, you have to figure how nullary/.../star works.
http://ocsigen.org/docu/1.3.0/XHTML.T.html#TYPEnullary
All is in the type ;-)

E.g. for nullary 
type ('a, 'b) nullary = ?a:'a attrib list -> unit -> 'b elt 
and 
val br : ([< core ], [> `Br ]) nullary
and 
type core = [ `Class | `Id | `Title ] 

So you know that br accept only a_class, a_id and a_title...

I would recommend you to learn by examples, because ocsigen is a big
application and can be pretty hard to learn. There are already good
websites around:
https://github.com/mfp/ocsiblog
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=oasis-db;a=tree
http://ocsigen.org/ocsimore/sources/

Regards,
Sylvain Le Gall