From mboxrd@z Thu Jan 1 00:00:00 1970 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 q1F9tg1v003903 for ; Wed, 15 Feb 2012 10:55:42 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvEEAFOAO0/U4366k2dsb2JhbABDn0mRASIBAQEBCQkUFAMkgXIBAQEDAQEBAWsLDAQFBhEBAgECAQ0hIQYBHQQGCAYTCQgBh20DBrlLiESDJwQBCQYJBAEQAgENMINfAwYgAQMFAgQMAQEDAgICAwGDKwSNPReFOo07h1Y X-IronPort-AV: E=Sophos;i="4.73,422,1325458800"; d="scan'208";a="144327375" Received: from moutng.kundenserver.de ([212.227.126.186]) by mail1-smtp-roc.national.inria.fr with ESMTP; 15 Feb 2012 10:55:36 +0100 Received: from office1.lan.sumadev.de (dslb-094-219-219-226.pools.arcor-ip.net [94.219.219.226]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0McRqW-1SFGze04Xo-00I3MB; Wed, 15 Feb 2012 10:55:34 +0100 Received: from gps.dynxs.de (localhost [127.0.0.1]) by office1.lan.sumadev.de (Postfix) with ESMTP id 3C70CC0D03; Wed, 15 Feb 2012 10:55:33 +0100 (CET) Received: from 84.58.27.134 (SquirrelMail authenticated user gerd) by gps.dynxs.de with HTTP; Wed, 15 Feb 2012 10:55:33 +0100 Message-ID: <6c53ae25faf6983cd38954f8d5309179.squirrel@gps.dynxs.de> In-Reply-To: <4F3B65B9.5010704@riken.jp> References: <4F3B65B9.5010704@riken.jp> Date: Wed, 15 Feb 2012 10:55:33 +0100 From: "Gerd Stolpmann" To: "Francois Berenger" Cc: caml-list@yquem.inria.fr User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 (Normal) Importance: Normal X-Provags-ID: V02:K0:ywsEY75DPR1X0hhFB7NkkbRnvTMT/RXo7cxIhNWEKS+ 39GwqpeJmBykkvE8ITpD3K+/O4tOaGy2cfvQdKbjxMF6F1tcFe 0mbLnmOqCeGGb7JUpGaTEhOoGCcAtlN7RurGvt9JLkq+b8GzbL yMnYAKbwAJ81xBN/AbN4VS8U6AixZIOl0F9cnhIr3De2WXdpZO 1Qya83u/K6ubHKLak/A0FuyE8mS6P4b93H/EnseGBmg+uAwW/P lQ+bi9ciVzWrLS9EBVkn31X6fKC1dAQkbbELPXCsYJzLsLxoIK kjr4rWIZdXTJzYfiF8umx1nD0c/D2s37iYYEKGsRoigZNQQclW D9iEGBs1JYTC7JvSnUzhD5Cc2b7tm+2UwOTqQRYps+yaMLrQEo NBXjgdXTTUqrz0PPyTrhfD6vcFisAxp5Ko= Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q1F9tg1v003903 Subject: Re: [Caml-list] Fwd: Re: [Batteries-devel] browsing the code while reading the doc > -------- Original Message -------- > Subject: Re: [Batteries-devel] browsing the code while reading the doc > Date: Wed, 15 Feb 2012 08:47:42 +0100 > From: bluestorm > To: Francois Berenger > CC: batteries-devel@lists.forge.ocamlcore.org > > We delegate documentation production to the standard ocamldoc tool, > which doesn't have this feature, so that is not really in the game > zone of batteries developers. That said, it *could* be possible to > make that feature available without changing ocamldoc upstream, by > implementing it as a custom documentation formatter -- ocamldoc has a > flexible architecture in this regard. > http://caml.inria.fr/pub/docs/manual-ocaml/manual029.html#toc120 Before you start writing a total new custom formatter (which probably breaks with every major OCaml version because of new syntactic elements), consider to extend/override the standard formatter. I did that quite successfully for the PXP documentation. The derived formatter is here: https://godirepo.camlcity.org/svn/lib-pxp/trunk/tools/src/odoc/chtml.ml (Note that for current OCaml you need to remove the "{" from the matched strings in html_of_custom_text.) When I developed this, I found the documentation in the OCaml manual as insufficient. You really need to dive into the sources of ocamldoc, especially odoc_html.ml (which is lengthy but easy to get). I guess for the effect you want you have to override create_fully_qualified_{module_}idents_links. The location of a definition in the source code seems to be in deed available, in the m_loc.loc_impl values that are stored with the records for the various syntactic elements. Don't know whether it is easy to do, though. Gerd > > Xavier Clerc has some experience tuning ocamldoc ( > http://argot.x9c.fr/ ), maybe he could comment on the feasibility of > this. You could ask on the caml-list, maybe cc-ing him. If you wished > to have a try at it directly, looking at how Argot is implemented > would be a good source of inspiration. > > (There used to be a custom documentation generator for Batteries, but > afaik. we mostly ditched it because, while it was nice, it made > documentation generation time impossibly slow...) > > On Wed, Feb 15, 2012 at 6:01 AM, Francois Berenger > wrote: >> Hello, >> >> It would be really cool when while looking at the HTML doc >> it would be possible to click somewhere so that the implementation >> code unrolls under the doc text. >> >> Because sometimes the text is not explicit enough, >> some other times there is no text. >> >> Hoogle has such feature and it was pretty useful when >> I was coding in Haskell (maybe especially useful >> because I was a beginner in that language), for example: >> >> http://www.haskell.org/hoogle/?hoogle=map >> >> Just click on map to have a look at the corresponding implementation. >> >> Regards, >> F. >> >> >> _______________________________________________ >> Batteries-devel mailing list >> Batteries-devel@lists.forge.ocamlcore.org >> https://lists.forge.ocamlcore.org/cgi-bin/listinfo/batteries-devel > > -- > 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 > > > -- Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you.