From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0F7pcB0013692 for ; Sun, 15 Jan 2012 08:51:38 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4DAMKEEk/RVdy2mGdsb2JhbABEnH80h3ABiAgIIgEBAQEBCAkNBxQlgXIBAQEDAQwGAhMZARsSCwEDAQsGBQsNDSEhAQERAQUBChIGExIQh1gImQMKi2qCb4QIP4hxAgULg3GIGwSCW5I2inuDDz2CTIEv X-IronPort-AV: E=Sophos;i="4.71,513,1320620400"; d="scan'208";a="139409781" Received: from mail-vx0-f182.google.com ([209.85.220.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 15 Jan 2012 08:51:32 +0100 Received: by vcbfl17 with SMTP id fl17so702232vcb.27 for ; Sat, 14 Jan 2012 23:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Fl98rkD00Pe3bvBw8f1JBeq/KoG7TX0Bloj/jMl2uNU=; b=P2PakZqU9D2ZChARUlUnN9baCs5+AMxuMh/47mWXQ1GzZclHZSeuO7GXl0MHAYH4Au 9EUIVe7fDTGkglmeSUQz/q6g6kH/InthLrOqMGq1RthzP1mJsuhWMdfEUzNkuSzEKvZZ Cz0QEcLI+U0TkP2lFNfGJR5zU8YrLZaM40xCI= Received: by 10.220.152.78 with SMTP id f14mr4774180vcw.30.1326613891124; Sat, 14 Jan 2012 23:51:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.240.130 with HTTP; Sat, 14 Jan 2012 23:51:09 -0800 (PST) In-Reply-To: <4F11EF70.7050407@gmail.com> References: <20120114.210459.1431907109936403821.Christophe.Troestler@umons.ac.be> <4F11EF70.7050407@gmail.com> From: Philippe Veber Date: Sun, 15 Jan 2012 08:51:09 +0100 Message-ID: To: =?ISO-8859-1?Q?T=F6r=F6k_Edwin?= Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=f46d043c7b00bc0d3a04b68c5d1d X-Validation-by: philippe.veber@gmail.com Subject: Re: [Caml-list] ocamldoc option with oasis --f46d043c7b00bc0d3a04b68c5d1d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2012/1/14 T=F6r=F6k Edwin > On 01/14/2012 11:01 PM, Philippe Veber wrote: > >> 2012/1/14 Christophe TROESTLER >> > >> >> On Sat, 14 Jan 2012 20:47:17 +0100, Philippe Veber wrote: >>> >>>> >>>> Is there a way to pass an option (in my case -charset utf8) to ocamldoc >>>> when using oasis? Said differently, I'd like to customize the command >>>> >>> used >>> >>>> by oasis to generate the target of a Document section. >>>> >>> >>> This was discussed some time ago but I am not sure whether it was >>> implemented. You can use a custom generator to achieve the same thing >>> however. >>> >>> class gen =3D >>> object(self) >>> inherit Odoc_html.html >>> >>> initializer >>> character_encoding<- >>> ">> http-equiv=3D\"Content-Type\">\**n" >>> end >>> >>> let () =3D >>> Odoc_args.set_doc_generator (Some(new gen :> Odoc_args.doc_generator)) >>> >>> Best, >>> C. >>> >>> Thank you Christophe for this quick answer. I had found the thread you >> mention: >> >> http://caml.inria.fr/pub/ml-**archives/caml-list/2010/06/** >> 5a947fba35df60a35bdc89a4bea1a8**69.fr.html >> >> and could check that Maxence Guesdon indeed added a -charset option, to >> make this process easier. However, I'm under the impression that the >> problem remains: I have to tell oasis to use ocamldoc with the custom >> generator, which requires to customize the ocamldoc command. Did I miss >> something? >> Thanks again, >> ph. >> >> > You can add flags to the ocamldoc command by adding something like to the > end > of your myocamlbuild.ml: > > Ocamlbuild_plugin.dispatch (function > | After_rules as e -> > flag ["doc"; "ocaml"] & > (S[A"-colorize-code";A"-stars"**;A"-charset";A"utf8"]); > > dispatch_default e > | e -> > dispatch_default e) > ;; > This worked just fine, thanks a lot Edwin! > > Maybe oasis could offer a way to do this automatically (XocamlbuildFlags?= ). > In the meantime, I'll be happy with this. ph. > > Best regards, > --Edwin > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/**wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-**bugs > > --f46d043c7b00bc0d3a04b68c5d1d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2012/1/14 T=F6r=F6k Edwin <edwintorok@gmail.com>= ;
On 01/14/2012 11:01 PM, Philippe Ve= ber wrote:
2012/1/14 Christophe TROESTLER<Christophe.Troestler@umons.ac.be>= ;

On Sat, 14 Jan 2012 20:47:17 +0100, Philippe Veber wrote:

Is there a way to pass an option (in my case -charset utf8) to ocamldoc
when using oasis? Said differently, I'd like to customize the command
used
by oasis to generate the target of a Document section.

This was discussed some time ago but I am not sure whether it was
implemented. =A0You can use a custom generator to achieve the same thing
however.

class gen =3D
object(self)
=A0inherit Odoc_html.html

=A0initializer
=A0 =A0character_encoding<-
=A0 =A0 =A0"<meta content=3D\"text/html; charset=3Dutf-8\&quo= t; \
=A0 =A0 =A0 =A0http-equiv=3D\"Content-Type\">\n"<= br> end

let () =3D
=A0Odoc_args.set_doc_generator (Some(new gen :> =A0Odoc_args.doc_genera= tor))

Best,
C.

Thank you Christophe for this quick answer. I had found the thread you
mention:

http://caml.inria.fr/pub= /ml-archives/caml-list/2010/06/5a947fba35df60a35bdc89a4bea1a8= 69.fr.html

and could check that Maxence Guesdon indeed added a -charset option, to
make this process easier. However, I'm under the impression that the
problem remains: I have to tell oasis to use ocamldoc with the custom
generator, which requires to customize the ocamldoc command. Did I miss
something?
Thanks again,
ph.


You can add flags to the ocamldoc command by adding something like to the e= nd
of your myocamlbuild.m= l:

Ocamlbuild_plugin.dispatch (function
| After_rules as e ->
=A0 =A0flag ["doc"; "ocaml"] &
=A0 =A0(S[A"-colorize-code";A"-stars";A"-c= harset";A"utf8"]);

=A0 =A0dispatch_default e
| e ->
=A0 =A0dispatch_default e)
;;


This worked just fine, thanks a lot Edwin!<= br>
=A0

Maybe oasis could offer a way to do this automatically (XocamlbuildFlags?).=
In the meantime, I'll be happy with this.

=
ph.

=A0

Best regards,
--Edwin

--
Caml-list mailing list. =A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs


--f46d043c7b00bc0d3a04b68c5d1d--