Re: Having a package browser on guix.gnu.org

2022-01-23 Thread Luis Felipe
On Tuesday, January 18th, 2022 at 2:05 PM, Ludovic Courtès  wrote:

> Luis Felipe luis.felipe...@protonmail.com skribis:
> 

> > I want to help. I'll check the source and start asking questions.
> 

> Yay!

Unfortunately, I need to focus on something else right now, so I think I can't 
work on this project anytime soon :(

If anyone else can take it, that would be great...

publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Having a package browser on guix.gnu.org

2022-01-18 Thread Ludovic Courtès
Hi,

Christopher Baines  skribis:

> Ludovic Courtès  writes:

[...]

>> Former Outreachy intern Danjela Lura, together with Chris Baines, had
>> started developing a JS-free package browsing interface:
>>
>>   https://lists.gnu.org/archive/html/guix-devel/2020-07/msg00050.html
>>
>> Chris, could you tell us what the status is and what’s missing before we
>> can use it on the web site?
>
> I think it's unchanged for a while now, I've attached what's probably
> the latest source code (there's not much to it).

Nice.  That’s only the search page though, and not individual package
pages, right?

> I think the remaining work is to settle on a direction in terms of the
> design and how to integrate it in to the website, and then deploy
> something for real. Personally, I'm in favour of a packages.guix.gnu.org
> domain which hosts the search page plus the package pages, and stopping
> generating package pages with haunt.

Sounds like a plan!

> I don't really have the time to try and move this forward myself, but I
> can try and support others.

Yes, that would be nice.  It now takes Haunt ages to generate all these
pages, we have to do something about it.  :-)

So, if anyone feels like picking it up but needs guidance, let us know!

Thanks,
Ludo’.



Re: Having a package browser on guix.gnu.org

2022-01-18 Thread Ludovic Courtès
Luis Felipe  skribis:

> I want to help. I'll check the source and start asking questions.

Yay!

Ludo'.



Re: Having a package browser on guix.gnu.org

2022-01-09 Thread Luis Felipe
On Sunday, January 9th, 2022 at 7:53 PM, Christopher Baines  
wrote:

> Ludovic Courtès l...@gnu.org writes:
> 

> > Luis Felipe luis.felipe...@protonmail.com skribis:
> > 

> > > But I wonder if it is possible now to make the packages part use any of 
> > > the Postgres databases that already exist and allow traditional search 
> > > without JavaScript...
> > 

> > Former Outreachy intern Danjela Lura, together with Chris Baines, had
> > 

> > started developing a JS-free package browsing interface:
> > 

> > https://lists.gnu.org/archive/html/guix-devel/2020-07/msg00050.html

I completely  forgot about this :( Thanks for the link.


> > Chris, could you tell us what the status is and what’s missing before we
> > 

> > can use it on the web site?
> 

> I think it's unchanged for a while now, I've attached what's probably
> 

> the latest source code (there's not much to it).
> 

> I think the remaining work is to settle on a direction in terms of the
> 

> design and how to integrate it in to the website, and then deploy
> 

> something for real. Personally, I'm in favour of a packages.guix.gnu.org
> 

> domain which hosts the search page plus the package pages, and stopping
> 

> generating package pages with haunt.

+1


> I don't really have the time to try and move this forward myself, but I
> 

> can try and support others.

I want to help. I'll check the source and start asking questions.

publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Having a package browser on guix.gnu.org

2022-01-09 Thread Christopher Baines

Ludovic Courtès  writes:

> Luis Felipe  skribis:
>
>> But I wonder if it is possible now to make the packages part use any of the 
>> Postgres databases that already exist and allow traditional search without 
>> JavaScript...
>
> Former Outreachy intern Danjela Lura, together with Chris Baines, had
> started developing a JS-free package browsing interface:
>
>   https://lists.gnu.org/archive/html/guix-devel/2020-07/msg00050.html
>
> Chris, could you tell us what the status is and what’s missing before we
> can use it on the web site?

I think it's unchanged for a while now, I've attached what's probably
the latest source code (there's not much to it).

I think the remaining work is to settle on a direction in terms of the
design and how to integrate it in to the website, and then deploy
something for real. Personally, I'm in favour of a packages.guix.gnu.org
domain which hosts the search page plus the package pages, and stopping
generating package pages with haunt.

I don't really have the time to try and move this forward myself, but I
can try and support others.

#!/usr/local/bin/guile -s
!#
(use-modules (web server)
 (web request)
 (web response)
 (web uri)
 (sxml simple)
 (web client)
 (rnrs bytevectors)
 (srfi srfi-11)
 (srfi srfi-1)
 (ice-9 match)
 (json)
 (texinfo)
 (texinfo plain-text)
 (apps aux strings)
 (apps base templates theme)
 (apps base utils)
 (apps base types)
 (apps base templates components))

(define (templatize title body)
  `(html (head (title ,title))
 (body ,@body)))

(define* (respond #:optional body #:key
  (status 200)
  (title "Packages")
  (doctype "\n")
  (content-type-params '((charset . "utf-8")))
  (content-type 'text/html)
  (extra-headers '())
  (sxml (and body (templatize title body
  (values (build-response
   #:code status
   #:headers `((content-type
. (,content-type ,@content-type-params))
   ,@extra-headers))
  (lambda (port)
(if sxml
(begin
  (if doctype (display doctype port))
  (sxml->xml sxml port))

(define (search-packages-page request body)
  (define uri-value
(let ((uri (request-uri request)))
  (if (eqv? #f (uri-query uri))
  ""
  (second
   (string-split
(uri-query
 uri)
#\=)

  (define response
(let-values
(((response-object body)
  (http-request
   (string-append

"http://data.guix.gnu.org/repository/1/branch/master/latest-processed-revision/packages.json?locale=en_US.utf8&search_query=";
uri-value 
"&field=version&field=synopsis&field=description&after_name=&limit_results=30") 
#:method 'GET)))
  (json-string->scm
   (utf8->string body

  (respond
`((link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/package.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/item-preview.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/page.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/elements.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/common.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/messages.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/navbar.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/breadcrumbs.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/buttons.css";)))
  (link (@ (rel "stylesheet") (href 
"http://guix-website-test.cbaines.net/static/base/css/footer.css";)))
  (link (@ (rel "stylesheet") (href 
"https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css";)
   (integrity 
"sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu")
   (crossorigin "anonymous")))

  ,(navbar #:active-item "packages/search")

  (div (@ (class "package-info"))
   (div (@ (class "search-container")
   (style "display: block; text-align: center;"))
(h1 "Packages")
(form (@ (style "display: inline-block; margin-right auto; 
text-align: left"))
  (input (@ (type "text")
(placeholder "Search packages")
  

Having a package browser on guix.gnu.org

2022-01-08 Thread Ludovic Courtès
Hi,

Luis Felipe  skribis:

> But I wonder if it is possible now to make the packages part use any of the 
> Postgres databases that already exist and allow traditional search without 
> JavaScript...

Former Outreachy intern Danjela Lura, together with Chris Baines, had
started developing a JS-free package browsing interface:

  https://lists.gnu.org/archive/html/guix-devel/2020-07/msg00050.html

Chris, could you tell us what the status is and what’s missing before we
can use it on the web site?

Thanks,
Ludo’.