From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 77854BBAF for ; Wed, 1 Oct 2008 17:34:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgkBAAo140hCbwQbmmdsb2JhbACTSgEBAQEBCAsKBxEEqjGBag X-IronPort-AV: E=Sophos;i="4.33,344,1220220000"; d="scan'208";a="17554078" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Oct 2008 17:34:13 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m91FYCWW012930 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 1 Oct 2008 17:34:13 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgkBAAo140hCbwQbmmdsb2JhbACTSgEBAQEBCAsKBxEEqjGBag X-IronPort-AV: E=Sophos;i="4.33,344,1220220000"; d="scan'208";a="17554077" Received: from out3.smtp.messagingengine.com ([66.111.4.27]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Oct 2008 17:34:12 +0200 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 914C917274D; Wed, 1 Oct 2008 11:34:08 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 01 Oct 2008 11:34:08 -0400 X-Sasl-enc: yRbRxdv1zOnf8SV6BrqAFajLaMv6L098YoDpVBMMx/Mc 1222875248 Received: from [192.168.1.10] (ALyon-157-1-120-40.w90-41.abo.wanadoo.fr [90.41.231.40]) by mail.messagingengine.com (Postfix) with ESMTPSA id C2AE9ECF8; Wed, 1 Oct 2008 11:34:07 -0400 (EDT) Date: Wed, 1 Oct 2008 17:27:11 +0200 (CEST) From: Martin Jambon X-X-Sender: martin@martin.ec.wink.com To: Dario Teixeira Cc: caml-list@inria.fr Subject: Re: [Caml-list] Syntax highlighting and Ocaml/PHP integration In-Reply-To: <650721.83058.qm@web54605.mail.re2.yahoo.com> Message-ID: References: <650721.83058.qm@web54605.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at discorde with ID 48E39874.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 syntax:01 ocaml:01 syntax:01 emacs:01 makefile:01 basename:01 webpages:98 wrote:01 caml-list:01 bin:01 jambon:01 jambon:01 embedding:03 static:03 On Wed, 1 Oct 2008, Dario Teixeira wrote: > P.S. Another (possibly far-fetched) solution is to take advantage of the > syntax highlighting capabilities of Vim or Emacs. Something along > the lines of embedding or remotely invoking one of these editors, > with the sole purpose of asking them to highlight a text file. > Is this even possible? I've used vim a little bit for my static webpages, here's the result: http://martin.jambon.free.fr/hello.c.html http://martin.jambon.free.fr/quine.sh.html http://martin.jambon.free.fr/micmatch/Makefile.html The script is: #!/bin/sh -e # Usage : any2html [ ...] # Requires : vim [ $# -lt 1 ] && echo "Usage : $0 ..." && exit 1 while [ -n "$1" ] do file=`basename "$1"` cp -f "$1" /tmp vim -f +"syn on" +"so \\\$VIMRUNTIME/syntax/2html.vim" +"wq" +"q" /tmp/"$file" cp -f /tmp/"$file".html "$1".html shift done ########################################################### Martin -- http://mjambon.com/