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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 634F1BBC1 for ; Mon, 3 Mar 2008 22:57:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAL8CzEfBAkMth2dsb2JhbACQdwEBAQgKKZw4 X-IronPort-AV: E=Sophos;i="4.25,440,1199660400"; d="scan'208";a="7961459" Received: from vega.fmf.uni-lj.si (HELO postar.fmf.uni-lj.si) ([193.2.67.45]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Mar 2008 22:57:45 +0100 Received: from localhost (unknown [192.168.5.1]) by postar.fmf.uni-lj.si (Postfix) with ESMTP id 2D26538FB25 for ; Mon, 3 Mar 2008 22:57:44 +0100 (CET) X-Virus-Scanned: amavisd-new at spam.fmf.uni-lj.si Received: from postar.fmf.uni-lj.si ([192.168.5.5]) by localhost (spam.fmf.uni-lj.si [192.168.5.1]) (amavisd-new, port 10024) with ESMTP id 40bsmIfp-30v for ; Mon, 3 Mar 2008 22:57:43 +0100 (CET) Received: from [192.168.1.115] (BSN-77-148-136.static.dsl.siol.net [193.77.148.136]) (Authenticated sender: bauer) by postar.fmf.uni-lj.si (Postfix) with ESMTP id AF38B387E3E for ; Mon, 3 Mar 2008 22:57:43 +0100 (CET) Message-ID: <47CC74CB.6040006@fmf.uni-lj.si> Date: Mon, 03 Mar 2008 22:59:39 +0100 From: Andrej Bauer Reply-To: Andrej.Bauer@andrej.com User-Agent: Thunderbird 1.5.0.14ubu (X11/20080227) MIME-Version: 1.0 To: caml-list caml-list Subject: Re: [Caml-list] How to tell ocamlbuild to pass options to ocamldoc? References: <47C9A4BA.7040504@fmf.uni-lj.si> <4b5157c30803020226i2f84248eh5535985c753f58a@mail.gmail.com> <47CBB144.8020108@lri.fr> <1204547029-sup-3853@ausone.inria.fr> In-Reply-To: <1204547029-sup-3853@ausone.inria.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; andrej:01 andrej:01 ocamldoc:01 ocaml:01 -keep-code:01 ocamldoc:01 -keep-code:01 ocamllex:01 ocamlyacc:01 makefile:01 ocaml:01 mll:01 compile:01 compile:01 symbolic:01 >> open Ocamlbuild_plugin;; >> >> dispatch begin function >> | After_rules -> >> flag ["ocaml"; "doc"] "-keep-code" >> end This gives me an error. > You can also be less global by adding a new tag "keep_code": In my case I am happy to be "global". I ended up with: open Ocamlbuild_plugin ;; dispatch begin function | After_options -> Options.ocamldoc := S[ A"ocamldoc"; A"-keep-code"; A"-colorize-code" ] | _ -> () end This feels "too global" though. Maybe I should explain the background. I am composing a library of small examples from programming language theory. A typical example consists of about 300 lines of code (including ocamllex and ocamlyacc). I want it to be: (1) as easy to compile as possible: I decided to use ocamlbuild but I also provide a Makefile which runs ocamlbuild and a README.txt explaining how to compile. The only drawback is that this requires a fairly new version of ocaml. (2) I want to publish the code on the web in browsable format. I think I will do it two ways: as generated by ocamldoc (which is why I wanted "-keep-code"). and as raw code converted to HTML with caml2html (because ocamldoc doesn't do .mly and .mll). Since I am already talking about ocamlbuild, I should point out that I used it for teaching last semester. The main challenge was coping with Windows environment which cannot handle symbolic links. (And we used OcaIDE, too. The "development environment" kind of worked, and was much much less hassle than xemacs+make). Thank you again. Andrej