9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] complaints about new web site
@ 2006-01-27 17:21 Russ Cox
  2006-01-27 17:38 ` erik quanstrom
  2006-01-27 18:42 ` Sascha Retzki
  0 siblings, 2 replies; 7+ messages in thread
From: Russ Cox @ 2006-01-27 17:21 UTC (permalink / raw)
  To: 9fans

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6472 bytes --]

It's probably a very good sign that the only actual complaints we've
gotten about the web site have been about how ugly the HTML
source is.  Hopefully that's the biggest problem it has.

The web site is generated from troff sources by a new program
called htmlroff, which I mentioned in an earlier post and which
will appear on sources once I document it.  Representative commands
are:

	htmlroff -mhtml glenda.tr >glenda.html
	pic utf.ms | tbl | eqn | htmlroff -ms -mhtml >utf.html

There are very small changes to the ms macros to accomodate htmlroff,
but for the most part it can make do with regular troff input.
Htmlroff does allow longer macro, string, and number names, in the
style of groff, so that it is easier to avoid stepping on regular troff
names.

The documents themselves hardly changed:

	% yesterday -d -0101 sam.ms
	diff -n /n/dump/2006/0101/sys/doc/sam/sam.ms /sys/doc/sam/sam.ms
	/n/dump/2006/0101/sys/doc/sam/sam.ms:0 a /sys/doc/sam/sam.ms:1
	> .HTML "The Text Editor sam
	/n/dump/2006/0101/sys/doc/sam/sam.ms:21 a /sys/doc/sam/sam.ms:23,26
	> .de XP
	> .ie h .html - <center><img src="sam.\\$1.png" /></center>
	> .el .BP \\$1.ps \\$2
	> ..
	/n/dump/2006/0101/sys/doc/sam/sam.ms:258 c /sys/doc/sam/sam.ms:263
	< .BP fig1.ps 3.5i
	---
	> .XP fig1 3.5i
	/n/dump/2006/0101/sys/doc/sam/sam.ms:1275 c /sys/doc/sam/sam.ms:1280
	< .BP fig3.ps 2.04i
	---
	> .XP fig3 2.04i
	/n/dump/2006/0101/sys/doc/sam/sam.ms:1360 c /sys/doc/sam/sam.ms:1365
	< .BP fig2.ps 2.74i
	---
	> .XP fig2 2.74i
	/n/dump/2006/0101/sys/doc/sam/sam.ms:1452 c /sys/doc/sam/sam.ms:1457
	< .BP fig4.ps 1.20i
	---
	> .XP fig4 1.20i
	% 

is typical.

> however the source (troff and html) looks terrible

The whole point of having computer-generated HTML is that you don't
ever have to see it.  Yes it looks terrible, but it looked terrible before too.
Even if you run it through tidy or some other HTML reformatted, it will
still look terrible!  You get seduced by the pretty formatting into thinking
it doesn't.  Format this:

	<a href="/magic/man2html/1/cat">cat</a><i>(1)</i>

however you want, but the fact remains that I shouldn't have to scribble
that whole thing out every single time I refer to a man page.  
When I put htmlroff on sources, if someone wants to make the HTML
output look prettier inside, then have at it.

Troff, on the other hand, is just as arcane but lets you build up to 
what you're trying to get done.  Yes, the troff versions do look like troff,
but once you get past that, you get some significant benefits. 
Most important, I can write macros to avoid writing out things like
the above.  So I can write

	.MAN cat 1

which is many times nicer and doesn't need to be changed when
the format or the URL of a manual page reference changes.

Look, for example, at http://plan9.bell-labs.com/plan9/glenda.tr:

	.so macs
	.HTML "Glenda, the Plan 9 Bunny
	.TL
	Glenda, the Plan 9 Bunny
	.PP
	.html - <center><img src="img/9logo.jpg" alt="Logo" />
	.PP
	The logo above is scanned from the original drawing of Glenda,
	the Plan 9 bunny, and appears on your screen at roughly the size
	of the original drawing.
	.HR http://www.reneefrench.com/ "Renée French
	drew Glenda.  When we needed higher-resolution
	drawings, she made a much larger drawing,
	which was scanned, tweaked, and made into two versions,
	one with a white background and one with a black background.
	High-resolution JPEGs of these versions are available by clicking
	on the images below.
	.PP
	Feel free to use these images to make t-shirts and other paraphernalia,
	but if you do a production run, please send us a sample for our collection.
	.PP
	.sp 2
	.html t <center><table><tr>
	.de td
	.html - <td><a href="/plan9/img/\\$1.jpg">\
		<img src="/plan9/img/\\$2.jpg" alt="\\$3" border=0 />
	..
	.td plan9bunnywhite plan9bunnysmwhite "White Bunny
	.td plan9bunnyblack plan9bunnysmblack "Black Bunny
	.td spaceglenda300 spaceglenda37 "Space Bunny
	.html t

or http://plan9.bell-labs.com/plan9/screenshot.tr:

	.so macs
	.HTML "Plan 9 Screen Shot
	.TL
	Plan 9 Screen Shot
	.PP
	.html - <center><a href="img/screenshot.gif">\
		<img src="img/screenshot-small.png" alt="Screen Shot" />
	.sp
	.PP
	This is a 1024x768 screen in 8-bit colormapped mode.
	.sp
	A multi-level MIME message containing a JPEG has just arrived; the structure
	of the message is visible in the Acme mail directory on the right-hand side.
	The graphical programs displayed are:
	the mail announcer
	.MAN faces 1 ,
	the system statistics watcher
	.MAN stats 8 ,
	the text editor
	.MAN acme 1 ,
	the sky catalog
	.MAN scat 1 ,
	the image viewer
	.MAN page 1
	(showing
	.HR glenda.html glenda ),
	and the window system
	.MAN rio 1 .
	Acme is running Mail, which uses the mail file system
	.HR /magic/man2html/4/upasfs \fIupas/fs\fP(4).
	Acme is also editing the
	.HR /magic/man2html/6/plumb \fIrules\fP
	for 
	.MAN plumber 4 .
	.sp
	Additional screen shots are linked on the
	.HR /wiki/plan9/screenshots wiki .

and since the pages all share the same macros, they have a consistent look.

Also, I don't have to write HTML tags, and more importantly I don't have to
close them.  The general form of the .html macro used above is:

	.html id <any html>

It prints <any html> and remembers that the HTML is open.  The next
.html id line will close the corresponding HTML (with the same id!)
before printing anything new.  The special case of id = "-" means 
close immediately.  So for example the ".html t" that ends 
glenda.tr closes the center and table tags that opened earlier.

If the web pages don't look right in some browser, then I'm
happy to accomodate that.  Like Opera:

> Nixing the <center> and having
> 
> <table cellspacing=0 cellpadding=5 bgcolor="#eeeeff"><tr>
> <td align="center" valign="top">
> <pre>
> [...]
> 
> would probably fix it.  The <center> tag is deprecated nowadays anyway.

The <center> tag isn't the problem.  Opera is broken.  If I do this:

	<table cellspacing=0 cellpadding=5 bgcolor="#eeeeff"><tr>
	<td align="center" valign="top">
	<pre>

then Opera still centers the text inside the <pre>!  You have to use:

	<table width="100%" cellspacing=0 border=0><tr><td align="center">
	<table cellspacing=0 cellpadding=5 bgcolor="#eeeeff"><tr><td align="left">
	<pre>

to make Opera center a block. 

Russ


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

end of thread, other threads:[~2006-01-28 18:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-27 17:21 [9fans] complaints about new web site Russ Cox
2006-01-27 17:38 ` erik quanstrom
2006-01-27 18:42 ` Sascha Retzki
2006-01-27 19:04   ` Russ Cox
2006-01-28  8:52     ` Sascha Retzki
2006-01-28 14:18       ` Russ Cox
2006-01-28 18:41         ` uriel

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 NNTP newsgroup(s).