Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 62 lines (52 sloc) 2.658 kB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
513a9df @Aqua-Ye [doc] tools: changed files headers to MIT license
Aqua-Ye authored
4 This file is part of Opa.
fccc685 Initial open-source release
MLstate authored
5
513a9df @Aqua-Ye [doc] tools: changed files headers to MIT license
Aqua-Ye authored
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
fccc685 Initial open-source release
MLstate authored
7
513a9df @Aqua-Ye [doc] tools: changed files headers to MIT license
Aqua-Ye authored
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
fccc685 Initial open-source release
MLstate authored
9
513a9df @Aqua-Ye [doc] tools: changed files headers to MIT license
Aqua-Ye authored
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
fccc685 Initial open-source release
MLstate authored
11 *)
12 open Odoc_info
13 open Odoc_html
14 open Module
15
16 (* overring the existing html generator
17 * to be able to say
18 * [@inline doc] in a signature documentation to
19 * tell ocamldoc to inline the signature instead of just
20 * putting a link to it
21 *)
22 class my_gen =
23 object(self)
24 inherit Odoc_html.html
25
26 method html_of_module b ?(info=true) ?complete:(_=true) ?(with_link=true) m =
27 let complete = true in
28 let (html_file, _) = Naming.html_files m.m_name in
29 let father = Name.father m.m_name in
30 bs b "<pre>";
31 bs b ((self#keyword "module")^" ");
32 if with_link then
33 bp b "<a href=\"%s\">%s</a>" html_file (Name.simple m.m_name)
34 else
35 bs b (Name.simple m.m_name);
36 ( match m.m_kind with
37 | Module_functor _ when !Odoc_info.Args.html_short_functors -> ()
38 | _ -> bs b ": "
39 );
40 let modu =
41 match m.m_info with
42 | Some {i_custom=i_custom} when
43 List.exists (function ("inline",[Odoc_info.Raw "doc"]) -> true | _ -> false) i_custom && with_link -> None
44 | _ -> Some m in
45 self#html_of_module_kind b father ?modu m.m_kind;
46 bs b "</pre>";
47 if info then
48 (if complete then
49 self#html_of_info ~indent: false
50 else
51 self#html_of_info_first_sentence
52 ) b m.m_info
53
54 method no_html _ = ""
55
56 initializer
57 tag_functions <- ("inline", self#no_html) :: tag_functions
58 end
59
60 let my_generator = new my_gen
61 let _ = Odoc_args.set_doc_generator (Some (my_generator :> Odoc_args.doc_generator))
Something went wrong with that request. Please try again.