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 @@ -456,6 +456,8 @@ let from_identifier ~stop_before = function
456
456
Ok (from_path @@ Path. from_identifier p)
457
457
| p -> Anchor. from_identifier p
458
458
459
+ let from_asset_identifier p = from_path @@ Path. from_identifier p
460
+
459
461
let kind id =
460
462
match Anchor. from_identifier id with
461
463
| Error e -> failwith (Error. to_string e)
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ val from_path : Path.t -> t
109
109
110
110
val from_identifier : stop_before :bool -> Identifier .t -> (t , Error .t ) result
111
111
112
+ val from_asset_identifier : Identifier.AssetFile .t -> t
113
+
112
114
val kind : Identifier .t -> kind
113
115
114
116
val render_path : Odoc_model.Paths.Path .t -> string
Original file line number Diff line number Diff line change @@ -1093,6 +1093,8 @@ module Reference = struct
1093
1093
end
1094
1094
1095
1095
module Asset = struct
1096
+ let identifier = function `Identifier id -> id
1097
+
1096
1098
type t = Paths_types.Resolved_reference .asset
1097
1099
end
1098
1100
end
Original file line number Diff line number Diff line change @@ -553,6 +553,8 @@ module rec Reference : sig
553
553
554
554
module Asset : sig
555
555
type t = Paths_types.Resolved_reference .asset
556
+
557
+ val identifier : t -> Identifier.AssetFile .t
556
558
end
557
559
558
560
type t = Paths_types.Resolved_reference .any
You can’t perform that action at this time.
0 commit comments