summaryrefslogtreecommitdiff
path: root/website/www
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-12-07 15:27:12 +0100
committerLudovic Courtès <ludo@gnu.org>2016-12-07 15:27:12 +0100
commit1c6af117178f47962c4119f2fa797a7e74e9d7ec (patch)
tree1af91b8b002855f4d5593b3f77986b40d3236fd2 /website/www
parent756f16c6d28b6281156bcd252f79832b823a4d43 (diff)
downloadguix-artwork-1c6af117178f47962c4119f2fa797a7e74e9d7ec.tar
guix-artwork-1c6af117178f47962c4119f2fa797a7e74e9d7ec.tar.gz
website: packages: Make the package list an explicit parameter.
* website/www/packages.scm (packages-by-grouping): Add 'packages' parameter. Use it instead of calling 'all-packages'. (paginated-packages-page): Likewise, and return a page instead of a thunk. (packages-page): Swap the 'packages' and 'grouping' parameters.
Diffstat (limited to 'website/www')
-rw-r--r--website/www/packages.scm22
1 files changed, 11 insertions, 11 deletions
diff --git a/website/www/packages.scm b/website/www/packages.scm
index 63cea3a..ed88681 100644
--- a/website/www/packages.scm
+++ b/website/www/packages.scm
@@ -470,8 +470,8 @@ PACKAGES."
(package-name p2)))))
(define packages-by-grouping
- (lambda* (#:optional (grouping 'all))
- "Return an alphabetically sorted list of Guix packages, limited
+ (lambda* (packages #:optional (grouping 'all))
+ "Return an alphabetically sorted list of the subset of PACKAGES limited
to those matching GROUPING. GROUPING can be 'all for all packages,
the string '0-9' for all packages starting with digits, or a string of
a single, lower-case letter for a list of all packages starting with
@@ -480,21 +480,21 @@ that letter."
('all (all-packages))
("0-9" (filter (compose (cut char-set-contains? char-set:digit <>)
first string->list package-name)
- (all-packages)))
+ packages))
(letter (filter (lambda (package)
(string=? (string-take (package-name package) 1)
letter))
- (all-packages))))))
+ packages)))))
-(define (paginated-packages-page grouping)
- "Return a packages page that contains only content for the packages
-that match GROUPING (either the string '0-9' or a string of one
+(define (paginated-packages-page packages grouping)
+ "Return a packages page that contains only content for the subset of
+PACKAGES that matches GROUPING (either the string '0-9' or a string of one
letter)."
- (lambda ()
- (packages-page (string-upcase grouping) (packages-by-grouping grouping))))
+ (packages-page (packages-by-grouping packages grouping)
+ (string-upcase grouping)))
-(define* (packages-page #:optional (grouping "All")
- (packages (all-packages)))
+(define* (packages-page #:optional (packages (all-packages))
+ (grouping "All"))
`(html (@ (lang "en"))
,(html-page-header "Packages" #:css "packages.css" #:js "packages.js")
(body