unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Replace current guix website package interface with hpcguix-web?
@ 2022-01-05 23:52 kiasoc5--- via Development of GNU Guix and the GNU System distribution.
  2022-01-06 13:47 ` Luis Felipe
  0 siblings, 1 reply; 7+ messages in thread
From: kiasoc5--- via Development of GNU Guix and the GNU System distribution. @ 2022-01-05 23:52 UTC (permalink / raw)
  To: guix-devel

Dear Guixers,

The hpcguix-web package interface (https://hpc.guix.info/browse)  supports package search, unlike the current one at https://guix.gnu.org/en/packages/. Plus imo hpcguix-web looks nicer.

 It would be a great UI/UX improvement if the current search was replaced with hpcguix-web. Has this been considered before?

Thanks,
kiasoc5


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Replace current guix website package interface with hpcguix-web?
  2022-01-05 23:52 Replace current guix website package interface with hpcguix-web? kiasoc5--- via Development of GNU Guix and the GNU System distribution.
@ 2022-01-06 13:47 ` Luis Felipe
  2022-01-08 21:41   ` Having a package browser on guix.gnu.org Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Felipe @ 2022-01-06 13:47 UTC (permalink / raw)
  To: kiasoc5; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 930 bytes --]

On Wednesday, January 5th, 2022 at 11:52 PM, kiasoc5--- via "Development of GNU Guix and the GNU System distribution." <guix-devel@gnu.org> wrote:

> Dear Guixers,
> 

> The hpcguix-web package interface (https://hpc.guix.info/browse) supports package search, unlike the current one at https://guix.gnu.org/en/packages/. Plus imo hpcguix-web looks nicer.
> 

> It would be a great UI/UX improvement if the current search was replaced with hpcguix-web. Has this been considered before?

Yes. It just needs to be done :)

One thing that would have to be addressed, though, is that the package list view of hpcguix-web seems to work only for JavaScript-enabled browsers. So if you are browsing with, say, Lynx, you don't have a way to discover packages.

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...

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Having a package browser on guix.gnu.org
  2022-01-06 13:47 ` Luis Felipe
@ 2022-01-08 21:41   ` Ludovic Courtès
  2022-01-09 19:53     ` Christopher Baines
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2022-01-08 21:41 UTC (permalink / raw)
  To: Luis Felipe; +Cc: guix-devel, kiasoc5

Hi,

Luis Felipe <luis.felipe.la@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

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

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Having a package browser on guix.gnu.org
  2022-01-08 21:41   ` Having a package browser on guix.gnu.org Ludovic Courtès
@ 2022-01-09 19:53     ` Christopher Baines
  2022-01-09 23:32       ` Luis Felipe
  2022-01-18 14:04       ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Christopher Baines @ 2022-01-09 19:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, kiasoc5


[-- Attachment #1.1: Type: text/plain, Size: 1152 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

> Luis Felipe <luis.felipe.la@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
>
> 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.


[-- Attachment #1.2: search.scm --]
[-- Type: text/plain, Size: 6305 bytes --]

#!/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 "<!DOCTYPE html>\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")
                                (name "search")))
                      (button (@ (class "btn btn-primary pull-right")
                                 (type "submit"))
                              '((span (@ (class "glyphicon glyphicon-search")
                                         (aria-hidden "true")))))))
           ,@(match response
               ((packages _)
                (map
                 (match-lambda
                   ((description synopsis version name)
                    (let ((package-name (cdr name))
                          (package-version (cdr version))
                          (package-synopsis (match synopsis
                                              ((synopsis locale plain html source)
                                               (cdr source))))
                          (package-description (match description
                                                 ((description locale plain html source)
                                                  (cdr source)))))
                      `(a
                        (@ (class "item-preview")
                           (href ,(string-append "http://guix-website-test.cbaines.net/packages/"
                                                 (string-append package-name "-" package-version))))
                        (h3 ,package-name " " ,package-version)
                        (p
                         (@ (class "item-summary"))
                         ,(string-summarize
                           (stexi->plain-text (texi-fragment->stexi package-description))
                           30)
                         "…")))))
                 (vector->list
                  (cdr packages))))))

      (footer
       "Made with " (span (@ (class "metta")) "♥")
       " by humans and powered by "
       (a (@ (class "link-yellow") (href ,(gnu-url "software/guile/")))
          "GNU Guile") ".  "
          (a
           (@ (class "link-yellow")
              (href "//git.savannah.gnu.org/cgit/guix/guix-artwork.git/tree/website"))
           "Source code")
          " under the "
          (a
           (@ (class "link-yellow")
              (href ,(gnu-url "licenses/agpl-3.0.html")))
           "GNU AGPL") "."))))

(run-server search-packages-page 'http '(#:port 8765))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Having a package browser on guix.gnu.org
  2022-01-09 19:53     ` Christopher Baines
@ 2022-01-09 23:32       ` Luis Felipe
  2022-01-18 14:05         ` Ludovic Courtès
  2022-01-18 14:04       ` Ludovic Courtès
  1 sibling, 1 reply; 7+ messages in thread
From: Luis Felipe @ 2022-01-09 23:32 UTC (permalink / raw)
  To: Christopher Baines; +Cc: Ludovic Courtès, kiasoc5, guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1480 bytes --]

On Sunday, January 9th, 2022 at 7:53 PM, Christopher Baines <mail@cbaines.net> wrote:

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

> > Luis Felipe luis.felipe.la@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.

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Having a package browser on guix.gnu.org
  2022-01-09 19:53     ` Christopher Baines
  2022-01-09 23:32       ` Luis Felipe
@ 2022-01-18 14:04       ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2022-01-18 14:04 UTC (permalink / raw)
  To: Christopher Baines; +Cc: guix-devel, kiasoc5

Hi,

Christopher Baines <mail@cbaines.net> skribis:

> Ludovic Courtès <ludo@gnu.org> 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’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Having a package browser on guix.gnu.org
  2022-01-09 23:32       ` Luis Felipe
@ 2022-01-18 14:05         ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2022-01-18 14:05 UTC (permalink / raw)
  To: Luis Felipe; +Cc: guix-devel, kiasoc5

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

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

Yay!

Ludo'.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-18 15:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 23:52 Replace current guix website package interface with hpcguix-web? kiasoc5--- via Development of GNU Guix and the GNU System distribution.
2022-01-06 13:47 ` Luis Felipe
2022-01-08 21:41   ` Having a package browser on guix.gnu.org Ludovic Courtès
2022-01-09 19:53     ` Christopher Baines
2022-01-09 23:32       ` Luis Felipe
2022-01-18 14:05         ` Ludovic Courtès
2022-01-18 14:04       ` Ludovic Courtès

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).