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=2.0 required=5.0 tests=DNS_FROM_SECURITYSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 03F5CBBAF for ; Tue, 4 Nov 2008 21:18:10 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiQBAJ08EEnUGyockWdsb2JhbACUFwEBAQEJCwoHEQOsIIstg1M X-IronPort-AV: E=Sophos;i="4.33,544,1220220000"; d="scan'208";a="18855945" Received: from smtp2-g19.free.fr ([212.27.42.28]) by mail3-smtp-sop.national.inria.fr with ESMTP; 04 Nov 2008 21:18:10 +0100 Received: from smtp2-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp2-g19.free.fr (Postfix) with ESMTP id BF57C12B6A8; Tue, 4 Nov 2008 21:18:09 +0100 (CET) Received: from [82.243.25.161] (cac94-7-82-243-25-161.fbx.proxad.net [82.243.25.161]) by smtp2-g19.free.fr (Postfix) with ESMTP id 7081912B75B; Tue, 4 Nov 2008 21:18:09 +0100 (CET) Message-ID: <4910AE01.3090504@doomeer.com> Date: Tue, 04 Nov 2008 21:18:09 +0100 From: DooMeeR User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: Dario Teixeira Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocamlbuild + Ocamldoc troubles References: <602309.60888.qm@web54604.mail.re2.yahoo.com> In-Reply-To: <602309.60888.qm@web54604.mail.re2.yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocamldoc:01 compilation:01 wiki:01 findlib:01 compilation:01 ocamldoc:01 invocation:01 ocaml:01 invocation:01 html':98 invoke:01 invoke:01 complains:01 caml-list:01 modules:02 > I'm using Ocamlbuild to manage the compilation of a library. The > myocamlbuild.ml plugin I'm using is a slight variation of the one found on > the Wiki and that adds support for Findlib [1]. Even though the actual code > compilation is working fine, I'm having problems getting it to correctly > invoke Ocamldoc to produce the API docs. > > On the project's root directory I have the plugin and a '_tags' file that > simply says that the 'lambdoc' (contains code) and 'apidoc-src' (contains > txt files with intro and tutorials for API doc) directories should be included: > > : include > : include > > Also on the root directory I have a 'lambdoc.mlpack' file containing all the > modules that should be packed together (the modules themselves are inside the > 'lambdoc' directory), and a 'lambdoc.mllib' file with a single line 'Lambdoc' > that signals that the pack should be made into a library. In addition, I > modified the plugin so that an invocation of ocamldoc would add the '-intro' > option to Ocamldoc: > > let ocamldoc_opts = S [A"-intro"; A"intro.txt"] > > And flagged it accordingly in the After_rules: > > flag ["ocaml"; "doc"] ocamldoc_opts; > > Unfortunately this isn't working. When I invoke 'ocamlbuild > lambdoc.docdir/index.html', Ocamldoc always complains it can't find the > intro.txt file. Moreover, if I forgo the intro modifications to the plugin, > even though the ocamldoc invocation succeeds, the lambdoc.docdir directory > contains only skeleton Ocamldoc files, ie, no actual generated API. > > So my questions are on how to get Ocamlbuild to generate the API documentation > in this context, and on how can external txt files also be included. I only read your problem very quickly as I'm kind of busy, so please excuse me if I say something very stupid ;) So, ocamldoc doesn't find "intro.txt". This is because this file is not copied into the _build directory by ocamlbuild. You need to explain to ocamlbuild, in your plugin, that your target (lambdoc.docdir/index.html) depends on "intro.txt", otherwise ocamlbuild won't copy the file. Even if you copy the file yourself into the _build directory, ocamlbuild might delete it. If I remember correctly there is a function of the plugin API, called "dep" if I'm not mistaken, which does exactly this. I can develop this in more details tomorrow if you need. -- Romain Bardou