Fix: preserve ocamldoc module info logic

master
octachron 2016-08-31 13:13:41 +02:00
parent 9cca221a07
commit 55282ebf5f
4 changed files with 15 additions and 27 deletions

View File

@ -231,10 +231,7 @@ let process_file sourcefile =
raise (Failure (Odoc_messages.text_parse_error l c s))
in
let m_info =
(* use the first sentence of the text as a short description for
the whole file *)
let i_desc = Some (Odoc_misc.first_sentence_of_text txt) in
Some Odoc_types.{dummy_info with i_desc} in
Some Odoc_types.{dummy_info with i_desc= Some txt } in
let m =
{
Odoc_module.m_name = mod_name ;
@ -242,8 +239,7 @@ let process_file sourcefile =
Odoc_module.m_info;
Odoc_module.m_is_interface = true ;
Odoc_module.m_file = file ;
Odoc_module.m_kind = Odoc_module.Module_struct
[Odoc_module.Element_module_comment txt] ;
Odoc_module.m_kind = Odoc_module.Module_struct [] ;
Odoc_module.m_loc =
{ Odoc_types.loc_impl = None ;
Odoc_types.loc_inter = Some (Location.in_file file) } ;

View File

@ -2560,7 +2560,10 @@ class html =
);
bs b "</h1>\n";
if not modu.m_text_only then self#html_of_module b ~with_link: false modu;
if not modu.m_text_only then
self#html_of_module b ~with_link: false modu
else
self#html_of_info ~indent:false b modu.m_info;
(* parameters for functors *)
self#html_of_module_parameter_list b

View File

@ -1209,20 +1209,13 @@ class latex =
method generate_for_top_module fmt m =
let (first_t, rest_t) = self#first_and_rest_of_info m.m_info in
let text =
if m.m_text_only then
[ Title (1, None, [Raw m.m_name] @
(match first_t with
[] -> []
| t -> (Raw " : ") :: t)
) ;
]
else
[ Title (1, None,
[ Raw (Odoc_messages.modul^" ") ; Code m.m_name ] @
(match first_t with
[] -> []
| t -> (Raw " : ") :: t)) ;
]
let title =
if m.m_text_only then [Raw m.m_name]
else [ Raw (Odoc_messages.modul^" ") ; Code m.m_name ] in
let subtitle = match first_t with
| [] -> []
| t -> (Raw " : ") :: t in
[ Title (1, None, title @ subtitle ) ]
in
self#latex_of_text fmt text;
self#latex_for_module_label fmt m;

View File

@ -12,14 +12,10 @@
Short global description in text mode
This file tests that documentation in text mode are given
a short description in the global description of modules.
\end{document}