From 0938cd27315cc9d0a6591c398c222415b18ca4fc Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Sun, 11 Aug 2013 19:53:15 +0200 Subject: list-packages: Tidying and refactoring in preparation for substantive changes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build-aux/list-packages.scm (package->sxml)[license, status]: Add title for element. Add alt and title for gnu-logo element. Add title to package website element. (packages->sxml): Wrap
intro paragraph in

element. Add table header row to Add back to top of the page beneath table. (insert-css, insert-js): New procedures. (list-packages): Move JavaScript to 'insert-js', and CSS to 'insert-css'. Signed-off-by: Ludovic Courtès --- build-aux/list-packages.scm | 149 ++++++++++++++++++++++++++++++-------------- 1 file changed, 103 insertions(+), 46 deletions(-) (limited to 'build-aux') diff --git a/build-aux/list-packages.scm b/build-aux/list-packages.scm index ceadbef0fe..d0607878fd 100755 --- a/build-aux/list-packages.scm +++ b/build-aux/list-packages.scm @@ -5,6 +5,7 @@ exec guile -l "$0" \ !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013 Alex Sassmannshausen ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,7 +66,8 @@ exec guile -l "$0" \ (let ((uri (license-uri license))) (case (and=> (and uri (string->uri uri)) uri-scheme) ((http https) - `(div (a (@ (href ,uri)) + `(div (a (@ (href ,uri) + (title "Link to the full license")) ,(license-name license)))) (else `(div ,(license-name license) " (" @@ -78,7 +80,8 @@ exec guile -l "$0" \ (define (url system) `(a (@ (href ,(string-append "http://hydra.gnu.org/job/gnu/master/" (package-full-name package) "." - system))) + system)) + (title "View the status of this architecture's build at Hydra")) ,system)) `(div "status: " @@ -92,9 +95,12 @@ exec guile -l "$0" \ (let ((description-id (symbol->string (gensym (package-name package))))) `(tr (td ,(if (gnu-package? package) - `(img (@ (src "/graphics/gnu-head-mini.png"))) + `(img (@ (src "/graphics/gnu-head-mini.png") + (alt "Part of GNU") + (title "Part of GNU"))) "")) - (td (a (@ (href ,(source-url package))) + (td (a (@ (href ,(source-url package)) + (title "Link to the Guix package source code")) ,(package-name package) " " ,(package-version package))) (td (@ (colspan "2") (height "0")) @@ -104,7 +110,6 @@ exec guile -l "$0" \ description-id))) ,(package-synopsis package)) (div (@ (id ,description-id) - (class "package-description") (style "display: none;")) ,(match (package-logo (package-name package)) ((? string? url) @@ -114,7 +119,8 @@ exec guile -l "$0" \ (_ #f)) (p ,(package-description package)) ,(license package) - (a (@ (href ,(package-home-page package))) + (a (@ (href ,(package-home-page package)) + (title "Link to the package's website")) ,(package-home-page package)) ,(status package)))))) @@ -127,16 +133,93 @@ exec guile -l "$0" \ (img (@ (src "graphics/guix-logo.small.png") (alt "GNU Guix and the GNU System") (height "83em")))) - "This web page lists the packages currently provided by the " - (a (@ (href "manual/guix.html#GNU-Distribution")) - "GNU system distribution") - " of " - (a (@ (href "/software/guix/guix.html")) "GNU Guix") ". " - "Our " (a (@ (href "http://hydra.gnu.org/jobset/gnu/master")) - "continuous integration system") - " shows their current build status.") + (p "This web page lists the packages currently provided by the " + (a (@ (href "manual/guix.html#GNU-Distribution")) + "GNU system distribution") + " of " + (a (@ (href "/software/guix/guix.html")) "GNU Guix") ". " + "Our " (a (@ (href "http://hydra.gnu.org/jobset/gnu/master")) + "continuous integration system") + " shows their current build status.")) (table (@ (id "packages")) - ,@(map package->sxml packages)))) + (tr (th "GNU?") + (th "Package version") + (th "Package details")) + ,@(map package->sxml packages)) + (a (@ (href "#intro") + (title "Back to top.") + (id "top")) + "^"))) + + +(define (insert-css) + "Return the CSS for the list-packages page." + (format #t +"")) + +(define (insert-js) + "Return the JavaScript for the list-packages page." + (format #t +"")) (define (list-packages . args) @@ -154,39 +237,13 @@ with gnu.org server-side include and all that." (string - GNU Guix - GNU Distribution - GNU Project - - - ") - (display (sxml->xml (packages->sxml packages))) + (insert-css) + (insert-js) + (format #t "") + + (sxml->xml (packages->sxml packages)) (format #t "
-- cgit 1.4.1