caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Török Edwin" <edwintorok@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] ocamldoc option with oasis
Date: Sat, 14 Jan 2012 23:11:12 +0200	[thread overview]
Message-ID: <4F11EF70.7050407@gmail.com> (raw)
In-Reply-To: <CAOOOohTRj=2wmOc4DOb_DRmj0m9=uW6XQgvurvN15+0pS7wagw@mail.gmail.com>

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

  reply	other threads:[~2012-01-14 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14 19:47 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 [this message]
2012-01-15  7:51       ` Philippe Veber

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=4F11EF70.7050407@gmail.com \
    --to=edwintorok@gmail.com \
    --cc=caml-list@inria.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;
as well as URLs for NNTP newsgroup(s).