public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* /packages CGI HTML modernization
@ 2014-06-19 15:51 Warren Young
  2014-06-20  4:43 ` Achim Gratz
  0 siblings, 1 reply; 5+ messages in thread
From: Warren Young @ 2014-06-19 15:51 UTC (permalink / raw)
  To: Cygwin Patches

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

The current CGI code that generates the package and file lists for 
http://cygwin.com/packages emits highly redundant HTML, and it is laid 
out using a huge slow-to-render table.  The attached patch shows a 
minimal way to use <ul> instead of <table>, along with some CSS and JS 
to style it in a similar way to the current look.

If JavaScript is verboten on cygwin.com, you can empirically find an 
appropriate value for the width of the package name column and put that 
in the CSS:

     ul.pkglist span {
         float: left;
         width: 185px;
     }

All the jQuery code does is find that width value programmatically, 
which makes it robust in the face of different font sizes and such.

I have also attached a simple example HTML and CSS file, which show the 
basic idea of the change with all the distractions of the real /packages 
page stripped away.  Just put packages.* in a directory and open 
packages.html in your favorite browser.

I lack the ability to generate packages.inc here, but I expect applying 
the same concept to that script as well will have a measurable effect on 
the load time of cygwin.com/packages.  I expect it to roughly halve the 
size of the file and measurably reduce the page render time.

The contents of the attached CSS file should be inserted into one of 
cygwin.com's normal CSS files.

(I've attached all this as a tarball only to placate the text/html MIME 
filter on this list.)

[-- Attachment #2: pg-html5.tar.xz --]
[-- Type: application/octet-stream, Size: 1288 bytes --]

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

end of thread, other threads:[~2014-06-20 17:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 15:51 /packages CGI HTML modernization Warren Young
2014-06-20  4:43 ` Achim Gratz
2014-06-20 16:54   ` Warren Young
2014-06-20 17:09     ` Warren Young
2014-06-20 17:11       ` Christopher Faylor

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