File tree Expand file tree Collapse file tree 5 files changed +15
-10
lines changed
Expand file tree Collapse file tree 5 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ module Odoc_file = struct
3131
3232 type page = { name : string ; title : Comment .link_content option }
3333
34+
3435 type t =
3536 | Page of page
3637 | Compilation_unit of compilation_unit
3738 | Impl of string
38- | Asset
39+ | Asset of string
3940
4041 let create_unit ~force_hidden name =
4142 let hidden = force_hidden || Names. contains_double_underscore name in
@@ -46,14 +47,13 @@ module Odoc_file = struct
4647 let create_impl name = Impl name
4748
4849 let name = function
49- | Page { name; _ } | Compilation_unit { name; _ } | Impl name -> name
50- | Asset -> failwith " todo"
50+ | Page { name; _ } | Compilation_unit { name; _ } | Impl name | Asset name -> name
5151
5252 let hidden = function
53- | Page _ | Impl _ | Asset -> false
53+ | Page _ | Impl _ | Asset _ -> false
5454 | Compilation_unit m -> m.hidden
5555
56- let asset = Asset
56+ let asset name = Asset name
5757end
5858
5959type t = {
Original file line number Diff line number Diff line change @@ -34,15 +34,15 @@ module Odoc_file : sig
3434 | Page of page
3535 | Compilation_unit of compilation_unit
3636 | Impl of string
37- | Asset
37+ | Asset of string
3838
3939 val create_unit : force_hidden :bool -> string -> t
4040
4141 val create_page : string -> Comment .link_content option -> t
4242
4343 val create_impl : string -> t
4444
45- val asset : t
45+ val asset : string -> t
4646
4747 val name : t -> string
4848
Original file line number Diff line number Diff line change @@ -351,7 +351,12 @@ let compile_asset ~parent_id ~name ~output_dir =
351351 let output = Fs.File. create ~directory ~name in
352352 let digest = Digest. string name in
353353 let root =
354- Root. { id = (id :> Paths.Identifier.OdocId.t ); digest; file = Asset }
354+ Root.
355+ {
356+ id = (id :> Paths.Identifier.OdocId.t );
357+ digest;
358+ file = Odoc_file. asset name;
359+ }
355360 in
356361 let asset = Lang.Asset. { name = id; root } in
357362 Odoc_file. save_asset output ~warnings: [] asset
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ let documents_of_odocl ~warnings_options ~renderer ~extra ~source ~syntax input
9898 | Unit_content odoctree ->
9999 documents_of_unit ~warnings_options ~source ~syntax ~renderer ~extra
100100 ~filename odoctree
101- | Asset_content _ -> failwith " todo "
101+ | Asset_content _ -> Ok []
102102
103103let documents_of_input ~renderer ~extra ~resolver ~warnings_options ~syntax
104104 input =
Original file line number Diff line number Diff line change @@ -638,6 +638,6 @@ let resolve_import t target_name =
638638 match root.Odoc_model.Root. file with
639639 | Compilation_unit _ -> Some root
640640 | Impl _ | Page _ -> loop tl
641- | Asset -> failwith " todo" ))
641+ | Asset _ -> failwith " todo" ))
642642 in
643643 loop (Accessible_paths. find t.ap target_name)
You can’t perform that action at this time.
0 commit comments