@@ -56,25 +56,29 @@ let minor v =
56
56
| _ -> invalid_arg (v ^ " : invalid version" )
57
57
58
58
let patch v =
59
- match String. split_on_char '.' v with
60
- | x :: y :: z :: _ -> x ^ " ." ^ y ^ " ." ^ z
61
- | x :: y :: [] ->
62
- (match String. split_on_char '+' y with
63
- | [] -> assert false
64
- | [y] -> x ^ " ." ^ y
65
- | y :: _ -> x ^ " ." ^ y)
66
- | _ -> invalid_arg (v ^ " : invalid version" )
59
+ let pre, version =
60
+ match String. split_on_char '.' v with
61
+ | x :: y :: z :: _ -> false , x ^ " ." ^ y ^ " ." ^ z
62
+ | x :: y :: [] ->
63
+ (match String. split_on_char '+' y with
64
+ | [] -> assert false
65
+ | [y] -> false , x ^ " ." ^ y
66
+ | y :: _ -> true , x ^ " ." ^ y)
67
+ | _ -> invalid_arg (v ^ " : invalid version" )
68
+ in
69
+ if pre then " v" ^ version
70
+ else " V" ^ version
67
71
68
72
let v2 = " https://v2.ocaml.org"
69
- let manual_with_version v = " /doc/V " ^ patch v ^ " /refman/index.html"
73
+ let manual_with_version v = " /doc/" ^ patch v ^ " /refman/index.html"
70
74
let manual = " /refman"
71
- let corelib_with_version v = " /doc/V " ^ patch v ^ " /corelib/index.html"
75
+ let corelib_with_version v = " /doc/" ^ patch v ^ " /corelib/index.html"
72
76
let corelib = " /corelib"
73
- let stdlib_with_version v = " /doc/V " ^ patch v ^ " /stdlib/index.html"
77
+ let stdlib_with_version v = " /doc/" ^ patch v ^ " /stdlib/index.html"
74
78
let stdlib = " /stdlib"
75
- let stdlib_manual_with_version v = " /doc/V " ^ patch v ^ " /refman-stdlib/index.html"
79
+ let stdlib_manual_with_version v = " /doc/" ^ patch v ^ " /refman-stdlib/index.html"
76
80
let stdlib_manual = " /refman-stdlib"
77
- let api_with_version v = " /doc/V " ^ patch v ^ " /api/index.html"
81
+ let api_with_version v = " /doc/" ^ patch v ^ " /api/index.html"
78
82
let api = " /api"
79
83
let books = " /books"
80
84
let changelog = " /changelog"
0 commit comments