File tree Expand file tree Collapse file tree 5 files changed +11
-8
lines changed Expand file tree Collapse file tree 5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -290,15 +290,10 @@ let rec nestable_block_element :
290
290
match href with
291
291
| `Reference (`Resolved r ) -> (
292
292
let id =
293
- Odoc_model.Paths.Reference.Resolved. (identifier (r :> t ))
293
+ Odoc_model.Paths.Reference.Resolved.Asset. (identifier (r :> t ))
294
294
in
295
- match Url. from_identifier ~stop_before: false id with
296
- | Ok url -> Target. Internal (Resolved url)
297
- | Error exn ->
298
- (* FIXME: better error message *)
299
- Printf. eprintf " Id.href failed: %S\n %!"
300
- (Url.Error. to_string exn );
301
- Internal Unresolved )
295
+ match Url. from_asset_identifier id with
296
+ | url -> Target. Internal (Resolved url))
302
297
| `Reference _ -> Internal Unresolved
303
298
| `Link href -> External href
304
299
in
Original file line number Diff line number Diff line change @@ -449,6 +449,8 @@ let from_identifier ~stop_before = function
449
449
Ok (from_path @@ Path. from_identifier p)
450
450
| p -> Anchor. from_identifier p
451
451
452
+ let from_asset_identifier p = from_path @@ Path. from_identifier p
453
+
452
454
let kind id =
453
455
match Anchor. from_identifier id with
454
456
| Error e -> failwith (Error. to_string e)
Original file line number Diff line number Diff line change @@ -108,6 +108,8 @@ val from_path : Path.t -> t
108
108
109
109
val from_identifier : stop_before :bool -> Identifier .t -> (t , Error .t ) result
110
110
111
+ val from_asset_identifier : Identifier.AssetFile .t -> t
112
+
111
113
val kind : Identifier .t -> kind
112
114
113
115
val render_path : Odoc_model.Paths.Path .t -> string
Original file line number Diff line number Diff line change @@ -1066,6 +1066,8 @@ module Reference = struct
1066
1066
end
1067
1067
1068
1068
module Asset = struct
1069
+ let identifier = function `Identifier id -> id
1070
+
1069
1071
type t = Paths_types.Resolved_reference .asset
1070
1072
end
1071
1073
end
Original file line number Diff line number Diff line change @@ -550,6 +550,8 @@ module rec Reference : sig
550
550
551
551
module Asset : sig
552
552
type t = Paths_types.Resolved_reference .asset
553
+
554
+ val identifier : t -> Identifier.AssetFile .t
553
555
end
554
556
555
557
type t = Paths_types.Resolved_reference .any
You can’t perform that action at this time.
0 commit comments