Skip to content

Commit a57d068

Browse files
committed
enjoy jbuilding
1 parent ca02207 commit a57d068

14 files changed

+53
-116
lines changed

src/docOckHtml.ml

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/docOckHtml.mli

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/docOckHtmlDocumentation.ml renamed to src/documentation.ml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@ open DocOck
22
open Types
33
open Tyxml.Html
44

5-
module Html_tree = DocOckHtmlHtml_tree
6-
module Markup = DocOckHtmlMarkup
7-
module Url = DocOckHtmlUrl
8-
9-
let html_dot_magic = List.map ~f:(fun x -> tot @@ toelt x)
10-
11-
let rec list_keep_while ~pred = function
12-
| x :: xs when pred x -> x :: list_keep_while ~pred xs
13-
| _ -> []
14-
5+
(* Why is this unused all of the sudden? *)
6+
(*
157
module Html_parser = struct
168
let mk_attr ((_, local), value) = Xml.string_attrib local value
179
@@ -26,6 +18,7 @@ module Html_parser = struct
2618
)
2719
|> tot
2820
end
21+
*)
2922

3023
type kind =
3124
| Phrasing : Html_types.phrasing elt list -> kind
@@ -40,9 +33,9 @@ let to_phrasing : kind -> Html_types.phrasing elt list = function
4033
| Phrasing_without_interactive l -> (l :> Html_types.phrasing elt list)
4134
| Phrasing l -> l
4235
| Newline [] -> []
43-
| Newline l -> invalid_arg "to_phrasing"
44-
| Flow5 l -> invalid_arg "to_phrasing"
45-
| Flow5_without_interactive l -> invalid_arg "to_phrasing"
36+
| Newline _ -> invalid_arg "to_phrasing"
37+
| Flow5 _ -> invalid_arg "to_phrasing"
38+
| Flow5_without_interactive _ -> invalid_arg "to_phrasing"
4639

4740
let to_flow5 : kind -> Html_types.flow5 elt list = function
4841
| Phrasing l -> (l :> Html_types.flow5 elt list)
@@ -59,9 +52,9 @@ let to_flow5_without_interactive
5952
(l :> Html_types.flow5_without_interactive elt list)
6053
| Flow5_without_interactive l -> l
6154
| Newline [] -> []
62-
| Newline l -> invalid_arg "to_flow5_without_interactive"
63-
| Flow5 l -> invalid_arg "to_flow5_without_interactive"
64-
| Phrasing l -> invalid_arg "to_flow5_without_interactive"
55+
| Newline _ -> invalid_arg "to_flow5_without_interactive"
56+
| Flow5 _ -> invalid_arg "to_flow5_without_interactive"
57+
| Phrasing _ -> invalid_arg "to_flow5_without_interactive"
6558

6659
let is_interactive = function
6760
| Phrasing _ -> true
@@ -115,7 +108,7 @@ module Reference = struct
115108
| SubstAlias(_, r) -> render_resolved r
116109
| Module (r, s) -> render_resolved r ^ "." ^ s
117110
| Canonical (_, Reference.Resolved r) -> render_resolved r
118-
| Canonical (p, p') -> render_resolved p
111+
| Canonical (p, _) -> render_resolved p
119112
| ModuleType (r, s) -> render_resolved r ^ "." ^ s
120113
| Type (r, s) -> render_resolved r ^ "." ^ s
121114
| Constructor (r, s) -> render_resolved r ^ "." ^ s
@@ -257,8 +250,8 @@ let paragraphise_without_interactive lst =
257250
| Phrasing_without_interactive l -> [p l]
258251
| Flow5_without_interactive l -> (l :> Html_types.flow5 elt list)
259252
| Newline _ -> []
260-
| Phrasing l -> invalid_arg "paragraphise_without_interactive"
261-
| Flow5 l -> invalid_arg "paragraphise_without_interactive"
253+
| Phrasing _ -> invalid_arg "paragraphise_without_interactive"
254+
| Flow5 _ -> invalid_arg "paragraphise_without_interactive"
262255
)
263256

264257
let make_li_without_interactive = function
@@ -539,7 +532,7 @@ let handle_tags ~get_package tags =
539532
| Canonical _ -> [] (* TODO: display? *)
540533
)
541534
in
542-
let cleaned = List.filter (function [] -> false | _ -> true) raw in
535+
let cleaned = List.filter ~f:(function [] -> false | _ -> true) raw in
543536
match cleaned with
544537
| [] -> []
545538
| lst -> [ ul ~a:[ a_class ["at-tag"] ] (List.map lst ~f:make_li) ]
File renamed without changes.

src/docOckHtmlHtml_tree.ml renamed to src/html_tree.ml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*)
1616

1717
open Tyxml.Html
18-
module Url = DocOckHtmlUrl
1918

2019
type kind = [ `Arg | `Mod | `Mty | `Class | `Cty ]
2120

@@ -56,8 +55,6 @@ module Relative_link = struct
5655
val href : get_package:('a -> string) -> stop_before:bool ->
5756
('a, _) Identifier.t -> string
5857
end = struct
59-
open Identifier
60-
6158
exception Not_linkable
6259

6360
let rec drop_shared_prefix l1 l2 =
@@ -70,7 +67,7 @@ module Relative_link = struct
7067

7168
let href ~get_package ~stop_before id =
7269
match Url.from_identifier ~get_package ~stop_before id with
73-
| Ok { Url. page; anchor } ->
70+
| Ok { Url. page; anchor; _ } ->
7471
let target = List.rev (if !semantic_uris then page else "index.html" :: page) in
7572
let current_loc = List.map ~f:stack_elt_to_path_fragment (stack_to_list path) in
7673
let current_from_common_ancestor, target_from_common_ancestor =
@@ -127,12 +124,12 @@ module Relative_link = struct
127124
| "" -> suffix
128125
| _ -> prefix ^ "." ^ suffix
129126

130-
let rec render_raw : type a. (_, _) Identifier.t -> (_, a, _) Fragment.raw -> string =
127+
let rec _render_raw : type a. (_, _) Identifier.t -> (_, a, _) Fragment.raw -> string =
131128
fun id fragment ->
132129
let open Fragment in
133130
match fragment with
134131
| Resolved rr -> render_resolved id rr
135-
| Dot (prefix, suffix) -> dot (render_raw id prefix) suffix
132+
| Dot (prefix, suffix) -> dot (_render_raw id prefix) suffix
136133

137134
and render_resolved : type a. (_, _) Identifier.t -> (_, a, _) Fragment.Resolved.raw -> string =
138135
fun id fragment ->
@@ -224,7 +221,7 @@ class page_creator ?kind ~path content =
224221
]
225222

226223
method heading : Html_types.h1_content_fun elt list =
227-
DocOckHtmlMarkup.keyword (
224+
Markup.keyword (
228225
match kind with
229226
| None
230227
| Some `Mod -> "Module"
@@ -233,7 +230,7 @@ class page_creator ?kind ~path content =
233230
| Some `Cty -> "Class type"
234231
| Some `Class -> "Class"
235232
) :: pcdata " " ::
236-
[DocOckHtmlMarkup.module_path (List.tl path)]
233+
[Markup.module_path (List.tl path)]
237234

238235
method content : Html_types.div_content_fun elt list =
239236
let up_href =
File renamed without changes.

src/docOckHtmlList_targets.ml renamed to src/list_targets.ml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
*)
1616

1717
open DocOck
18-
open Types
1918
open Paths
2019

21-
open Tyxml.Html
22-
2320
let functor_arg_pos { Types.FunctorArgument.id ; _ } =
2421
match id with
2522
| Identifier.Argument (_, nb, _) -> nb
@@ -32,7 +29,7 @@ let rec unit ~package (t : _ Types.Unit.t) : string list =
3229
let rest =
3330
match t.content with
3431
| Module sign -> signature ~prefix:name sign
35-
| Pack pack -> []
32+
| Pack _ -> []
3633
in
3734
name :: rest
3835

@@ -41,15 +38,15 @@ and signature ~prefix (t : _ Types.Signature.t) =
4138
List.map t ~f:(function
4239
| Types.Signature.Module md -> module_ ~prefix md
4340
| ModuleType mty -> module_type ~prefix mty
44-
| Type td -> []
45-
| TypExt te -> []
46-
| Exception e -> []
47-
| Value v -> []
48-
| External e -> []
49-
| Class c -> []
50-
| ClassType cty -> []
41+
| Type _ -> []
42+
| TypExt _ -> []
43+
| Exception _ -> []
44+
| Value _ -> []
45+
| External _ -> []
46+
| Class _ -> []
47+
| ClassType _ -> []
5148
| Include incl -> include_ ~prefix incl
52-
| Comment (Documentation doc) -> []
49+
| Comment (Documentation _) -> []
5350
| Comment Stop -> []
5451
)
5552
)
File renamed without changes.

src/docOckHtmlMarkup.ml renamed to src/markup.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
*)
1616

1717
open Tyxml.Html
18-
module Url = DocOckHtmlUrl
1918

2019
let keyword keyword = span ~a:[ a_class ["keyword"] ] [ pcdata keyword ]
2120
let module_path ids =
22-
span ~a:[ a_class ["module-path"] ] [pcdata (String.concat "." ids)]
21+
span ~a:[ a_class ["module-path"] ] [pcdata (String.concat ~sep:"." ids)]
2322

2423
module Type = struct
2524
let path p = span ~a:[ a_class ["type-id"] ] p
File renamed without changes.

0 commit comments

Comments
 (0)