Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: Romain Bardou <romain.bardou@lri.fr>
Cc: Paolo Donadeo <p.donadeo@gmail.com>,
	caml-list caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] How to tell ocamlbuild to pass options to ocamldoc?
Date: Mon, 03 Mar 2008 13:23:51 +0100	[thread overview]
Message-ID: <1204547029-sup-3853@ausone.inria.fr> (raw)
In-Reply-To: <47CBB144.8020108@lri.fr>

[-- Attachment #1: Type: text/plain, Size: 2436 bytes --]

Excerpts from Romain Bardou's message of Mon Mar 03 09:05:24 +0100 2008:
> I didn't find any tag for the -keep-code flag. So indeed, I guess you 
> need a plugin. I would suggest adding the flag for tags "ocaml" and 
> "doc" (other useful tags are: interf, implem, extension:html, 
> extension:tex and so on, docfile, docdir).
> 
> Something like this:
> 
> open Ocamlbuild_plugin;;
> 
> dispatch begin function
>    | After_rules ->
>        flag ["ocaml"; "doc"] "-keep-code"
> end

Thanks Romain,

You can also be less global by adding a new tag "keep_code":

==============
open Ocamlbuild_plugin;;

dispatch begin function
  | After_rules ->
      flag ["ocaml"; "doc"; "keep_code"] "-keep-code"
end
==============

And then in your _tags

<foo.ml>: keep_code

Cheers,

> Paolo Donadeo a écrit :
> >> Perhaps I am just blind, but I was unable to figure out after poking
> >>  around for a while, how to tell ocamlbuild that it should pass the
> >>  -keep-code flag to ocamldoc. I suspect I need to put something in _tags,
> >>  but what? (I am an ocamlbuild newbie.)
> > 
> > I don't know if this is the best way, but I use the myocamlbuild
> > module to pass arguments to ocamlfind and ocamldoc, it just works.
> > 
> > An example:
> > 
> > =============== myocamlbuild.ml ===============
> > open Ocamlbuild_plugin;;
> > open Command;;
> > 
> > let (|>) x f = f x
> > 
> > let packages =
> >   [
> >     "cryptokit";
> >     "extlib";
> >     "netcgi2";
> >     "netcgi2-plex";
> >     "nethttpd";
> >     "netplex";
> >     "netstring";
> >     "oUnit";
> >     "pxp-engine";
> >     "pxp-lex-iso88591";
> >     "str";
> >     "unix"
> >   ] |> String.concat ",";;
> > 
> > let ocamlfind cmd = S[A"ocamlfind"; A cmd; A"-package"; A packages];;
> > 
> > flag ["ocaml"; "link"] (A"-linkpkg");;
> > 
> > let ocamldoc =
> >   S[A"ocamlfind";
> >     A"ocamldoc";
> >     A"-package";
> >     A packages;
> >     A"-stars";
> >     A"-colorize-code";
> >     A"-intro"; A"../documentation/doc_index.txt";
> >     A"-css-style"; A"../documentation/style.css";
> >     A"-t"; A"The Ex-nunc System";
> >   ];;
> > 
> > dispatch begin function
> >   | After_options ->
> >       Options.ocamldoc := ocamldoc;
> >       Options.ocamlc := ocamlfind "ocamlc";
> >       Options.ocamlopt := ocamlfind "ocamlopt";
> >   | _ -> ()
> > end
> > =========== END OF myocamlbuild.ml ============
> > 
> > 
> > 
> 

-- 
Nicolas Pouillard aka Ertai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

  reply	other threads:[~2008-03-03 12:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-01 18:47 Andrej Bauer
2008-03-02 10:26 ` [Caml-list] " Paolo Donadeo
2008-03-03  8:05   ` Romain Bardou
2008-03-03 12:23     ` Nicolas Pouillard [this message]
2008-03-03 21:59       ` Andrej Bauer
2008-03-04  9:00         ` Nicolas Pouillard
2008-03-04  9:59           ` Andrej Bauer

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=1204547029-sup-3853@ausone.inria.fr \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=p.donadeo@gmail.com \
    --cc=romain.bardou@lri.fr \
    /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