English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Ocamlbuild + Ocamldoc troubles
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-04 (19:19)
From: Dario Teixeira <darioteixeira@y...>
Subject: Ocamlbuild + Ocamldoc troubles

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:

<lambdoc>: include
<apidoc-src>: 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.

Thanks in advance for your attention!
Best regards,
Dario Teixeira

[1] http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild