* [Caml-list] ocamldoc option with oasis @ 2012-01-14 19:47 Philippe Veber [not found] ` <20120114.210459.1431907109936403821.Christophe.Troestler@umons.ac.be> 0 siblings, 1 reply; 4+ messages in thread From: Philippe Veber @ 2012-01-14 19:47 UTC (permalink / raw) To: caml users [-- Attachment #1: Type: text/plain, Size: 238 bytes --] Dear camlers, 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. Cheers, Philippe. [-- Attachment #2: Type: text/html, Size: 270 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20120114.210459.1431907109936403821.Christophe.Troestler@umons.ac.be>]
* Re: [Caml-list] ocamldoc option with oasis [not found] ` <20120114.210459.1431907109936403821.Christophe.Troestler@umons.ac.be> @ 2012-01-14 21:01 ` Philippe Veber 2012-01-14 21:11 ` Török Edwin 0 siblings, 1 reply; 4+ messages in thread From: Philippe Veber @ 2012-01-14 21:01 UTC (permalink / raw) To: Christophe TROESTLER; +Cc: OCaml Mailing List [-- Attachment #1: Type: text/plain, Size: 1296 bytes --] 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. You can use a custom generator to achieve the same thing > however. > > class gen = > object(self) > inherit Odoc_html.html > > initializer > character_encoding <- > "<meta content=\"text/html; charset=utf-8\" \ > http-equiv=\"Content-Type\">\n" > end > > let () = > 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/5a947fba35df60a35bdc89a4bea1a869.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. [-- Attachment #2: Type: text/html, Size: 1850 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] ocamldoc option with oasis 2012-01-14 21:01 ` Philippe Veber @ 2012-01-14 21:11 ` Török Edwin 2012-01-15 7:51 ` Philippe Veber 0 siblings, 1 reply; 4+ messages in thread From: Török Edwin @ 2012-01-14 21:11 UTC (permalink / raw) To: caml-list On 01/14/2012 11:01 PM, Philippe Veber 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. You can use a custom generator to achieve the same thing >> however. >> >> class gen = >> object(self) >> inherit Odoc_html.html >> >> initializer >> character_encoding<- >> "<meta content=\"text/html; charset=utf-8\" \ >> http-equiv=\"Content-Type\">\n" >> end >> >> let () = >> 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/5a947fba35df60a35bdc89a4bea1a869.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) ;; Maybe oasis could offer a way to do this automatically (XocamlbuildFlags?). Best regards, --Edwin ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] ocamldoc option with oasis 2012-01-14 21:11 ` Török Edwin @ 2012-01-15 7:51 ` Philippe Veber 0 siblings, 0 replies; 4+ messages in thread From: Philippe Veber @ 2012-01-15 7:51 UTC (permalink / raw) To: Török Edwin; +Cc: caml-list [-- Attachment #1: Type: text/plain, Size: 2664 bytes --] 2012/1/14 Török Edwin <edwintorok@gmail.com> > On 01/14/2012 11:01 PM, Philippe Veber wrote: > >> 2012/1/14 Christophe TROESTLER<Christophe.**Troestler@umons.ac.be<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. You can use a custom generator to achieve the same thing >>> however. >>> >>> class gen = >>> object(self) >>> inherit Odoc_html.html >>> >>> initializer >>> character_encoding<- >>> "<meta content=\"text/html; charset=utf-8\" \ >>> http-equiv=\"Content-Type\">\**n" >>> end >>> >>> let () = >>> 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<http://caml.inria.fr/pub/ml-archives/caml-list/2010/06/5a947fba35df60a35bdc89a4bea1a869.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<https://sympa-roc.inria.fr/wws/info/caml-list> > Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners<http://groups.yahoo.com/group/ocaml_beginners> > Bug reports: http://caml.inria.fr/bin/caml-**bugs<http://caml.inria.fr/bin/caml-bugs> > > [-- Attachment #2: Type: text/html, Size: 4224 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-15 7:51 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-01-14 19:47 [Caml-list] ocamldoc option with oasis Philippe Veber [not found] ` <20120114.210459.1431907109936403821.Christophe.Troestler@umons.ac.be> 2012-01-14 21:01 ` Philippe Veber 2012-01-14 21:11 ` Török Edwin 2012-01-15 7:51 ` Philippe Veber
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox