distro-build: "detail" label rendering on download page
original commit: f0bd4e6d711b99af110a687445425da462458b65
This commit is contained in:
parent
e39f2d9d8c
commit
ad6ac7fe28
|
@ -405,12 +405,14 @@ sorted. Then, for the purposes of building the table, a "|" separated
|
||||||
by any number of spaces within a name is treated as a hierarchical
|
by any number of spaces within a name is treated as a hierarchical
|
||||||
delimiter, while anything within "{" and "}" in a hierarchical level
|
delimiter, while anything within "{" and "}" in a hierarchical level
|
||||||
is stripped from the displayed name along with surrounding spaces (so
|
is stripped from the displayed name along with surrounding spaces (so
|
||||||
that it can affect sorting without being displayed).
|
that it can affect sorting without being displayed). Anything after ";
|
||||||
|
" within a "|"-separated part is rendered as a detail part of the
|
||||||
|
label (e.g., in a smaller font).
|
||||||
|
|
||||||
For example, the names
|
For example, the names
|
||||||
|
|
||||||
"Racket | {2} Linux | 32-bit"
|
"Racket | {2} Linux | 32-bit"
|
||||||
"Racket | {2} Linux | 64-bit"
|
"Racket | {2} Linux | 64-bit; built on Ubuntu"
|
||||||
"Racket | {1} Windows | 32-bit"
|
"Racket | {1} Windows | 32-bit"
|
||||||
"Racket | {1} Windows | 64-bit"
|
"Racket | {1} Windows | 64-bit"
|
||||||
"Racket | {3} Source"
|
"Racket | {3} Source"
|
||||||
|
@ -419,14 +421,15 @@ are shown (actually or conceptually) as
|
||||||
|
|
||||||
Racket
|
Racket
|
||||||
Windows
|
Windows
|
||||||
[32-bit]
|
[32-bit] <build on Ubuntu>
|
||||||
[64-bit]
|
[64-bit]
|
||||||
Linux
|
Linux
|
||||||
[32-bit]
|
[32-bit]
|
||||||
[64-bit]
|
[64-bit]
|
||||||
[Source]
|
[Source]
|
||||||
|
|
||||||
where the square-bracketed entries are hyperlinks.
|
where the square-bracketed entries are hyperlinks and the
|
||||||
|
angle-bracketed pieces are details.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -189,7 +189,7 @@
|
||||||
|
|
||||||
(define page-headers
|
(define page-headers
|
||||||
(style/inline @~a|{
|
(style/inline @~a|{
|
||||||
.detail { font-size: small; }
|
.detail { font-size: small; font-weight: normal; }
|
||||||
.checksum, .path { font-family: monospace; }
|
.checksum, .path { font-family: monospace; }
|
||||||
.group { background-color : #ccccff; padding-left: 0.5ex; }
|
.group { background-color : #ccccff; padding-left: 0.5ex; }
|
||||||
.major { font-weight : bold; font-size : large; left-border: 1ex; }
|
.major { font-weight : bold; font-size : large; left-border: 1ex; }
|
||||||
|
@ -220,6 +220,21 @@
|
||||||
a { text-decoration: none; }
|
a { text-decoration: none; }
|
||||||
}|))
|
}|))
|
||||||
|
|
||||||
|
(define (strip-detail s)
|
||||||
|
(if (string? s)
|
||||||
|
(regexp-replace #rx";.*" s "")
|
||||||
|
s))
|
||||||
|
|
||||||
|
(define (add-detail s e)
|
||||||
|
(define m (and (string? s)
|
||||||
|
(regexp-match #rx"(?<=; )(.*)$" s)))
|
||||||
|
(cond
|
||||||
|
[m
|
||||||
|
(span e (span class: "detail"
|
||||||
|
nbsp
|
||||||
|
(cadr m)))]
|
||||||
|
[else e]))
|
||||||
|
|
||||||
(define page-body
|
(define page-body
|
||||||
(list
|
(list
|
||||||
(if page-title
|
(if page-title
|
||||||
|
@ -249,17 +264,19 @@
|
||||||
(tr (td
|
(tr (td
|
||||||
(for/list ([col (in-list mid-cols)])
|
(for/list ([col (in-list mid-cols)])
|
||||||
(span nbsp nbsp nbsp))
|
(span nbsp nbsp nbsp))
|
||||||
(if (past-success? inst)
|
(add-detail
|
||||||
;; Show missing installer
|
last-col
|
||||||
(span class: (string-append "no-installer " level-class)
|
(if (past-success? inst)
|
||||||
last-col)
|
;; Show missing installer
|
||||||
;; Link to installer
|
(span class: (string-append "no-installer " level-class)
|
||||||
(a class: (string-append "installer " level-class)
|
(strip-detail last-col))
|
||||||
href: (url->string
|
;; Link to installer
|
||||||
(combine-url/relative
|
(a class: (string-append "installer " level-class)
|
||||||
(string->url installers-url)
|
href: (url->string
|
||||||
inst))
|
(combine-url/relative
|
||||||
last-col))
|
(string->url installers-url)
|
||||||
|
inst))
|
||||||
|
(strip-detail last-col))))
|
||||||
(get-site-help last-col))
|
(get-site-help last-col))
|
||||||
(td nbsp)
|
(td nbsp)
|
||||||
(td (if (past-success? inst)
|
(td (if (past-success? inst)
|
||||||
|
@ -316,7 +333,9 @@
|
||||||
colspan: num-cols
|
colspan: num-cols
|
||||||
(for/list ([col (in-list mid-cols)])
|
(for/list ([col (in-list mid-cols)])
|
||||||
(span nbsp nbsp nbsp))
|
(span nbsp nbsp nbsp))
|
||||||
last-col
|
(add-detail
|
||||||
|
last-col
|
||||||
|
(strip-detail last-col))
|
||||||
(get-site-help last-col)))])))
|
(get-site-help last-col)))])))
|
||||||
(if (and docs-url
|
(if (and docs-url
|
||||||
(not site))
|
(not site))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user