From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 60384BBAF for ; Tue, 23 Nov 2010 14:06:18 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.59,242,1288566000"; d="scan'208,217";a="80038011" Received: from saorge.inria.fr (HELO [138.96.248.57]) ([138.96.248.57]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 23 Nov 2010 14:06:03 +0100 Subject: [ANN] HTCaML / CaSS From: Thomas Gazagnaire To: caml-list@yquem.inria.fr Content-Type: text/plain; charset="UTF-8" Date: Tue, 23 Nov 2010 14:05:54 +0100 Message-ID: <1290517554.4734.103.camel@saorge.inria.fr> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 struct:01 cheers:01 blog:98 blog:98 fragments:01 fragments:01 color:97 color:97 div:97 div:97 string:02 string:02 css:96 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