guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: website: packages: Make the package list an explicit parameter.


From: Ludovic Courtès
Subject: 01/05: website: packages: Make the package list an explicit parameter.
Date: Thu, 8 Dec 2016 09:17:05 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix-artwork.

commit 1c6af117178f47962c4119f2fa797a7e74e9d7ec
Author: Ludovic Courtès <address@hidden>
Date:   Wed Dec 7 15:27:12 2016 +0100

    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.
---
 website/www/packages.scm |   22 +++++++++++-----------
 1 file 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]