diff options
-rw-r--r-- | ocamldoc/odoc_args.ml | 4 | ||||
-rw-r--r-- | ocamldoc/odoc_args.mli | 6 | ||||
-rw-r--r-- | ocamldoc/odoc_dot.ml | 6 | ||||
-rw-r--r-- | ocamldoc/odoc_latex.ml | 4 | ||||
-rw-r--r-- | ocamldoc/odoc_messages.ml | 13 | ||||
-rw-r--r-- | ocamldoc/odoc_texi.ml | 4 |
6 files changed, 19 insertions, 18 deletions
diff --git a/ocamldoc/odoc_args.ml b/ocamldoc/odoc_args.ml index 4d6cf0f209..1aa0e432d4 100644 --- a/ocamldoc/odoc_args.ml +++ b/ocamldoc/odoc_args.ml @@ -24,7 +24,7 @@ let doc_generator = ref (None : doc_generator option) let merge_options = ref ([] : Odoc_types.merge_option list) -let dot_file = ref Odoc_messages.default_dot_file +let out_file = ref Odoc_messages.default_out_file let dot_include_all = ref false @@ -184,6 +184,7 @@ let options = ref [ "-rectypes", Arg.Set recursive_types, Odoc_messages.rectypes ; "-nolabels", Arg.Unit (fun () -> classic := true), Odoc_messages.nolabels ; "-warn-error", Arg.Set Odoc_global.warn_error, Odoc_messages.werr ; + "-o", Arg.String (fun s -> out_file := s), Odoc_messages.out_file ; "-d", Arg.String (fun s -> target_dir := s), Odoc_messages.target_dir ; "-sort", Arg.Unit (fun () -> sort_modules := true), Odoc_messages.sort_modules ; "-no-stop", Arg.Set no_stop, Odoc_messages.no_stop ; @@ -226,7 +227,6 @@ let options = ref [ "-esc8", Arg.Set esc_8bits, Odoc_messages.esc_8bits ; (* dot only options *) - "-dot-file", Arg.String (fun s -> dot_file := s), Odoc_messages.dot_file ; "-dot-colors", Arg.String (fun s -> dot_colors := Str.split (Str.regexp_string ",") s), Odoc_messages.dot_colors ; "-dot-include-all", Arg.Set dot_include_all, Odoc_messages.dot_include_all ; "-dot-types", Arg.Set dot_types, Odoc_messages.dot_types ; diff --git a/ocamldoc/odoc_args.mli b/ocamldoc/odoc_args.mli index 843b2d4e9a..e1aee1eab9 100644 --- a/ocamldoc/odoc_args.mli +++ b/ocamldoc/odoc_args.mli @@ -28,6 +28,9 @@ val merge_options : Odoc_types.merge_option list ref (** Classic mode or not. *) val classic : bool ref +(** The file used by the generators outputting only one file. *) +val out_file : string ref + (** The optional file name to dump the collected information into.*) val dump : string option ref @@ -98,9 +101,6 @@ val with_index : bool ref (** The flag which indicates if we must escape accentuated characters (for TeXinfo).*) val esc_8bits : bool ref -(** The file used byt the dot generator. *) -val dot_file : string ref - (** Include all modules or only the ones on the command line, for the dot ouput. *) val dot_include_all : bool ref diff --git a/ocamldoc/odoc_dot.ml b/ocamldoc/odoc_dot.ml index 3fb0dd7281..55a900426f 100644 --- a/ocamldoc/odoc_dot.ml +++ b/ocamldoc/odoc_dot.ml @@ -88,7 +88,7 @@ class dot = method generate_types types = try - let oc = open_out !Odoc_args.dot_file in + let oc = open_out !Odoc_args.out_file in let fmt = F.formatter_of_out_channel oc in F.fprintf fmt "%s" self#header; let graph = Odoc_info.Dep.deps_of_types @@ -106,7 +106,7 @@ class dot = method generate_modules modules_list = try modules <- modules_list ; - let oc = open_out !Odoc_args.dot_file in + let oc = open_out !Odoc_args.out_file in let fmt = F.formatter_of_out_channel oc in F.fprintf fmt "%s" self#header; @@ -121,7 +121,7 @@ class dot = Sys_error s -> raise (Failure s) - (** Generate the dot code in the file {!Odoc_args.dot_file}. *) + (** Generate the dot code in the file {!Odoc_args.out_file}. *) method generate (modules_list : Odoc_info.Module.t_module list) = if !Odoc_args.dot_types then self#generate_types (Odoc_info.Search.types modules_list) diff --git a/ocamldoc/odoc_latex.ml b/ocamldoc/odoc_latex.ml index fe3d0e396d..dd5a8f8494 100644 --- a/ocamldoc/odoc_latex.ml +++ b/ocamldoc/odoc_latex.ml @@ -802,7 +802,7 @@ class latex = (match !Odoc_args.title with None -> "" | Some _ -> "\\maketitle\n")^ (if !Odoc_args.with_toc then "\\tableofcontents\n" else "") - (** Generate the [doc.tex] LaTeX file from a module list. *) + (** Generate the LaTeX file from a module list, in the {!Odoc_args.out_file} file. *) method generate module_list = if !Odoc_args.separate_files then ( @@ -823,7 +823,7 @@ class latex = ); try - let chanout = open_out (Filename.concat !Odoc_args.target_dir "doc.tex") in + let chanout = open_out (Filename.concat !Odoc_args.target_dir !Odoc_args.out_file) in let _ = if !Odoc_args.with_header then output_string chanout self#latex_header else () in List.iter (fun m -> if !Odoc_args.separate_files then diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml index 0d4785273a..1a26e4d00a 100644 --- a/ocamldoc/odoc_messages.ml +++ b/ocamldoc/odoc_messages.ml @@ -32,7 +32,7 @@ let preprocess = "<command> Pipe sources through preprocessor <command>" let load_file = "<file.cm[o|a]> Load file defining a new documentation generator" let nolabels = " Ignore non-optional labels in types" let werr = "Treat ocamldoc warnings as errors" -let target_dir = "<dir> Generate files in directory <dir>, rather than in current directory" +let target_dir = "<dir> Generate files in directory <dir>, rather than in current directory (for man and HTML generators)" let dump = "<file> Dump collected information into <file>" let load = "<file> Load information from <file> ; may be used several times" let css_style = "<file> Use content of <file> as CSS style definition "^html_only @@ -42,11 +42,12 @@ let generate_html = " Generate HTML documentation" let generate_latex = " Generate LaTeX documentation" let generate_texinfo = " Generate TeXinfo documentation" let generate_man = " Generate man pages" - let generate_dot = " Generate dot code of top modules dependencies" -let default_dot_file = "dep.dot" -let dot_file = "<file> Set the file to use to output the dot code "^ - "(default is "^default_dot_file^")" + +let default_out_file = "ocamldoc.out" +let out_file = "<file> Set the ouput file name, used by texi, latex and dot generators "^ + "(default is "^default_out_file^")" + let dot_include_all = " include all modules in the dot output,\n"^ " not only the modules given on the command line" let dot_types = " generate dependency graph for types instead of modules" @@ -91,7 +92,7 @@ let merge_custom = ('c', "merge custom @-tags") let merge_all = ('A', "merge all") let no_index = " Do not build index for Info files"^texi_only -let esc_8bits = " scape accentuated characters in Info files"^texi_only^"\n" +let esc_8bits = " Escape accentuated characters in Info files"^texi_only^"\n" let options_can_be = " <options> can be one or more of the following characters:" let string_of_options_list l = diff --git a/ocamldoc/odoc_texi.ml b/ocamldoc/odoc_texi.ml index eac409ddcf..8117e33b43 100644 --- a/ocamldoc/odoc_texi.ml +++ b/ocamldoc/odoc_texi.ml @@ -1000,11 +1000,11 @@ class texi = - (** Generate the [doc.texi] Texinfo file from a module list. *) + (** Generate the Texinfo file from a module list, in the {!Odoc_args.out_file} file. *) method generate module_list = try let chanout = open_out - (Filename.concat !Odoc_args.target_dir "doc.texi") in + (Filename.concat !Odoc_args.target_dir !Odoc_args.out_file) in if !Odoc_args.with_header then self#generate_texi_header chanout module_list ; List.iter |