this repo has no description
1(*
2 * Copyright (c) 2014 Leo White <leo@lpw25.net>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 *)
16
17open Odoc_utils
18open Odoc_model
19open Odoc_model.Paths
20
21type package_spec = { package : string; output : Fpath.t }
22type parent_spec = {
23 parent : string option;
24 children : string list;
25 output : Fpath.t;
26}
27
28type parent_id_spec = { parent_id : string; output_dir : string }
29
30type cli_spec =
31 | CliNoParent of Fpath.t
32 | CliPackage of package_spec
33 | CliParent of parent_spec
34 | CliParentId of parent_id_spec
35
36val name_of_output : prefix:string -> Fs.File.t -> string
37(** Compute the name of the page from the output file. Prefix is the prefix to
38 remove from the filename. *)
39
40val resolve_imports :
41 Resolver.t ->
42 Lang.Compilation_unit.Import.t list ->
43 Lang.Compilation_unit.Import.t list
44
45val resolve_parent_page :
46 Resolver.t ->
47 string ->
48 (Identifier.ContainerPage.t * Lang.Page.child list, [> msg ]) result
49(** Parse and resolve a parent reference. Returns the identifier of the parent
50 and its children as a list of reference. *)
51
52val mk_id : string -> Identifier.ContainerPage.t option
53val path_of_id :
54 string -> Comment.Identifier.Id.container_page option -> Fpath.t
55
56val compile :
57 resolver:Resolver.t ->
58 hidden:bool ->
59 cli_spec:cli_spec ->
60 warnings_options:Odoc_model.Error.warnings_options ->
61 short_title:string option ->
62 Fpath.t ->
63 (unit, [> msg ]) result
64(** Produces .odoc files out of [.cm{i,t,ti}] or .mld files. *)