caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [ANN] HTCaML / CaSS
@ 2010-11-23 13:05 Thomas Gazagnaire
  2010-11-23 13:22 ` [Caml-list] " Gerd Stolpmann
       [not found] ` <1681920730.765376.1290518571583.JavaMail.root@zmbs4.inria.fr>
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Gazagnaire @ 2010-11-23 13:05 UTC (permalink / raw)
  To: caml-list

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<
  <html>
    <body>
      <div class="boxes">
        $list:List.map Box.html_of_t boxes$
      </div>
    </body>
  </html>
  >>

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


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

end of thread, other threads:[~2010-11-23 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-23 13:05 [ANN] HTCaML / CaSS Thomas Gazagnaire
2010-11-23 13:22 ` [Caml-list] " Gerd Stolpmann
     [not found] ` <1681920730.765376.1290518571583.JavaMail.root@zmbs4.inria.fr>
2010-11-23 14:01   ` Thomas Gazagnaire
2010-11-23 15:25     ` Gerd Stolpmann
     [not found]   ` <926842186.769232.1290520895288.JavaMail.root@zmbs4.inria.fr>
2010-11-23 14:04     ` Thomas Gazagnaire

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).