From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Thomas Gazagnaire <thomas.gazagnaire@inria.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] [ANN] HTCaML / CaSS
Date: Tue, 23 Nov 2010 14:22:48 +0100 [thread overview]
Message-ID: <1290518568.16005.369.camel@thinkpad> (raw)
In-Reply-To: <1290517554.4734.103.camel@saorge.inria.fr>
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
<div> [ ... ]
instead of <div>...</div>, and there is a distinction in the syntax
between node and list of nodes, e.g.
<div> list
but
<div> [ 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<
> <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
>
> _______________________________________________
> 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
------------------------------------------------------------
next prev parent reply other threads:[~2010-11-23 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 13:05 Thomas Gazagnaire
2010-11-23 13:22 ` Gerd Stolpmann [this message]
[not found] ` <1681920730.765376.1290518571583.JavaMail.root@zmbs4.inria.fr>
2010-11-23 14:01 ` [Caml-list] " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1290518568.16005.369.camel@thinkpad \
--to=info@gerd-stolpmann.de \
--cc=caml-list@yquem.inria.fr \
--cc=thomas.gazagnaire@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox