caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Help with Elliom syntax
@ 2010-11-04 11:44 Till Crueger
  2010-11-04 12:31 ` Sylvain Le Gall
  0 siblings, 1 reply; 4+ messages in thread
From: Till Crueger @ 2010-11-04 11:44 UTC (permalink / raw)
  To: caml-list

Hi,

I am still trying to find my way with Elliom and Ocsigen. Right now I can  
use OCaml to generate the pages I want, but I still have problems to  
figure out how to encode the XHTML. The main question I have is how to  
assign attributes to elements,
like div blocks or others. I found the a_id functions that should return  
an id object, but I have not figured out how to use it to actually assign  
the id.

Thanks for your help again,
   Till


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help with Elliom syntax
  2010-11-04 11:44 Help with Elliom syntax Till Crueger
@ 2010-11-04 12:31 ` Sylvain Le Gall
  2010-11-04 13:49   ` [Caml-list] " Till Crueger
  0 siblings, 1 reply; 4+ messages in thread
From: Sylvain Le Gall @ 2010-11-04 12:31 UTC (permalink / raw)
  To: caml-list

Hello,

On 04-11-2010, Till Crueger <Till.Crueger@gmx.net> wrote:
> Hi,
>
> I am still trying to find my way with Elliom and Ocsigen. Right now I can  
> use OCaml to generate the pages I want, but I still have problems to  
> figure out how to encode the XHTML. The main question I have is how to  
> assign attributes to elements,
> like div blocks or others. I found the a_id functions that should return  
> an id object, but I have not figured out how to use it to actually assign  
> the id.
>

Most of the time you have an ~a parameter.

Example:
div ~a:[a_class ["statistics"]] [ h2 [pcdata "Statistics"]; ... ]

Regards,
Sylvain Le Gall


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Re: Help with Elliom syntax
  2010-11-04 12:31 ` Sylvain Le Gall
@ 2010-11-04 13:49   ` Till Crueger
  2010-11-04 14:37     ` Sylvain Le Gall
  0 siblings, 1 reply; 4+ messages in thread
From: Till Crueger @ 2010-11-04 13:49 UTC (permalink / raw)
  To: caml-list

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.

Bye,
   Till


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help with Elliom syntax
  2010-11-04 13:49   ` [Caml-list] " Till Crueger
@ 2010-11-04 14:37     ` Sylvain Le Gall
  0 siblings, 0 replies; 4+ messages in thread
From: Sylvain Le Gall @ 2010-11-04 14:37 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-04 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 11:44 Help with Elliom syntax Till Crueger
2010-11-04 12:31 ` Sylvain Le Gall
2010-11-04 13:49   ` [Caml-list] " Till Crueger
2010-11-04 14:37     ` Sylvain Le Gall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).