summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Sassmannshausen <alex.sassmannshausen@gmail.com>2013-08-04 21:46:26 +0200
committerLudovic Courtès <ludo@gnu.org>2013-08-15 16:32:58 +0200
commit8bdf5241dce2f4c6a59120188d99e23043a2942c (patch)
tree39f25a6aa1466bc77b1176cc83ab77e07c157576
parent1af63b797c2a0b6fc42cbb176dd1664dfc346a05 (diff)
downloadguix-8bdf5241dce2f4c6a59120188d99e23043a2942c.tar.gz
list-packages: Centralise CSS styling in <head>.
* build-aux/list-packages.scm (package-logo): Assign class of
  'package-description' to package synopsis div; 'package-logo'.  Move inline
  CSS where possible.
  (packages->sxml): Assign id of 'intro' to intro div, 'packages' to the
  table. Move inline CSS.
  (list-packages): Create new <style> section, containing all inline CSS.
  Move JavaScript <script> section to above banner include to place it in
  <head>.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rwxr-xr-xbuild-aux/list-packages.scm29
1 files changed, 22 insertions, 7 deletions
diff --git a/build-aux/list-packages.scm b/build-aux/list-packages.scm
index 8d38728f7f..ceadbef0fe 100755
--- a/build-aux/list-packages.scm
+++ b/build-aux/list-packages.scm
@@ -104,12 +104,13 @@ exec guile -l "$0"                              \
                                     description-id)))
                ,(package-synopsis package))
             (div (@ (id ,description-id)
-                    (style "position: relative; display: none;"))
+                    (class "package-description")
+                    (style "display: none;"))
                  ,(match (package-logo (package-name package))
                     ((? string? url)
                      `(img (@ (src ,url)
                               (height "35em")
-                              (style "float: left; padding-right: 1em;"))))
+                              (class "package-logo"))))
                     (_ #f))
                  (p ,(package-description package))
                  ,(license package)
@@ -121,7 +122,7 @@ exec guile -l "$0"                              \
   "Return an HTML page as SXML describing PACKAGES."
   `(div
     (h2 "GNU Guix Package List")
-    (div (@ (style "margin-bottom: 5em;"))
+    (div (@ (id "intro"))
          (div
           (img (@ (src "graphics/guix-logo.small.png")
                   (alt "GNU Guix and the GNU System")
@@ -134,7 +135,7 @@ exec guile -l "$0"                              \
          "Our " (a (@ (href "http://hydra.gnu.org/jobset/gnu/master"))
                    "continuous integration system")
          " shows their current build status.")
-    (table (@ (style "border: none;"))
+    (table (@ (id "packages"))
            ,@(map package->sxml packages))))
 
 
@@ -155,8 +156,6 @@ with gnu.org server-side include and all that."
 <!-- Parent-Version: 1.70 $ -->
 
 <title>GNU Guix - GNU Distribution - GNU Project</title>
-<!--#include virtual=\"/server/banner.html\" -->
-
 <script language=\"javascript\" type=\"text/javascript\">
 // license: CC0
 function show_hide(idThing)
@@ -170,7 +169,23 @@ function show_hide(idThing)
     }
   }
 }
-</script>")
+</script>
+<style>
+div#intro {
+margin-bottom: 5em;
+}
+table#packages {
+border: none;
+}
+div.package-description {
+position: relative;
+}
+img.package-logo {
+float: left; padding-right: 1em;
+}
+</style>
+<!--#include virtual=\"/server/banner.html\" -->
+")
    (display (sxml->xml (packages->sxml packages)))
    (format #t "<!--#include virtual=\"/server/footer.html\" -->
 <div id=\"footer\">