caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Maxence Guesdon <Maxence.Guesdon@inria.fr>
To: David Teller <David.Teller@univ-orleans.fr>
Cc: Caml <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Two questions on OCamlDoc
Date: Tue, 2 Sep 2008 15:12:45 +0200	[thread overview]
Message-ID: <20080902151245.2b3402b6@alcazar.inria.fr> (raw)
In-Reply-To: <1220356028.6406.33.camel@Blefuscu>

On Tue, 02 Sep 2008 13:47:08 +0200
David Teller <David.Teller@univ-orleans.fr> wrote:

>      Hi everyone,

Hello,

>  I'm currently toying with OCamlDoc, with very little success. I'm
> attempting to do two things:
> * getting OCamlDoc to understand that some modules (which I can modify)
> contain the documentation for some other modules (which I can't) replace
> some modules with others
> * inlining the documentation for modules in modules which import those.
> 
> I need a little help.
> 
> Let me detail this.
> 
> *** Documentation replacement ***
> My project uses modules M_lib1, M_lib2... which come from a variety of
> libraries. For each of these modules, I have created  a module
> M_lib1_with_doc, M_lib2_with_doc, which imports the corresponding
> library module but tailors the documentation to my project. However, for
> technical reasons of mechanical generation, assuming that M_lib1 refers
> to M_lib2, M_lib1_with_doc still refers to M_lib2 instead of referring
> to M_lib2_with_doc. Consequently, when generating the documentation of
> M_lib1_with_doc, ocamldoc doesn't link the generated pages to the
> documentation of M_lib2_with_doc but rather attempts to link it to
> M_lib2 (and fails, as expected).
> 
> Now, I could rework the mechanical generation of my modules and in time,
> I will. However, for the moment, I'm looking for a purely OCamlDoc-based
> solution. I'd like to be able to ask OCamlDoc to please consider every
> reference to M_lib2 as actually meaning a reference to M_lib2_with_doc.
> 
> I have tried to override method [text#html_of_Ref], without much
> success. Is there a simple solution for this?

A simple way (but not always possible, due to name clashes) would be to
use some script to perform string substitution in generated html files; in
your example, replacing all "M_lib2" by "M_lib2_with_doc". you could indeed
try to do this by overriding the method html_of_Ref. What problem do you
encounter ?

Another way would be to use some "cat" commands to create new
"..._with_doc.ml" files, compile them and use your "..._with_doc.mli" as
documented interface.

> *** Inlining modules ***
> I have a few modules whose sole role is to include one or two existing
> modules. By default, when meeting [include], OCamlDoc, ocamldoc only
> generates a link from the container module to the inlined module. In
> this case, I'd rather want the whole documentation of each of these
> modules to be inlined. 
>
> Is that possible?

May be. You could try to override the method html_of_module_element so that,
when you encounter a Element_included_module, you search the real module by
its name and print its elements instead of just "include ...".

Does this help ?

Regards,

Maxence


-- 
Maxence Guesdon                           http://yquem.inria.fr/~guesdon/
Service Expérimentation et Développements https://devel.inria.fr/rocq/
INRIA Paris-Rocquencourt                  http://www.inria.fr/rocquencourt/




  parent reply	other threads:[~2008-09-02 13:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 11:47 David Teller
2008-09-02 12:05 ` [Caml-list] " David Teller
2008-09-02 12:48   ` Another question on OcamlDoc Jan Kybic
2008-09-02 17:19     ` [Caml-list] " David Teller
2008-09-03  6:48     ` Maxence Guesdon
2008-09-15 13:09       ` Jan Kybic
2008-09-02 13:37   ` [Caml-list] Two questions on OCamlDoc Maxence Guesdon
2008-09-02 13:12 ` Maxence Guesdon [this message]
2008-09-05 10:25 ` David Teller
2008-09-05 12:03   ` Maxence Guesdon
2008-09-05 12:33     ` David Teller
2008-09-05 12:37       ` Maxence Guesdon
2008-09-05 12:42         ` David Teller
2008-09-05 12:58           ` Maxence Guesdon

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=20080902151245.2b3402b6@alcazar.inria.fr \
    --to=maxence.guesdon@inria.fr \
    --cc=David.Teller@univ-orleans.fr \
    --cc=caml-list@yquem.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).