caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: DooMeeR <d@doomeer.com>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocamlbuild + Ocamldoc troubles
Date: Tue, 04 Nov 2008 21:18:09 +0100	[thread overview]
Message-ID: <4910AE01.3090504@doomeer.com> (raw)
In-Reply-To: <602309.60888.qm@web54604.mail.re2.yahoo.com>

> 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.

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


  reply	other threads:[~2008-11-04 20:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 19:19 Dario Teixeira
2008-11-04 20:18 ` DooMeeR [this message]
2008-11-04 20:49   ` [Caml-list] " Dario Teixeira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4910AE01.3090504@doomeer.com \
    --to=d@doomeer.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).