[RFC,wwwdocs] Ditch MetaHTML and use our own Perl preprocessor

FX Coudert fxcoudert@gmail.com
Sun Sep 30 00:01:00 GMT 2007


I am in the process of rewriting the Fortran part of our website  
(http://gcc.gnu.org/), part of which consists of adding the GCC  
navigation bar. To do so, I had to install localy MetaHTML, our  
current web preprocessor, and my experiences with it have left me  
less than impressed [1].  We currently use it for including headers  
and footer, making them depend on whether we are preprocessing HTML  
or XHTML, modifying in place a few tags (<title>, <h1>, <body>) and  
adding navigation bar on files that need it.  This can easily be done  
by a simple preprocessing script, and seeing that MetaHTML was last  
released 1999 and apparently unsupported since then, I suggest that  
we do this move right now.

This patch includes the new preprocessor, changes to the script, and  
quite a few new files (footer, navigation bars, etc.) split from the  
MetaHTML file, style.mhtml.  I chose to write the preprocessor script  
in Perl, since Perl is already used for the wwwdocs/bin/preprocess  
script, so I'm sure it will be available on the webserver. The  
preprocessor does what MetaHTML was needed, but it can be extended in  
the future if we need more functionality. Also, we can in the future  
offload some of its work, such as <body> and <h1> modifications and  
part of the navigation bar to CSS, which is obviously better suited  
for the job. I intend to do so as a follow-up to the preprocessor  
change, if/when it is accepted.

This change shouldn't change the website, but I can't check since I  
don't have MetaHTML, so I'd appreciate if someone with shell access  
to the webserver could check it.  Oh, there is one thing that I  
changed: the detailled search page, http://gcc.gnu.org/search.html,  
currently has a "Database last updated YYYY-MM-DD" line that doesn't  
work (it displays "1900--"), so I removed it.

Comments are highly welcome, both on the idea itself, and on the Perl  
script (my Perl is a bit rusty since I haven't used it for years).


[1] As a record, here's what my "final" status is: in addition to  
Gerald's patch and script provided by Joel Sherrill (thanks guys), I  
needed to patch of few more (~ 15) occurences of multilines strings,  
force the Makefiles to use the version of readline included in  
metahtml instead of the system one (too recent, apparently there's  
been an ABI change), and tweak the Makefiles for the shared modules,  
which aren't portable (at least, not to Mac OS). As of yesterday,  
I've managed to compile it, but the resulting binary acts as an  
endless cpu-consuming loop. At that point, I gave up.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: www.diff
Type: application/octet-stream
Size: 30095 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070930/655bd527/attachment.obj>

More information about the Gcc-patches mailing list