File tree 6 files changed +16
-9
lines changed
rocqproverorg_package/lib
6 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,20 @@ Layout.base
60
60
<li class="flex flex-auto">
61
61
<a class="w-full h-10 flex justify-center rounded-r-lg p-1 items-center font-semibold border border-l-0 border-primary dark:border-dark-primary <%s (match path with | Documentation _ -> "bg-primary dark:bg-dark-primary text-white dark:text-dark-title" | _ -> "text-primary dark:text-dark-primary bg-sand dark:bg-dark-card")%>" href="<%s Url.Package.documentation package.name ?version:(Package.url_version package) %>">Docs</a>
62
62
</li>
63
- <% | Unknown -> ( %>
63
+ <% | _ ->
64
+ let title, link = match package.Package.doc with
65
+ | Some doc -> "Doc", doc
66
+ | None -> match package.Package.homepages with
67
+ | [] -> "No Docs", ""
68
+ | hd :: _ -> "Homepage", hd
69
+ in
70
+ %>
64
71
<li class="flex flex-auto">
65
- <span aria-label="Documentation status is unknown" class="w-full h-10 flex justify-center gap-2 rounded-r-lg p-1 items-center font-semibold border border-l-0 border-separator_20 dark:border-dark-separator_30 <%s (match path with | Documentation _ -> "bg-primary dark:bg-dark-primary text-title dark:text-dark-title" | _ -> "text-title dark:text-dark-title bg-sand dark:bg-dark-card")%>"> <%s! Icons.error "" %> No Docs</span >
72
+ <a class="w-full h-10 flex justify-center rounded-r-lg p-1 items-center font-semibold border border-l-0 border-primary dark:border-dark-primary <%s (match path with | Documentation _ -> "bg-primary dark:bg-dark-primary text-white dark:text-dark-title" | _ -> "text-primary dark:text-dark-primary bg-sand dark:bg-dark-card")%>" href=" <%s link %>"><%s title %></a >
66
73
</li>
67
- <% )
68
- | Failure -> ( %>
69
- <li class="flex flex-auto">
70
- <a title="Documentation failed to build!" class="w-full h-10 flex justify-center gap-2 rounded-r-lg p-1 items-center font-semibold border border-l-0 border-gray-400 <%s (match path with | Documentation _ -> "bg-primary text-white" | _ -> "text-gray-500 bg-sand")%>" href="<%s Url.Package.documentation package.name ?version:(Package.url_version package) %>"><%s! Icons.error "" %> No Docs</a>
71
- </li>
72
- <% ));%>
74
+ <% ); %>
73
75
</li>
74
76
</ol>
75
-
76
77
<div id="in-package-search" class="relative w-full">
77
78
<div class="flex w-full items-center overflow-hidden">
78
79
<% if Option.is_some search_index_digest then (%>
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ type package = {
16
16
maintainers : Data.Opam_user .t list ;
17
17
publication : float ;
18
18
homepages : string list ;
19
+ doc : string option ;
19
20
source : (string * string list ) option ;
20
21
(* TODO: these should be part of package.json coming from voodoo, but they
21
22
currently aren't
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ type t = {
11
11
maintainers : string list ;
12
12
license : string ;
13
13
homepage : string list ;
14
+ doc : string option ;
14
15
tags : string list ;
15
16
dependencies : (OpamPackage.Name .t * string option ) list ;
16
17
rev_deps : (OpamPackage.Name .t * string option * OpamPackage.Version .t ) list ;
@@ -152,6 +153,7 @@ let make ~package ~packages ~rev_deps ~timestamps opam =
152
153
description =
153
154
descr opam |> Option. map OpamFile.Descr. body |> Option. value ~default: " " ;
154
155
homepage = homepage opam;
156
+ doc = List. nth_opt (doc opam) 0 ;
155
157
tags = tags opam;
156
158
rev_deps;
157
159
conflicts = get_conflicts opam;
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ module Info : sig
40
40
maintainers : string list ;
41
41
license : string ;
42
42
homepage : string list ;
43
+ doc : string option ;
43
44
tags : string list ;
44
45
dependencies : (Name .t * string option ) list ;
45
46
rev_deps : (Name .t * string option * Version .t ) list ;
Original file line number Diff line number Diff line change @@ -797,6 +797,7 @@ module Package_helper = struct
797
797
license = info.license;
798
798
publication = info.publication;
799
799
homepages = info.Rocqproverorg_package.Info. homepage;
800
+ doc = info.Rocqproverorg_package.Info. doc;
800
801
source =
801
802
Option. map
802
803
(fun url ->
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ let empty_info =
19
19
maintainers = [] ;
20
20
license = " " ;
21
21
homepage = [] ;
22
+ doc = None ;
22
23
tags = [] ;
23
24
dependencies;
24
25
rev_deps = [] ;
You can’t perform that action at this time.
0 commit comments