caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Kenichi Asai <asai@is.ocha.ac.jp>
To: caml-list@inria.fr
Subject: [Caml-list] Can I pass added command line option through ocamlfind?
Date: Sat, 6 Dec 2014 22:06:33 +0900	[thread overview]
Message-ID: <20141206130633.GA56657@pllab.is.ocha.ac.jp> (raw)

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

Following Francois Ripault's comment, I am studying OCamlDoc's custom
tags.  (Thank you Francois!)  I implemented the attached custom
generator implementing @en and @ja tags together with a new command
line option "-lang".  Now, what I want to do is:

ocamlfind ocamldoc -package lablgtk2.gnomecanvas -g custom.cmxs -d html -lang ja file.ml ...

However, since ocamlfind does not recognize -lang as a proper option
for ocamldoc, I get:

ocamldoc: unknown option `-lang'.

Is there any way to tell ocamlfind to pass the '-lang ja' option as is
to ocamldoc?  Alternatively, how do I specify the equivalent of
'-package lablgtk2.gnomecanvas' without using ocamlfind?  I tried:

ocamldoc -I lablgtk2.gnomecanvas     -g custom.cmxs -d html -lang ja file.ml ...
ocamldoc -I +lablgtk2.gnomecanvas    -g custom.cmxs -d html -lang ja file.ml ...
ocamldoc -I +lablgtk2                -g custom.cmxs -d html -lang ja file.ml ...

etc., but they all produced:

Error: Unbound class GnoCanvas.group

Thank you in advance.

Sincerely,

-- 
Kenichi Asai

[-- Attachment #2: custom.ml --]
[-- Type: text/plain, Size: 870 bytes --]

(** language tag: "en" for English, "ja" for Japanese *)
let lang = ref "en"

module Generator (G : Odoc_html.Html_generator) =
struct
  class html =
    object(self)
      inherit G.html

      (** copied from argot: http://argot.x9c.fr *)
      method private string_of_text text =
	let buff = Buffer.create 256 in
	self#html_of_text buff text;
	Buffer.contents buff

      (** Return HTML code for the given text of a lang tag. *)
      method private html_of_lang text = (* your code here *)
	self#string_of_text text

      initializer
        tag_functions <- (!lang, self#html_of_lang) :: tag_functions
	(** register only !lang.  Other tags are ignored *)
  end
end

let _ = begin
  Odoc_args.add_option
    ("-lang", Arg.Set_string lang, "[en|ja]\n\t\tGenerate English document");
  Odoc_args.extend_html_generator (module Generator : Odoc_gen.Html_functor)
end

             reply	other threads:[~2014-12-06 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06 13:06 Kenichi Asai [this message]
2014-12-06 13:43 ` Peter Zotov
2014-12-06 15:17   ` Kenichi Asai

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=20141206130633.GA56657@pllab.is.ocha.ac.jp \
    --to=asai@is.ocha.ac.jp \
    --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).