@@ -5,14 +5,15 @@ type metadata = {
5
5
version : string ;
6
6
date : string ;
7
7
is_latest : bool option ;
8
+ is_prerelease : bool option ;
8
9
is_lts : bool option ;
9
10
intro : string ;
10
11
highlights : string ;
11
12
}
12
13
[@@ deriving
13
14
of_yaml ,
14
15
stable_record ~version: t ~remove: [ intro ; highlights ]
15
- ~modify: [ is_latest ; is_lts ]
16
+ ~modify: [ is_latest ; is_prerelease ; is_lts ]
16
17
~add:
17
18
[
18
19
intro_md ;
@@ -32,6 +33,7 @@ let of_metadata m =
32
33
(m.highlights |> Markdown.Content. of_string
33
34
|> Markdown.Content. render ~syntax_highlighting: true )
34
35
~modify_is_latest: (Option. value ~default: false )
36
+ ~modify_is_prerelease: (Option. value ~default: false )
35
37
~modify_is_lts: (Option. value ~default: false )
36
38
37
39
let sort_by_decreasing_version (x : t ) (y : t ) =
@@ -54,17 +56,19 @@ let all () =
54
56
55
57
let is_coq_or_rocq (r : t ) = r.kind == `Coq || r.kind == `Rocq
56
58
let is_coq_or_rocq_platform (r : t ) = r.kind == `CoqPlatform || r.kind == `RocqPlatform
59
+ let is_rocq (r : t ) = r.kind == `Rocq
57
60
58
61
let template () =
59
62
let all = all () in
60
63
let latest =
61
- try List. find (fun (r : t ) -> is_coq_or_rocq r && r.is_latest) all
64
+ try List. find (fun (r : t ) -> is_coq_or_rocq r && r.is_latest && not r.is_prerelease ) all
62
65
with Not_found ->
63
66
raise
64
67
(Invalid_argument
65
68
" none of the Coq/Rocq releases in data/releases is marked with is_latest: \
66
69
true" )
67
70
in
71
+ let latest_prerelease = List. find_opt (fun (r : t ) -> is_rocq r && r.is_prerelease && r.is_latest) all in
68
72
let latest_platform =
69
73
try List. find (fun (r : t ) -> is_coq_or_rocq_platform r && r.is_latest) all
70
74
with Not_found ->
@@ -85,8 +89,9 @@ let template () =
85
89
include Data_intf. Release
86
90
let all = % a
87
91
let latest = % a
92
+ let latest_prerelease = % a
88
93
let latest_platform = % a
89
94
let lts = % a
90
95
| }
91
96
(Fmt. brackets (Fmt. list pp ~sep: Fmt. semi))
92
- all pp latest pp latest_platform pp lts
97
+ all pp latest ( Fmt. option ~none: ( Fmt. const Fmt. string " None " ) ( Fmt. append ( Fmt. const Fmt. string " Some " ) ( Fmt. parens pp))) latest_prerelease pp latest_platform pp lts
0 commit comments