Re: [PATCH] Integrate the package list in the website.

2015-06-22 Thread Ludovic Courtès
Luis Felipe López Acevedo  skribis:

> One thing I found is that the page does not validate. "The error was:
> utf8 "\xE9" does not map to Unicode" ().
>
> In my Web browser, the  of the page reads "Packages ?
> GuixSD". Maybe that question mark has something to do with the error
> above.

Right, the page was exported in locale encoding (which happened to be
ASCII on hydra.gnu.org) instead of UTF-8.  Fixed in 1bc4c07.

> Also, I noticed that the page is starting to take more time to load,
> at least in this computer. What would you think of adding pagination?
> I can't help with the code right now, but I could draw a mockup this
> weekend.

I’m not sure what you mean by pagination.

What would be ideal would be to use the JS code found in guix-web
 that allows users to search for
packages (basically all the package data would still be available in the
client, just not displayed.)

WDYT?

(I’m not offering to help with this code, though. :-))

Thanks,
Ludo’.



Re: [PATCH] Integrate the package list in the website.

2015-06-18 Thread Luis Felipe López Acevedo

On 2015-06-18 04:44, l...@gnu.org wrote:

I’ve uploaded the new web page and updated the script on hydra.gnu.org
that updates it every day:

  https://www.gnu.org/software/guix/package-list.html


Great!


As Mathieu told me, it looks OK, but there’s probably room for
improvement in the CSS of that page.  Felipe, what do you think?  :-)



I also think it looks OK (for now) :)

Some comments:

One thing I found is that the page does not validate. "The error was: 
utf8 "\xE9" does not map to Unicode" ().


In my Web browser, the  of the page reads "Packages ? GuixSD". 
Maybe that question mark has something to do with the error above.


Also, I noticed that the page is starting to take more time to load, at 
least in this computer. What would you think of adding pagination? I 
can't help with the code right now, but I could draw a mockup this 
weekend.




Thanks again, Mathieu!


Thanks, Mathieu!


--
Luis Felipe López Acevedo
http://sirgazil.bitbucket.org/



Re: [PATCH] Integrate the package list in the website.

2015-06-18 Thread Ludovic Courtès
I’ve uploaded the new web page and updated the script on hydra.gnu.org
that updates it every day:

  https://www.gnu.org/software/guix/package-list.html

As Mathieu told me, it looks OK, but there’s probably room for
improvement in the CSS of that page.  Felipe, what do you think?  :-)

Thanks again, Mathieu!

Ludo’.



Re: [PATCH] Integrate the package list in the website.

2015-06-15 Thread Ludovic Courtès
Mathieu Lirzin  skribis:

> I would like some advice on how to add copyright notices in
> 'website/static/base/css/packages.css' and
> 'website/static/base/js/packages.js'. Futhermore I would like
> suggestions about my commit messages, in order to make then
> precise. Other comments or reviews are welcome too ;-)

Both the CSS and JS are under CC0, so I think the simple “license: CC0”
is enough (and hopefully recognized by LibreJS.)

> From aff0743966b06d524acc1d0be86f46b4b0a20828 Mon Sep 17 00:00:00 2001
> From: Mathieu Lirzin 
> Date: Sun, 14 Jun 2015 20:06:40 +0200
> Subject: [PATCH 1/2] website: Allow inclusion of Javascript.
>
> * website/www/utils.scm (js-url): New procedure.
> * website/www/shared.scm (html-page-header): Use it. Add #:js parameter.

[...]

> -(define* (html-page-header title #:key (css "article.css"))
> +(define* (html-page-header title #:key (css "article.css") (js ""))

Make it just js (meaning #:js defaults to #f) and...

> +  ,(if (string-null? js)
> +   ""
> +   `(script (@ (src ,(js-url js))) ""

... make it ,(if js `(script ...) "").
(It’s more idiomatic.)

> From ab91cf5468669c80ea13f0540c53e8f8c8faedb5 Mon Sep 17 00:00:00 2001
> From: Mathieu Lirzin 
> Date: Sun, 14 Jun 2015 19:13:12 +0200
> Subject: [PATCH 2/2] website: packages: List packages.
>
> Integrate 'build-aux/list-packages.scm' from the Guix repository in the
> GuixSD website instead of using an external link.  Export of the package
> list is optional since it requires to have Guix locally.
>
> * website/static/base/css/packages.css: New file.
> * website/static/base/js/packages.js: Likewise.
> * website/www.scm (export-web-site): Add #:packages parameter.
> * website/www/packages.scm (lookup-gnu-package, list-join)
>   (package->sxml, packages->sxml): New procedures.
>   (packages-page): Use them.
> * website/www/shared.scm (html-page-description): Use 'packages-page'.

[...]

> --- a/website/www.scm
> +++ b/website/www.scm
> @@ -330,11 +330,7 @@ Distribution.")
>  ("contribute/index.html" ,contribute-page)
>  ("donate/index.html" ,donate-page)
>  ("download/index.html" ,download-page)
> -("help/index.html" ,help-page)
> -
> -;; XXX: The following one is not ready yet.
> -;; ("packages/index.html" ,packages-page)
> -))
> +("help/index.html" ,help-page)))
>  
>  (define (mkdir* directory)
>"Make DIRECTORY unless it already exists."
> @@ -353,15 +349,19 @@ Distribution.")
>(display "\n" port)
>(sxml->xml page port
>  
> -(define* (export-web-site #:optional (directory "."))
> -  "Export the whole web site as HTML files created in DIRECTORY."
> +(define* (export-web-site #:optional (directory ".") #:key (packages #f))

I would leave both unchanged.  When we really want to export
package-list.html, we can just add it to %web-pages or use a single call
to ‘export-web-page’.

> From 15b73de6b2910fc1a0a000780c786adc4c0c4404 Mon Sep 17 00:00:00 2001
> From: Mathieu Lirzin 
> Date: Sun, 14 Jun 2015 20:52:42 +0200
> Subject: [PATCH] list-packages: Move to guix-artwork repository.
>
> In order to integrate the package list with the GuixSD website, the listing of
> packages has been moved into the website implementation.
>
> * build-aux/list-packages.scm: Remove file.
> * Makefile.am (EXTRA_DIST): Adapt to it.

OK to push with these changes.

Thank you!

Ludo’.



[PATCH] Integrate the package list in the website.

2015-06-14 Thread Mathieu Lirzin
Hello Guix,

I would like some advice on how to add copyright notices in
'website/static/base/css/packages.css' and
'website/static/base/js/packages.js'. Futhermore I would like
suggestions about my commit messages, in order to make then
precise. Other comments or reviews are welcome too ;-)

guix-artwork:
>From aff0743966b06d524acc1d0be86f46b4b0a20828 Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin 
Date: Sun, 14 Jun 2015 20:06:40 +0200
Subject: [PATCH 1/2] website: Allow inclusion of Javascript.

* website/www/utils.scm (js-url): New procedure.
* website/www/shared.scm (html-page-header): Use it. Add #:js parameter.
---
 website/www/shared.scm | 7 +--
 website/www/utils.scm  | 4 
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/website/www/shared.scm b/website/www/shared.scm
index 88dad4e..6b19db9 100644
--- a/website/www/shared.scm
+++ b/website/www/shared.scm
@@ -30,7 +30,7 @@
 (define latest-guix-version
   (make-parameter "0.8.2"))
 
-(define* (html-page-header title #:key (css "article.css"))
+(define* (html-page-header title #:key (css "article.css") (js ""))
   `(head (meta (@ (charset "utf-8")))
 	 (meta (@ (name "author")
 		  (content "GuixSD Contributors")))
@@ -58,7 +58,10 @@ Functional package management,")))
 		  (rel "icon")
 		  (href ,(image-url "favicon.png"
 	 (link (@ (rel "license") (href "Pending...")))
-	 (title ,(string-append title " — GuixSD"
+	 (title ,(string-append title " — GuixSD"))
+	 ,(if (string-null? js)
+	  ""
+	  `(script (@ (src ,(js-url js))) ""
 
 (define (html-page-description)
   `(div (@ (class "message-box msg-info"))
diff --git a/website/www/utils.scm b/website/www/utils.scm
index 96ccb5f..029951f 100644
--- a/website/www/utils.scm
+++ b/website/www/utils.scm
@@ -28,6 +28,7 @@
 	guix-url
 	static-base-url
 	css-url
+	js-url
 	image-url
 	thumb-url
 	screenshot-url
@@ -66,6 +67,9 @@
 (define (css-url file)
   (string-append (static-base-url) "css/" file))
 
+(define (js-url file)
+  (string-append (static-base-url) "js/" file))
+
 (define (image-url file)
   (string-append (static-base-url) "img/" file))
 
-- 
2.1.4

>From ab91cf5468669c80ea13f0540c53e8f8c8faedb5 Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin 
Date: Sun, 14 Jun 2015 19:13:12 +0200
Subject: [PATCH 2/2] website: packages: List packages.

Integrate 'build-aux/list-packages.scm' from the Guix repository in the
GuixSD website instead of using an external link.  Export of the package
list is optional since it requires to have Guix locally.

* website/static/base/css/packages.css: New file.
* website/static/base/js/packages.js: Likewise.
* website/www.scm (export-web-site): Add #:packages parameter.
* website/www/packages.scm (lookup-gnu-package, list-join)
  (package->sxml, packages->sxml): New procedures.
  (packages-page): Use them.
* website/www/shared.scm (html-page-description): Use 'packages-page'.
---
 website/static/base/css/packages.css |  64 ++
 website/static/base/js/packages.js   |  46 +++
 website/www.scm  |  26 ++--
 website/www/packages.scm | 236 ++-
 website/www/shared.scm   |   2 +-
 5 files changed, 357 insertions(+), 17 deletions(-)
 create mode 100644 website/static/base/css/packages.css
 create mode 100644 website/static/base/js/packages.js

diff --git a/website/static/base/css/packages.css b/website/static/base/css/packages.css
new file mode 100644
index 000..d9771be
--- /dev/null
+++ b/website/static/base/css/packages.css
@@ -0,0 +1,64 @@
+/* license: CC0 */
+
+@import url("article.css");
+
+a {
+transition: all 0.3s;
+}
+table#packages, table#packages tr, table#packages tbody, table#packages td, table#packages th {
+border: 0px solid black;
+clear: both;
+}
+table#packages tr:nth-child(even) {
+background-color: #FFF;
+}
+table#packages tr:nth-child(odd) {
+background-color: #EEE;
+}
+table#packages tr:hover, table#packages tr:focus, table#packages tr:active {
+background-color: #DDD;
+}
+table#packages th {
+background-color: #333;
+color: #fff;
+}
+table#packages td {
+margin:0px;
+padding:0.2em 0.5em;
+}
+table#packages td:first-child {
+width:10%;
+text-align:center;
+}
+table#packages td:nth-child(2) {
+width:30%;
+}
+table#packages td:last-child {
+width:60%;
+}
+img.package-logo {
+float: left;
+padding: 0.75em;
+}
+table#packages span {
+font-weight: 700;
+}
+table#packages span a {
+float: right;
+font-weight: 500;
+}
+a#top {
+position:fixed;
+right:10px;
+bottom:10px;
+font-size:150%;
+background-color:#EEE;
+padding:10px 7.5px 0 7.5px;
+text-decoration:none;
+color:#000;
+border-radius:5px;
+}
+a#top:hover, a#top:focus {
+background-color:#333;
+color:#fff;
+}
\ No newline at end of file
diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js
new file mode 10064