summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Guesdon <maxence.guesdon@inria.fr>2003-07-09 13:26:29 +0000
committerMaxence Guesdon <maxence.guesdon@inria.fr>2003-07-09 13:26:29 +0000
commit146056f21541f14c32e475d80467d65d055f7da6 (patch)
treecf2d432ec08802f33a8c9bd1432923c72e850213
parentbd5b9550b06b602e5b83810a67768ed624c05073 (diff)
fix ouput of types in html, using <code> or <pre> depending on whether there is a manifest and the type is abstract or not
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--ocamldoc/odoc_html.ml15
1 files changed, 12 insertions, 3 deletions
diff --git a/ocamldoc/odoc_html.ml b/ocamldoc/odoc_html.ml
index 8b1480b54..49006d596 100644
--- a/ocamldoc/odoc_html.ml
+++ b/ocamldoc/odoc_html.ml
@@ -904,7 +904,14 @@ class html =
method html_of_type t =
Odoc_info.reset_type_names ();
let father = Name.father t.ty_name in
- "<pre>"^
+ (match t.ty_manifest, t.ty_kind with
+ None, Type_abstract -> "<pre>"
+ | None, Type_variant _
+ | None, Type_record _ -> "<br><code>"
+ | Some _, Type_abstract -> "<pre>"
+ | Some _, Type_variant _
+ | Some _, Type_record _ -> "<pre>"
+ )^
(self#keyword "type")^" "^
(* html mark *)
"<a name=\""^(Naming.type_target t)^"\"></a>"^
@@ -919,7 +926,8 @@ class html =
Type_abstract -> "</pre>"
| Type_variant (l, priv) ->
"= "^(if priv then "private" else "")^
- "</pre><table class=\"typetable\">\n"^
+ (match t.ty_manifest with None -> "</code>" | Some _ -> "</pre>")^
+ "<table class=\"typetable\">\n"^
(String.concat "\n"
(List.map
(fun constr ->
@@ -963,7 +971,8 @@ class html =
| Type_record (l, priv) ->
"= "^(if priv then "private " else "")^"{"^
- "</pre><table class=\"typetable\">\n"^
+ (match t.ty_manifest with None -> "</code>" | Some _ -> "</pre>")^
+ "<table class=\"typetable\">\n"^
(String.concat "\n"
(List.map
(fun r ->