Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove confusing navigation bar from stdlib documentation #10139

Merged
merged 8 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 34 additions & 32 deletions ocamldoc/odoc_html.ml
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ class virtual info =
| Some d ->
bs b "<div class=\"info-deprecated\">\n";
bs b "<span class=\"warning\">";
bs b Odoc_messages.deprecated ;
bs b (Odoc_messages.deprecated^". ");
bs b "</span>" ;
self#html_of_text b d;
bs b "</div>\n"
Expand Down Expand Up @@ -1183,32 +1183,34 @@ class html =
@param post optional name for optional next module/class
@param name name of current module/class *)
method print_navbar b pre post name =
bs b "<div class=\"navbar\">";
(
match pre with
None -> ()
| Some name ->
bp b "<a class=\"pre\" href=\"%s\" title=\"%s\">%s</a>\n"
(fst (Naming.html_files name))
name
Odoc_messages.previous
);
bs b "&nbsp;";
let father = Name.father name in
let href = if father = "" then self#index else fst (Naming.html_files father) in
let father_name = if father = "" then "Index" else father in
bp b "<a class=\"up\" href=\"%s\" title=\"%s\">%s</a>\n" href father_name Odoc_messages.up;
bs b "&nbsp;";
(
match post with
None -> ()
| Some name ->
bp b "<a class=\"post\" href=\"%s\" title=\"%s\">%s</a>\n"
(fst (Naming.html_files name))
name
Odoc_messages.next
);
bs b "</div>\n"
if !show_navbar then begin
bs b "<div class=\"navbar\">";
(
match pre with
None -> ()
| Some name ->
bp b "<a class=\"pre\" href=\"%s\" title=\"%s\">%s</a>\n"
(fst (Naming.html_files name))
name
Odoc_messages.previous
);
bs b "&nbsp;";
let father = Name.father name in
let href = if father = "" then self#index else fst (Naming.html_files father) in
let father_name = if father = "" then "Index" else father in
bp b "<a class=\"up\" href=\"%s\" title=\"%s\">%s</a>\n" href father_name Odoc_messages.up;
bs b "&nbsp;";
(
match post with
None -> ()
| Some name ->
bp b "<a class=\"post\" href=\"%s\" title=\"%s\">%s</a>\n"
(fst (Naming.html_files name))
name
Odoc_messages.next
);
bs b "</div>\n"
end

(** Return html code with the given string in the keyword style.*)
method keyword s =
Expand Down Expand Up @@ -2397,7 +2399,7 @@ class html =
bs b "<html>\n";
self#print_header b (self#inner_title title);
bs b "<body>\n";
if !show_navbar then self#print_navbar b None None "";
self#print_navbar b None None "";
bs b "<h1>";
bs b title;
bs b "</h1>\n" ;
Expand Down Expand Up @@ -2479,7 +2481,7 @@ class html =
~comments: (Class.class_comments cl)
(self#inner_title cl.cl_name);
bs b "<body>\n";
if !show_navbar then self#print_navbar b pre_name post_name cl.cl_name;
self#print_navbar b pre_name post_name cl.cl_name;
bs b "<h1>";
bs b (Odoc_messages.clas^" ");
if cl.cl_virtual then bs b "virtual " ;
Expand Down Expand Up @@ -2527,7 +2529,7 @@ class html =
(self#inner_title clt.clt_name);

bs b "<body>\n";
if !show_navbar then self#print_navbar b pre_name post_name clt.clt_name;
self#print_navbar b pre_name post_name clt.clt_name;
bs b "<h1>";
bs b (Odoc_messages.class_type^" ");
if clt.clt_virtual then bs b "virtual ";
Expand Down Expand Up @@ -2572,7 +2574,7 @@ class html =
~comments: (Module.module_type_comments mt)
(self#inner_title mt.mt_name);
bs b "<body>\n";
if !show_navbar then self#print_navbar b pre_name post_name mt.mt_name;
self#print_navbar b pre_name post_name mt.mt_name;
bp b "<h1>";
bs b (Odoc_messages.module_type^" ");
(
Expand Down Expand Up @@ -2640,7 +2642,7 @@ class html =
~comments: (Module.module_comments modu)
(self#inner_title modu.m_name);
bs b "<body>\n" ;
if !show_navbar then self#print_navbar b pre_name post_name modu.m_name ;
self#print_navbar b pre_name post_name modu.m_name ;
bs b "<h1>";
if modu.m_text_only then
bs b modu.m_name
Expand Down
2 changes: 1 addition & 1 deletion ocamldoc/odoc_man.ml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class virtual info =
| Some d ->
let b = Buffer.create 256 in
bs b ".B \"";
bs b Odoc_messages.deprecated;
bs b (Odoc_messages.deprecated^".");
bs b "\"\n";
self#man_of_text b d;
bs b "\n";
Expand Down
2 changes: 1 addition & 1 deletion ocamldoc/odoc_messages.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ let authors = "Author(s)"
let version = "Version"
let since = "Since"
let before = "Before"
let deprecated = "Deprecated. "
let deprecated = "Deprecated"
let raises = "Raises"
let returns = "Returns"
let inherits = "Inherits"
Expand Down
2 changes: 1 addition & 1 deletion ocamldoc/odoc_misc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ let string_of_info i =
let module M = Odoc_types in
(match i.M.i_deprecated with
None -> ""
| Some d -> Odoc_messages.deprecated^"! "^(string_of_text d)^"\n")^
| Some d -> Odoc_messages.deprecated^".! "^(string_of_text d)^"\n")^
johnwhitington marked this conversation as resolved.
Show resolved Hide resolved
(match i.M.i_desc with
None -> ""
| Some d when d = [Odoc_types.Raw ""] -> ""
Expand Down
2 changes: 1 addition & 1 deletion ocamldoc/odoc_texi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ class texi =
[ ( match info.i_deprecated with
| None -> []
| Some t ->
(Raw (Odoc_messages.deprecated ^ " ")) ::
(Raw (Odoc_messages.deprecated ^ ". ")) ::
(self#fix_linebreaks t)
@ [ Newline ; Newline ] ) ;
self#text_of_desc info.i_desc ;
Expand Down
2 changes: 1 addition & 1 deletion ocamldoc/odoc_to_text.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class virtual info =
let t =
(match info.i_deprecated with
None -> []
| Some t -> ( Italic [Raw (Odoc_messages.deprecated^" ")] ) :: t
| Some t -> ( Italic [Raw (Odoc_messages.deprecated^". ")] ) :: t
) @
(match info.i_desc with
None -> []
Expand Down