Excerpts from andrej.bauer's message of Mon Mar 03 22:59:39 +0100 2008: > >> open Ocamlbuild_plugin;; > >> > >> dispatch begin function > >> | After_rules -> > >> flag ["ocaml"; "doc"] "-keep-code" > >> end > > This gives me an error. Yes, in fact it's: flag ["ocaml"; "doc"] (A"-keep-code") > > 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). Yes windows support needs more care. Glad to hear that you've make it worked. Best regards, -- Nicolas Pouillard aka Ertai