summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxence Guesdon <maxence.guesdon@inria.fr>2003-11-27 09:01:17 +0000
committerMaxence Guesdon <maxence.guesdon@inria.fr>2003-11-27 09:01:17 +0000
commit987e9e41eadb0ed9503b9ee6680df77881b96bc0 (patch)
tree7e6d49de86094e5ce984c8820ae29a9eb9d4d231
parent2020ef749fee2425a416a2ed0a8ab2bc9d750c9f (diff)
downloadocaml-987e9e41eadb0ed9503b9ee6680df77881b96bc0.tar.gz
option -intro used in odoc_texi (thanks to Olivier Andrieu)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5980 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--ocamldoc/odoc_messages.ml3
-rw-r--r--ocamldoc/odoc_texi.ml30
2 files changed, 21 insertions, 12 deletions
diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml
index aa5b0c57b5..26cb295961 100644
--- a/ocamldoc/odoc_messages.ml
+++ b/ocamldoc/odoc_messages.ml
@@ -29,6 +29,7 @@ let texi_only = "(TeXinfo only)"
let latex_texi_only = "(LaTeX and TeXinfo only)"
let html_only = "(HTML only)"
let html_latex_only = "(HTML and LaTeX only)"
+let html_latex_texi_only = "(HTML, LaTeX and TeXinfo only)"
let man_only = "(man only)"
let verbose_mode = " verbose mode"
let include_dirs = "<dir> Add <dir> to the list of include directories"
@@ -74,7 +75,7 @@ let man_suffix = "<suffix> use <suffix> for man page files "^
let option_title = "<title> use <title> as title for the generated documentation"
let option_intro =
- "<file> use content of <file> as ocamldoc text to use as introduction "^(html_latex_only)
+ "<file> use content of <file> as ocamldoc text to use as introduction "^(html_latex_texi_only)
let with_parameter_list = " display the complete list of parameters for functions and methods "^html_only
let hide_modules = " <M1,M2.M3,...> Hide the given complete module names in generated doc"
let no_header = " Suppress header in generated documentation "^latex_texi_only
diff --git a/ocamldoc/odoc_texi.ml b/ocamldoc/odoc_texi.ml
index 96a4ea5e4b..8090a2b3c4 100644
--- a/ocamldoc/odoc_texi.ml
+++ b/ocamldoc/odoc_texi.ml
@@ -1016,7 +1016,7 @@ class texi =
- (** Writes the header of the TeX document. *)
+ (** Writes the header of the TeXinfo document. *)
method generate_texi_header chan texi_filename m_list =
let title = match !Args.title with
| None -> ""
@@ -1068,14 +1068,22 @@ class texi =
"@node Top, , , (dir)" ;
"@top "^ title ; ]
] ) ;
- if title <> ""
- then begin
- puts_nl chan "@ifinfo" ;
- puts_nl chan ("Documentation for " ^ title) ;
- puts_nl chan "@end ifinfo"
- end
- else puts_nl chan "@c no title given" ;
-
+
+ (* insert the intro file *)
+ begin
+ match !Odoc_info.Args.intro_file with
+ | None when title <> "" ->
+ puts_nl chan "@ifinfo" ;
+ puts_nl chan ("Documentation for " ^ title) ;
+ puts_nl chan "@end ifinfo"
+ | None ->
+ puts_nl chan "@c no title given"
+ | Some f ->
+ nl chan ;
+ puts_nl chan
+ (self#texi_of_info (Some (Odoc_info.info_of_comment_file f)))
+ end ;
+
(* write a top menu *)
Texi.generate_menu chan
((List.map (fun m -> `Module m) m_list) @
@@ -1093,7 +1101,7 @@ class texi =
else [] ))
- (** Writes the header of the TeX document. *)
+ (** Writes the trailer of the TeXinfo document. *)
method generate_texi_trailer chan =
nl chan ;
if !Args.with_index
@@ -1134,7 +1142,7 @@ class texi =
List.iter self#scan_for_index_in_class c_ele
method scan_for_index_in_mod = function
- (* no recusrion *)
+ (* no recursion *)
| Element_value _ -> self#do_index `Value
| Element_exception _ -> self#do_index `Exception
| Element_type _ -> self#do_index `Type