From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6DDD9BBAF for ; Tue, 23 Nov 2010 14:22:51 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkDAD9P60zU4366kGdsb2JhbACDTpBijTd9FQEBAQEJCQwHEQMfrFSQbwKBIHOCQ3MEhw2GYA X-IronPort-AV: E=Sophos;i="4.59,242,1288566000"; d="scan'208,217";a="80771074" Received: from moutng.kundenserver.de ([212.227.126.186]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Nov 2010 14:22:51 +0100 Received: from office1.lan.sumadev.de (dslb-094-219-215-222.pools.arcor-ip.net [94.219.215.222]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MNhBG-1PMYrL11ju-007AqU; Tue, 23 Nov 2010 14:22:49 +0100 Received: from [192.168.5.106] (dslb-094-219-215-222.pools.arcor-ip.net [94.219.215.222]) by office1.lan.sumadev.de (Postfix) with ESMTPA id E283F5F701; Tue, 23 Nov 2010 14:22:48 +0100 (CET) Subject: Re: [Caml-list] [ANN] HTCaML / CaSS From: Gerd Stolpmann To: Thomas Gazagnaire Cc: caml-list@yquem.inria.fr In-Reply-To: <1290517554.4734.103.camel@saorge.inria.fr> References: <1290517554.4734.103.camel@saorge.inria.fr> Content-Type: text/plain; charset="UTF-8" Date: Tue, 23 Nov 2010 14:22:48 +0100 Message-ID: <1290518568.16005.369.camel@thinkpad> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:kSFu/f+KFJYCTFBw5jjEkULBT03WQSybn5kPlEE6Lg7 z3SPuLdk/L4Fn/NuvwCE0pqXuJp5BeKVQiRBPvE75vOjQcbepO Ad8BIQ8B0bcISa93AAbjlrsO7GBzDW0XbLBA+Y1ZQtF8hfps+m Tsr51bCvxVJ5DzVs6BtiLNgj6skcqN3YE5VccUJLx4E26TVs4T 1+TVFfVe/T7CnzISk3emg== X-Spam: no; 0.00; gerd:01 stolpmann:01 pxp:01 ocaml:01 pxp-:01 syntax:01 syntax:01 node:01 nodes:01 node:01 gerd:01 ocaml:01 struct:01 cheers:01 beginner's:01 Have you seen that there is a preprocessor for PXP that allows you to embed XML in ocaml? http://projects.camlcity.org/projects/dl/pxp-1.2.1/doc/manual/html/ref/Intro_preprocessor.html I'm happily using this for dynamic web pages. The syntax is more light-weight, though, e.g. you write
[ ... ] instead of
...
, and there is a distinction in the syntax between node and list of nodes, e.g.
list but
[ node1 node2 ... ] Gerd Am Dienstag, den 23.11.2010, 14:05 +0100 schrieb Thomas Gazagnaire: > I am happy to announce the first official release of HTCaML[1] and > CaSS[2], two small libraries which make the writing of static web pages > easy in OCaml. > > HTCaML enables the embedding of XHTML fragments in your OCaml program > (the EDSL translates directly to Xmlm) using quotations. It also allows > you to auto-generate boilerplate XHTML fragments from type definitions. > In the same way, CaSS enables the embedding of CSS fragments in your > OCaml program using quotations. > > A quick example: > > module Box = struct > type t = { title: string; date: string; contents: Html.t } with html > let css fg bg = <:css< > color: $fg$; > background-color: $bg$; > $Css.rounded$; > .title { color: $bg$; background-color: $fg$; } > >> > end > > let my_html boxes = Html.to_string <:html< > > >
> $list:List.map Box.html_of_t boxes$ >
> > > >> > > let my_css = Css.to_string <:css< > .boxes { $Box.css <:css< blue >> <:css< white >> $ } > >> > > You can find a quick introduction to HTCaML (and maybe soon to CaSS) on > the mirage blog[3]. > > Cheers, > Thomas > > [1] https://github.com/samoht/htcaml > [2] https://github.com/samoht/cass > [3] http://www.openmirage.org/blog/introduction-to-htcaml > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- ------------------------------------------------------------ Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------