guix-commits
[Top][All Lists]
Advanced

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

02/02: website: issues: Use the same anchors as the package page.


From: Ludovic Courtès
Subject: 02/02: website: issues: Use the same anchors as the package page.
Date: Tue, 22 Dec 2015 17:57:10 +0000

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

commit 096e226de8126eb460c69d7c0645a735cb1f5a87
Author: Ludovic Courtès <address@hidden>
Date:   Tue Dec 22 18:55:46 2015 +0100

    website: issues: Use the same anchors as the package page.
    
    * website/www/packages.scm (package->issue-sxml): Add #:anchor parameter
    and honor it.  Move anchor to the "issues" cell.
    (packages->issue-sxml): Use 'packages->anchors'.  Pass #:anchor to
    'package->issue-sxml'.
---
 website/www/packages.scm |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/website/www/packages.scm b/website/www/packages.scm
index 483c32b..21d98d0 100644
--- a/website/www/packages.scm
+++ b/website/www/packages.scm
@@ -376,7 +376,10 @@ list of checker/report tuples."
                           (td (pre ,(string-trim-right report))))))
                   issues))))))
 
-(define* (package->issue-sxml package #:key (checkers %issue-checkers))
+(define* (package->issue-sxml package
+                              #:key
+                              (anchor (package-full-name package))
+                              (checkers %issue-checkers))
   "Return an SXML table row for PACKAGE containing all the reports generated
 by CHECKERS."
   (let ((issues (package-issues package checkers)))
@@ -384,13 +387,13 @@ by CHECKERS."
       (string-append (package-name package) " "
                      (package-version package)))
 
-    `(tr (td (a (@ (name ,(package-full-name package))))
-             (a (@ (href ,(source-url package))
+    `(tr (td (a (@ (href ,(source-url package))
                    (title "Link to the Guix package source code"))
                 ,(if (null? issues)
                      name+version
                      `(b ,name+version))))
-         (td ,(issues->sxml package issues)))))
+         (td (a (@ (name ,anchor)))
+             ,(issues->sxml package issues)))))
 
 (define* (packages->issue-sxml packages #:key (checkers %issue-checkers))
   "Return an SXML tree representing the reports generated by CHECKERS for
@@ -403,10 +406,15 @@ PACKAGES."
     (force-output (current-error-port))
     (set! processed (+ 1 processed)))
 
+  (define package-anchor
+    (packages->anchors packages))
+
   `(table
     ,@(map (lambda (package)
              (report-progress)
-             (package->issue-sxml package #:checkers checkers))
+             (package->issue-sxml package
+                                  #:anchor (package-anchor package)
+                                  #:checkers checkers))
            packages)))
 
 



reply via email to

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