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 @@ -455,6 +455,8 @@ let from_identifier ~stop_before = function
455
455
Ok (from_path @@ Path. from_identifier p)
456
456
| p -> Anchor. from_identifier p
457
457
458
+ let from_asset_identifier p = from_path @@ Path. from_identifier p
459
+
458
460
let kind id =
459
461
match Anchor. from_identifier id with
460
462
| 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 @@ -1073,6 +1073,8 @@ module Reference = struct
1073
1073
end
1074
1074
1075
1075
module Asset = struct
1076
+ let identifier = function `Identifier id -> id
1077
+
1076
1078
type t = Paths_types.Resolved_reference .asset
1077
1079
end
1078
1080
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