This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: style.mhtml -- support both HTML and XHTML


On Mon, 28 Oct 2002, Janis Johnson wrote:
> This script apparently adds META and LINK elements that end with "/>",
> which is not valid for HTML 4.01; will you be changing those when
> generating HTML rather than XHTML?

Yup, but given the delicate nature of the preprocess script and MetaHTML
styles (a silly mistake there could deface the entire website, and apart
from gcc.gnu.org we also have www.gnu.org to worry about¹), I'm
approaching this incrementally.

The patch below, for example, avoid redefining the <html> tag when we
deal with HTML (as opposed to XHTML) pages.

> The Texinfo 4.2c pretest release fixes the problems we found for
> generating conforming HTML 4.01; will you be using it soon, or wait
> for the next formal release of Texinfo?

I'd say, let's wait for the next pretest release or release of texinfo;
as far as I understood, a full release should be available quite soon.

The following patch was tested with a full run of bin/preprocess on
gcc.gnu.org.

Gerald

CVS log:
  Refine the <html> only if dealing with XHTML pages.
  Improve a couple of comments.

Index: style.mhtml
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/style.mhtml,v
retrieving revision 1.30
diff -u -3 -p -r1.30 style.mhtml
--- style.mhtml	28 Oct 2002 19:52:13 -0000	1.30
+++ style.mhtml	29 Oct 2002 12:28:18 -0000
@@ -1,4 +1,4 @@
-;;; Default to DOCTYPE XHTML, except for the install/ pages.
+;;; Default to DOCTYPE XHTML, except for the "install/" pages.

 <set-var XHTML>
 <if <match <get-var env::PREPROCESS_FILE> "install/.*">
@@ -34,19 +34,21 @@
   >
  >

-;;; Redefine the HTML tag so that we can put XHTML tags instead.
+;;; Redefine the <html> tag so that we can put XHTML attributes inside.

-<define-container html>
-<verbatim>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-</verbatim>
-%body
-<verbatim>
-</html>
-</verbatim>
-</define-container>
+<if <var-exists XHTML>
+ <group <define-container html>
+  <verbatim>
+   <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  </verbatim>
+  %body
+  <verbatim>
+   </html>
+  </verbatim>
+ </define-container> >
+>

-;;; Redefine the HEAD tag so that we can add default <meta /> headers.
+;;; Redefine the <head> tag so that we can add default <meta /> headers.

 <define-container head>
 <verbatim>
@@ -61,7 +63,7 @@
 </verbatim>
 </define-container>

-;;; Redefine the <title> tag.
+;;; Redefine the <title> tag to comply with the GNU style.

 <define-container title>
 <verbatim><title></verbatim>
@@ -77,7 +79,7 @@
 <verbatim></h1></verbatim>
 </define-container>

-;;; Redefine the BODY tag introducing our own color scheme and adding an
+;;; Redefine the <body> tag introducing our own color scheme and adding an
 ;;; "about" link and a "last modified" at the bottom.

 <define-container body>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]