Subject: CSS and XHTML

From: Michael Glaesemann <[email-masked]>
Date: Sun, 9 Nov 2003 23:30:49 +0900

Hello all!

I saw a post on pgsql-hackers from Robert Treat that made me interested 
in finding out if there's something for me to do with the 
postgresql.org site. It sounds like there are a lot of things going on: 
merging of sites, adding or increasing the multilingual capabilities, 
and reworking the backend.

I don't know specifics of what needs to be done and I'm willing to work 
on anything I'm capable of doing. One thing I am interested in doing is 
working to make the site as efficient and standards-compliant as 
possible. In particular, I'd like to see the feasibility of coding to 
the XHTML standard and moving as much presentational code to CSS as 
possible.

For the most part, this is pretty straightforward and not too 
difficult. I downloaded the site from the CVS and reworked 
cache/index.htm, postgresql.css, and page.php. I rewrote them to XHTML 
1.0 Strict and got them free of errors (using BBEdit's Check Syntax 
function) with presentation that closely matches the original. (One 
caveat: I haven't been able to connect to the database(s)—is there a 
way to do this from my development machine?—so the generated pages 
haven't included the main content. The markup generated by the 
basic.*.php scripts is all error-free.) I don't foresee any major 
problems in the rest of the site, though I have to get to know the code 
better to be sure.

I see at least two advantages for the site: (a) the resulting scripts 
are easier to read, as there is very little presentational markup 
remaining, and therefore much easier to maintain; and (b) the server 
load is substantially decreased, as less code needs to be sent to the 
client. The presention (in the css file) is cached by the clients, so 
it rarely needs to be fetched. The pages themselves are slimmed down, 
since they contain just the document structure. For example, the 
current main index page is 15.2K + .6K (postgresql.css) for a total of 
15.8K. The main index page is now 6.3K (sans news remember), and 
postgresql.css is 3.8K, for a total of 10.1K. I know we're only talking 
5K, but it's a 30% reduction in server load for the *first* page view. 
Once the CSS is cached, we're looking at a 40% reduction per page.

Of course these will change once the content. Just a rough estimate for 
the content section: 13.6K to 11.3K, so just a little savings there 
(about 15%).

Anyway, you guys probably know all this anyway. And I'm sure there are 
more critical issues to work on. But this is one thing I know I could 
work on and you can probably tell I'm kind of excited to. If you have 
any questions or would like to see the modifications, just ask. One 
thing I'd like to know is server stats (load and browser distributions, 
if it's available). And if I can help out in other ways, I'm happy to 
do that as well.

Regards,

Michael Glaesemann
grzm myrealbox com

---

From: Michael Glaesemann <[email-masked]>
Date: Sun, 9 Nov 2003 23:43:08 +0900

On Sunday, November 9, 2003, at 11:30 PM, Michael Glaesemann wrote:

>  The pages themselves are slimmed down, since they contain just the 
> document structure. For example, the current main index page is 15.2K 
> + .6K (postgresql.css) for a total of 15.8K. The main index page is 
> now 6.3K (sans news remember), and postgresql.css is 3.8K, for a total 
> of 10.1K. I know we're only talking 5K, but it's a 30% reduction in 
> server load for the *first* page view. Once the CSS is cached, we're 
> looking at a 40% reduction per page.

Where's my math! 15.8K to 6.3K is a *59%* reduction. (6.3K is 
approximately 40% of 15.8K).

Off to an auspicious start! :)

Michael

---

From: Michael Glaesemann <[email-masked]>
Date: Sun, 9 Nov 2003 23:52:07 +0900

On Sunday, November 9, 2003, at 11:30 PM, Michael Glaesemann wrote:

> For example, the current main index page is 15.2K + .6K 
> (postgresql.css) for a total of 15.8K. The main index page is now 6.3K 
> (sans news remember), and postgresql.css is 3.8K, for a total of 
> 10.1K. I know we're only talking 5K, but it's a 30% reduction in 

Michael

---

From: Jeroen Ruigrok/asmodai <[email-masked]>
Date: Sun, 9 Nov 2003 21:11:31 +0100

-On [20031109 19:42], Marc G. Fournier ([email-masked]) wrote:
>I may be thinking of something else, but isn't xHTML just a more strict
>HTML?  (ie. <TD>'s *must* have matching </TD>'s)

Basically HTML 4.01 defined in XML.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
PGP fingerprint: 2D92 980E 45FE 2C28 9DB7  9D88 97E6 839B 2EAC 625B
http://www.tendra.org/   | http://www.in-nomine.org/~asmodai/diary/
Unto the pure all things are pure...

---

From: Josh Berkus <[email-masked]>
Date: Sun, 9 Nov 2003 13:05:33 -0800

Marc, Andreas:

> > You are right, I just don't know who decides what here ;) And I don't
> > know who is responsible for the advocacy and developer sites...
>
> I'd say that Advocacy falls under Josh et al ... developer tends to be an
> enigma (nobody really maintains it) ....

Robert is the lead on Advocacy.   I've no objections to making Advocacy the 
"press" page for a united site.  However, Robert may have some objections, I 
don't know.   Robert, FWIW, taking this united approach would silence some of 
the objections of Peter and some of the other core Hackers who don't like 
advocacy in its current form.

Andreas, before we could consider merging Advocacy, though, we'd need to have 
the multi-lingualism set up.  One of the primary reasons why Advocacy is a 
seperate system is because it's in 7 langauges.

As for Techdocs ...  We really, really want to try techdocs on Bricolage, but 
Bric outputs static web pages which we would then upload.  It's possible that 
we could blend those into the main site; I'm not sure.  The issue would be 
not having Techdocs on CVS as Bric already incorporates version control.   
Also, I don't think Bric supports XHTML -- but don't quote me on that.

Also, re: the XHTML issue, are there potential browser problems?  Never forget 
the number of people in the world using I.E. 5.0 or Netscape 6.2.   There's a 
lot.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---

From: "Marc G. Fournier" <[email-masked]>
Date: Sun, 9 Nov 2003 17:28:49 -0400 (AST)

On Sun, 9 Nov 2003, Josh Berkus wrote:

> Robert is the lead on Advocacy.  I've no objections to making Advocacy
> the "press" page for a united site.  However, Robert may have some
> objections, I don't know.  Robert, FWIW, taking this united approach
> would silence some of the objections of Peter and some of the other core
> Hackers who don't like advocacy in its current form.

Just a side note ... even with a 'merged site', there should be no reason
why we can't have 'advocacy.postgresql.org' point to the lead page for
that section ... same with developer ... I think the thing I don't like
about the current advocacy site is that it doesn't have the 'glitz' that
one generally sees from a marketing perspective ...

---

From: Josh Berkus <[email-masked]>
Date: Sun, 9 Nov 2003 13:37:52 -0800

Marc,

> one generally sees from a marketing perspective ...

You and Peter need to battle it out then.   Peter doesn't like the existing 
advocacy site becuase it's too much Marketing-Speak.   I think, in a lot of 
ways, he's right; we're not a big corporation and we don't need to pretend to 
be one.   However, there are several viewpoints in this discussion and I 
think we should battle it out on -Advocacy after 7.4 releases.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---

From: Michael Glaesemann <[email-masked]>
Date: Tue, 11 Nov 2003 00:54:15 +0900

Hello all!

On Monday, November 10, 2003, at 01:46 AM, Andreas Grabmüller wrote:

> You can find some stats at
> http://www.postgresql.org/stats/

Thanks for the stats. I noticed that the Report Magic analysis dates 
from March. Is there anything more recent? Or might not it matter?

> I think it would be good to have a XHTML compatible site. But as it 
> seems the site structure will change (if we decide to merge the 
> sites), it might be better if you wait for this new structure before 
> redoing the (X)HTML to avoid double work...

I'm all for avoiding double work. When is a decision to be made on 
merging sites? With the merge, will there by a style redesign as well?

On Monday, November 10, 2003, at 04:49 AM, Andreas Grabmüller wrote:
>
> If we decide to do this changes it might be the easiest way if Michael 
> takes the current CVS source and applies the changes in test2.htm in a 
> XHTML compatible way...

> the number of people in the world using I.E. 5.0 or Netscape 6.2.   

Netscape 6.2 shouldn't be a problem at all. IE5/Win can be handled 
quite easily. As Marc pointed out, XHTML is just HTML defined as XML. 
Big differences include closing tags, lowercasing tags (XML is 
case-sensitive), and quoting attributes. Nothing really major. As such, 
any browser that can handle HTML shouldn't have a problem with XHTML.

Presentation via CSS is another thing. Briefly, really old browsers 
just don't do CSS. They'll ignore all of the presentation, but the 
content will be just fine. Very basic :) but just fine. And most recent 
browsers handle parts or most of CSS just dandy. Speaking to IE5/Win 
directly, there are well-documented ways to work around it's particular 
CSS bugs without resorting to custom pages or browser detection.

Looking at the list of browsers, the areas I'm a little concerned about 
are the ~3% using 4.x browsers, the ~3% identifying as Netscape 
compatible, and the ~3% not providing any browser identity. That's six 
percent we really don't know about, and 3% we'd probably end up hiding 
some of the CSS from.They wouldn't get the full glory of the site, but 
it wouldn't be plain Jane either. (I'm currently looking for a place to 
get a version of Netscape 4 to test with.)

There are a few identities I'm not familiar with, but they don't 
account for much (less than 1.5%). And I'm ignoring the bots and 
text-only browsers, since presentation doesn't really matter to them.

The three things on my mind are answering any other questions people 
may have, getting my computer wrapped around a more recent version of 
the code, and somehow connecting to the database or hosting a sample of 
it myself to work on the content section. And a fourth thing. I'd like 
to get people's reactions to what I've done so far and to test it with 
browsers I don't have access to (mostly the IE/Win versions, Galeon, 
and Konqueror).

Michael
grzm myrealbox com

---

From: "Dave Page" <[email-masked]>
Date: Mon, 10 Nov 2003 18:07:41 -0000 (GMT)

> from March. Is there anything more recent? Or might not it matter?

March is when the first version of the new site went live on the new
server we setup.
> merging sites? With the merge, will there by a style redesign as well?

It's not so much when we merge, but when we transition. At some point,
onece we're happy with Andreas' new framework & style, we will move to it.
Incidently, unless Andreas objects, I see no reason why you cannot submit
patches for the new code to get it up to xhtml strict if you like (though
I have to wonder if we would have to use transitional - for example, iirc
there is no nowrap in strict).
Regards, Dave.

---

From: Josh Berkus <[email-masked]>
Date: Mon, 10 Nov 2003 10:21:58 -0800

Michael,

> browsers I don't have access to (mostly the IE/Win versions, Galeon,

Gaelon & Konqueror are easy for me; I have several different versions on my 
Linux machines.   I'm also not particularly worried about the Linux geeks 
using older versions, as they (we) are used to being told to upgrade to fix 
something.  And upgrades are free.

I'd say ignore Konqueror compatibility completely, except that Safari runs 
KHMTL too.

I can also test IE 5.0 & 3.0 as well, I *think* -- I've got Win2k and Win98 on 
vmware.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---

From: Michael Glaesemann <[email-masked]>
Date: Tue, 11 Nov 2003 03:49:33 +0900

> there is no nowrap in strict).

Your right: no nowrap in Strict. However, you can set nowrap to 
elements using css, I believe.

<style type="text/css">
<!--
.nowrap { white-space:nowrap; }
-->
</style>

<table>
<tr><td>This cell should wrap normally.</td> <td class="nowrap">This 
cell won't wrap (or warp, for that matter) no matter how much text you 
put it it.</td></tr>
  </table>

.nowrap works in <table>, <tr>, and <td> tags.