1 (***********************************************************************)
4 (* Maxence Guesdon, projet Cristal, INRIA Rocquencourt *)
6 (* Copyright 2001 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
10 (***********************************************************************)
14 (** The messages of the application. *)
17 let software = "OCamldoc"
18 let config_version = Config.version
19 let magic = config_version^
""
20 let message_version = software^
" "^
config_version
22 (** Messages for command line *)
24 let usage = "Usage : "^
(Sys.argv
.(0))^
" [options] <files>\n"
25 let options_are = "Options are :"
26 let option_version = "\tPrint version and exit"
27 let bytecode_only = "(bytecode version only)"
28 let latex_only = "(LaTeX only)"
29 let texi_only = "(TeXinfo only)"
30 let latex_texi_only = "(LaTeX and TeXinfo only)"
31 let html_only = "(HTML only)"
32 let html_latex_only = "(HTML and LaTeX only)"
33 let html_latex_texi_only = "(HTML, LaTeX and TeXinfo only)"
34 let man_only = "(man only)"
35 let verbose_mode = "\t\tverbose mode"
36 let include_dirs = "<dir>\tAdd <dir> to the list of include directories"
37 let rectypes = "\tAllow arbitrary recursive types"
38 let preprocess = "<command>\tPipe sources through preprocessor <command>"
39 let option_impl ="<file>\tConsider <file> as a .ml file"
40 let option_intf ="<file>\tConsider <file> as a .mli file"
41 let option_text ="<file>\tConsider <file> as a .txt file"
42 let display_custom_generators_dir = "\tDisplay custom generators standard directory and exit"
43 let add_load_dir = "<dir>\tAdd the given directory to the search path for custom\n"^
44 "\t\tgenerators "^
bytecode_only
45 let load_file = "<file.cm[o|a]>\n\t\tLoad file defining a new documentation generator\n\t\t"^
bytecode_only
46 let nolabels = "\tIgnore non-optional labels in types"
47 let werr = "\tTreat ocamldoc warnings as errors"
48 let hide_warnings = "\n\t\tdo not print ocamldoc warnings"
49 let target_dir = "<dir>\tGenerate files in directory <dir>, rather than in current\n"^
50 "\t\tdirectory (for man and HTML generators)"
51 let dump = "<file>\tDump collected information into <file>"
52 let load = "<file>\tLoad information from <file> ; may be used several times"
53 let css_style = "<file>\n\t\tUse content of <file> as CSS style definition "^
html_only
54 let index_only = "\tGenerate index files only "^
html_only
55 let colorize_code = "\n\t\tColorize code even in documentation pages "^
html_only
56 let html_short_functors = "\n\t\tUse short form to display functor types "^
html_only
57 let generate_html = "\tGenerate HTML documentation"
58 let generate_latex = "\tGenerate LaTeX documentation"
59 let generate_texinfo = "\tGenerate TeXinfo documentation"
60 let generate_man = "\t\tGenerate man pages"
61 let generate_dot = "\t\tGenerate dot code of top modules dependencies"
63 let option_not_in_native_code op
= "Option "^op^
" not available in native code version."
65 let default_out_file = "ocamldoc.out"
67 "<file>\tSet the ouput file name, used by texi, latex and dot generators\n"^
68 "\t\t(default is "^
default_out_file^
")\n"^
69 "\t\tor the prefix of index files for the HTML generator\n"^
70 "\t\t(default is index)"
73 "\n\t\tInclude all modules in the dot output, not only the\n"^
74 "\t\tmodules given on the command line"
75 let dot_types = "\tGenerate dependency graph for types instead of modules"
76 let default_dot_colors =
77 [ [ "darkturquoise" ; "darkgoldenrod2" ; "cyan" ; "green" ; ] ;
78 [ "magenta" ; "yellow" ; "burlywood1" ; "aquamarine" ; "floralwhite" ; "lightpink" ] ;
79 [ "lightblue" ; "mediumturquoise" ; "salmon" ; "slategray3"] ;
83 "<c1,c2,...,cn>\n\t\tUse colors c1,c1,...,cn in the dot output\n"^
84 "\t\t(default list is "^
85 (String.concat
",\n\t\t" (List.map
(String.concat
",") default_dot_colors))^
")"
88 "\tPerform a transitive reduction on the selected dependency graph\n"^
89 "\t\tbefore the dot output"
91 let man_mini = "\tGenerate man pages only for modules, module types, classes\n"^
92 "\t\tand class types "^
man_only
93 let default_man_section = "3"
94 let man_section = "<section>\n\t\tUse <section> in man page files "^
95 "(default is "^
default_man_section^
") "^
man_only^
"\n"
97 let default_man_suffix = default_man_section^
"o"
98 let man_suffix = "<suffix>\n\t\tUse <suffix> for man page files "^
99 "(default is "^
default_man_suffix^
") "^
man_only^
"\n"
101 let option_title = "<title>\tUse <title> as title for the generated documentation"
103 "<file>\tUse content of <file> as ocamldoc text to use as introduction\n"^
104 "\t\t"^
(html_latex_texi_only)
105 let with_parameter_list = "\tDisplay the complete list of parameters for functions and\n"^
106 "\t\tmethods "^
html_only
107 let hide_modules = "<M1,M2.M3,...>\n\t\tHide the given complete module names in generated doc"
108 let no_header = "\tSuppress header in generated documentation\n\t\t"^
latex_texi_only
109 let no_trailer = "\tSuppress trailer in generated documentation\n\t\t"^
latex_texi_only
110 let separate_files = "\tGenerate one file per toplevel module "^
latex_only
111 let latex_title ref_titles
=
112 "n,style\n\t\tAssociate {n } to the given sectionning style\n"^
113 "\t\t(e.g. 'section') in the latex output "^
latex_only^
"\n"^
114 "\t\tDefault sectionning is:\n\t\t"^
115 (String.concat
"\n\t\t"
116 (List.map
(fun (n
,t
) -> Printf.sprintf
" %d -> %s" n t
) !ref_titles
))
118 let default_latex_value_prefix = "val:"
119 let latex_value_prefix =
120 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of values.\n"^
121 "\t\t(default is \""^
default_latex_value_prefix^
"\")"
123 let default_latex_type_prefix = "type:"
124 let latex_type_prefix =
125 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of types.\n"^
126 "\t\t(default is \""^
default_latex_type_prefix^
"\")"
128 let default_latex_exception_prefix = "exception:"
129 let latex_exception_prefix =
130 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of exceptions.\n"^
131 "\t\t(default is \""^
default_latex_exception_prefix^
"\")"
133 let default_latex_module_prefix = "module:"
134 let latex_module_prefix =
135 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of modules.\n"^
136 "\t\t(default is \""^
default_latex_module_prefix^
"\")"
138 let default_latex_module_type_prefix = "moduletype:"
139 let latex_module_type_prefix =
140 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of module types.\n"^
141 "\t\t(default is \""^
default_latex_module_type_prefix^
"\")"
143 let default_latex_class_prefix = "class:"
144 let latex_class_prefix =
145 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of classes.\n"^
146 "\t\t(default is \""^
default_latex_class_prefix^
"\")"
148 let default_latex_class_type_prefix = "classtype:"
149 let latex_class_type_prefix =
150 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of class types.\n"^
151 "\t\t(default is \""^
default_latex_class_type_prefix^
"\")"
153 let default_latex_attribute_prefix = "val:"
154 let latex_attribute_prefix =
155 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of attributes.\n"^
156 "\t\t(default is \""^
default_latex_attribute_prefix^
"\")"
158 let default_latex_method_prefix = "method:"
159 let latex_method_prefix =
160 "<string>\n\t\tUse <string> as prefix for the LaTeX labels of methods.\n"^
161 "\t\t(default is \""^
default_latex_method_prefix^
"\")"
163 let no_toc = "\tDo not generate table of contents "^
latex_only
164 let sort_modules = "\tSort the list of top modules before generating the documentation"
165 let no_stop = "\tDo not stop at (**/**) comments"
166 let no_custom_tags = "\n\t\tDo not allow custom @-tags"
167 let remove_stars = "\tRemove beginning blanks of comment lines, until the first '*'"
168 let keep_code = "\tAlways keep code when available"
169 let inverse_merge_ml_mli = "\n\t\tInverse implementations and interfaces when merging"
170 let merge_description = ('d'
, "merge description")
171 let merge_author = ('a'
, "merge @author")
172 let merge_version = ('v'
, "merge @version")
173 let merge_see = ('l'
, "merge @see")
174 let merge_since = ('s'
, "merge @since")
175 let merge_deprecated = ('o'
, "merge @deprecated")
176 let merge_param = ('p'
, "merge @param")
177 let merge_raised_exception = ('e'
, "merge @raise")
178 let merge_return_value = ('r'
, "merge @return")
179 let merge_custom = ('c'
, "merge custom @-tags")
180 let merge_all = ('A'
, "merge all")
182 let no_index = "\tDo not build index for Info files "^
texi_only
183 let esc_8bits = "\tEscape accentuated characters in Info files "^
texi_only
184 let info_section = "Specify section of Info directory "^
texi_only
185 let info_entry = "\tSpecify Info directory entry "^
texi_only
187 let options_can_be = "<options> can be one or more of the following characters:"
188 let string_of_options_list l
=
189 List.fold_left
(fun acc
-> fun (c
, m
) -> acc^
"\n\t\t"^
(String.make
1 c
)^
" "^m
)
194 "<options>\tspecify merge options between .mli and .ml\n\t\t"^
196 (string_of_options_list
197 [ merge_description ;
204 merge_raised_exception ;
211 (** Error and warning messages *)
213 let warning = "Warning"
215 if !Odoc_config.print_warnings
then prerr_endline
(warning^
": "^s
);
216 if !Odoc_global.warn_error
then incr
Odoc_global.errors
218 let bad_magic_number =
219 "Bad magic number for this ocamldoc dump!\n"^
220 "This dump was not created by this version of OCamldoc."
222 let not_a_module_name s
= s^
" is not a valid module name"
223 let load_file_error f e
= "Error while loading file "^f^
":\n"^e
224 let wrong_format s
= "Wrong format for \""^s^
"\""
225 let errors_occured n
= (string_of_int n
)^
" error(s) encountered"
226 let parse_error = "Parse error"
227 let text_parse_error l c s
=
228 let lines = Str.split
(Str.regexp_string
"\n") s
in
229 "Syntax error in text:\n"^s^
"\n"^
230 "line "^
(string_of_int l
)^
", character "^
(string_of_int c
)^
":\n"^
231 (List.nth
lines l
)^
"\n"^
232 (String.make c ' '
)^
"^"
234 let file_not_found_in_paths paths name
=
235 Printf.sprintf
"No file %s found in the load paths: \n%s"
237 (String.concat
"\n" paths
)
239 let tag_not_handled tag
= "Tag @"^tag^
" not handled by this generator"
240 let bad_tree = "Incorrect tree structure."
241 let not_a_valid_tag s
= s^
" is not a valid tag."
242 let fun_without_param f
= "Function "^f^
" has no parameter.";;
243 let method_without_param f
= "Méthode "^f^
" has no parameter.";;
244 let anonymous_parameters f
= "Function "^f^
" has anonymous parameters."
245 let function_colon f
= "Function "^f^
": "
246 let implicit_match_in_parameter = "Parameters contain implicit pattern matching."
247 let unknown_extension f
= "Unknown extension for file "^f^
"."
248 let two_implementations name
= "There are two implementations of module "^name^
"."
249 let two_interfaces name
= "There are two interfaces of module "^name^
"."
250 let too_many_module_objects name
= "There are two many interfaces/implementation of module "^name^
"."
251 let exception_not_found_in_implementation exc m
= "Exception "^exc^
" was not found in implementation of module "^m^
"."
252 let type_not_found_in_implementation exc m
= "Type "^exc^
" was not found in implementation of module "^m^
"."
253 let module_not_found_in_implementation m m2
= "Module "^m^
" was not found in implementation of module "^m2^
"."
254 let value_not_found_in_implementation v m
= "Value "^v^
" was not found in implementation of module "^m^
"."
255 let class_not_found_in_implementation c m
= "Class "^c^
" was not found in implementation of module "^m^
"."
256 let attribute_not_found_in_implementation a c
= "Attribute "^a^
" was not found in implementation of class "^c^
"."
257 let method_not_found_in_implementation m c
= "Method "^m^
" was not found in implementation of class "^c^
"."
258 let different_types t
= "Definition of type "^t^
" doesn't match from interface to implementation."
259 let attribute_type_not_found cl att
= "The type of the attribute "^att^
" could not be found in the signature of class "^cl^
"."
260 let method_type_not_found cl met
= "The type of the method "^met^
" could not be found in the signature of class "^cl^
"."
261 let module_not_found m m2
= "The module "^m2^
" could not be found in the signature of module "^m^
"."
262 let module_type_not_found m mt
= "The module type "^mt^
" could not be found in the signature of module "^m^
"."
263 let value_not_found m v
= "The value "^v^
" could not be found in the signature of module "^m^
"."
264 let exception_not_found m e
= "The exception "^e^
" could not be found in the signature of module "^m^
"."
265 let type_not_found m t
= "The type "^t^
" could not be found in the signature of module "^m^
"."
266 let class_not_found m c
= "The class "^c^
" could not be found in the signature of module "^m^
"."
267 let class_type_not_found m c
= "The class type "^c^
" could not be found in the signature of module "^m^
"."
268 let type_not_found_in_typedtree t
= "Type "^t^
" was not found in typed tree."
269 let exception_not_found_in_typedtree e
= "Exception "^e^
" was not found in typed tree."
270 let module_type_not_found_in_typedtree mt
= "Module type "^mt^
" was not found in typed tree."
271 let module_not_found_in_typedtree m
= "Module "^m^
" was not found in typed tree."
272 let class_not_found_in_typedtree c
= "Class "^c^
" was not found in typed tree."
273 let class_type_not_found_in_typedtree ct
= "Class type "^ct^
" was not found in typed tree."
274 let inherit_classexp_not_found_in_typedtree n
= "Inheritance class expression number "^
(string_of_int n
)^
" was not found in typed tree."
275 let attribute_not_found_in_typedtree att
= "Class attribute "^att^
" was not found in typed tree."
276 let method_not_found_in_typedtree met
= "Class method "^met^
" was not found in typed tree."
277 let misplaced_comment file pos
=
278 Printf.sprintf
"Misplaced special comment in file %s, character %d." file pos
280 let cross_module_not_found n
= "Module "^n^
" not found"
281 let cross_module_type_not_found n
= "Module type "^n^
" not found"
282 let cross_module_or_module_type_not_found n
= "Module or module type "^n^
" not found"
283 let cross_class_not_found n
= "Class "^n^
" not found"
284 let cross_class_type_not_found n
= "class type "^n^
" not found"
285 let cross_class_or_class_type_not_found n
= "Class or class type "^n^
" not found"
286 let cross_exception_not_found n
= "Exception "^n^
" not found"
287 let cross_element_not_found n
= "Element "^n^
" not found"
288 let cross_method_not_found n
= "Method "^n^
" not found"
289 let cross_attribute_not_found n
= "Attribute "^n^
" not found"
290 let cross_section_not_found n
= "Section "^n^
" not found"
291 let cross_value_not_found n
= "Value "^n^
" not found"
292 let cross_type_not_found n
= "Type "^n^
" not found"
294 let object_end = "object ... end"
295 let struct_end = "struct ... end"
296 let sig_end = "sig ... end"
298 (** Messages for verbose mode. *)
300 let analysing f
= "Analysing file "^f^
"..."
301 let merging = "Merging..."
302 let cross_referencing = "Cross referencing..."
303 let generating_doc = "Generating documentation..."
304 let loading f
= "Loading "^f^
"..."
305 let file_generated f
= "File "^f^
" generated."
306 let file_exists_dont_generate f
=
307 "File "^f^
" exists, we don't generate it."
309 (** Messages for documentation generation.*)
312 let modules = "Modules"
313 let functors = "Functors"
314 let values = "Simple values"
316 let exceptions = "Exceptions"
317 let record = "Record"
318 let variant = "Variant"
319 let mutab = "mutable"
320 let functions = "Functions"
321 let parameters = "Parameters"
322 let abstract = "Abstract"
323 let functo = "Functor"
325 let classes = "Classes"
326 let attributes = "Attributes"
327 let methods = "Methods"
328 let authors = "Author(s)"
329 let version = "Version"
331 let deprecated = "Deprecated."
332 let raises = "Raises"
333 let returns = "Returns"
334 let inherits = "Inherits"
335 let inheritance = "Inheritance"
336 let privat = "private"
337 let module_type = "Module type"
338 let class_type = "Class type"
339 let description = "Description"
340 let interface = "Interface"
341 let type_parameters = "Type parameters"
342 let class_types = "Class types"
343 let module_types = "Module types"
344 let see_also = "See also"
345 let documentation = "Documentation"
346 let index_of = "Index of"
348 let index_of_values = index_of^
" values"
349 let index_of_exceptions = index_of^
" exceptions"
350 let index_of_types = index_of^
" types"
351 let index_of_attributes = index_of^
" class attributes"
352 let index_of_methods = index_of^
" class methods"
353 let index_of_classes = index_of^
" classes"
354 let index_of_class_types = index_of^
" class types"
355 let index_of_modules = index_of^
" modules"
356 let index_of_module_types = index_of^
" module types"
357 let previous = "Previous"