Switch DSSSL stylesheets to new layout



I have produced a patch for the DSSSL stylesheets to make them match the layout of the new XSLT stylesheets. Does it seem worth making documentation that has not been converted to XML match the style of the new documentation?

I am also looking at making a simple patch to insert an extra <meta name="generator"> tag into the HTML output that will identify which version of gtk-doc the documentation was built with (which should be helpful for tracking bugs).

James.

--
Email: james daa com au              | Linux.conf.au   http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk-doc/ChangeLog,v
retrieving revision 1.139
diff -u -p -r1.139 ChangeLog
--- ChangeLog	16 Nov 2002 17:55:24 -0000	1.139
+++ ChangeLog	26 Nov 2002 02:41:43 -0000
@@ -1,3 +1,11 @@
+2002-11-26  James Henstridge  <james daa com au>
+
+	* gtkdoc-mkhtml.in: copy the navigation images for both XML and
+	SGML cases.
+
+	* gtk-doc.dsl.in: update DSSSL stylesheets to match layout of XSL
+	ones.
+
 2002-11-16  Damon Chaplin  <damon gnome org>
 
 	* Released 0.10.
Index: gtk-doc.dsl.in
===================================================================
RCS file: /cvs/gnome/gtk-doc/gtk-doc.dsl.in,v
retrieving revision 1.14
diff -u -p -r1.14 gtk-doc.dsl.in
--- gtk-doc.dsl.in	9 Sep 2002 01:46:56 -0000	1.14
+++ gtk-doc.dsl.in	26 Nov 2002 02:41:43 -0000
@@ -31,51 +31,66 @@
 
 (define %html-ext% ".html")
 
-(define %shade-verbatim% #t)
-
+(define ($user-html-header$ #!optional
+                            (home (empty-node-list))
+                            (up (empty-node-list))
+                            (prev (empty-node-list))
+                            (next (empty-node-list)))
+  (make sequence
+    (make element gi: "STYLE"
+	  attributes: (list (list "TYPE" "text/css"))
+	  (literal ".synopsis, .classsynopsis {
+            background: #eeeeee;
+            border: solid 1px #aaaaaa;
+            padding: 0.5em;
+        }
+        .programlisting {
+            background: #eeeeff;
+            border: solid 1px #aaaaff;
+            padding: 0.5em;
+        }
+        .variablelist {
+            padding: 4px;
+            margin-left: 3em;
+        }
+        .navigation {
+            background: #ffeeee;
+            border: solid 1px #ffaaaa;
+            margin-top: 0.5em;
+            margin-bottom: 0.5em;
+        }
+        .navigation a {
+            color: #770000;
+        }
+        .navigation a:visited {
+            color: #550000;
+        }
+        .navigation .title {
+            font-size: 200%;
+        }"))))
 
 (mode book-titlepage-recto-mode
   (element title 
     (make element gi: "TABLE"
 	  attributes: (list
+		       (list "CLASS" "navigation")
 		       (list "WIDTH" %gentext-nav-tblwidth%)
-		       (list "BORDER" "0")
-		       (list "BGCOLOR" "#000000")
-		       (list "CELLPADDING" "1")
+		       (list "CELLPADDING" "2")
 		       (list "CELLSPACING" "0"))
 	  (make element gi: "TR"
 		(make element gi: "TH"
 		      attributes: (list
 				   (list "ALIGN" "center")
-				   (list "VALIGN" "center"))
-		      (make element gi: "FONT"
-			    attributes: (list
-					 (list "COLOR" "#FFFFFF")
-					 (list "SIZE" "7"))
-			    (make element gi: "P"
-				  attributes: (list (list "CLASS" (gi)))
-				  (make element gi: "A"
-					attributes: (list (list "NAME" (element-id)))
-					(process-children-trim)))))))))
+				   (list "VALIGN" "MIDDLE"))
+		      (make element gi: "P"
+			    attributes: (list (list "CLASS" (gi)))
+			    (process-children-trim)
+			    (make empty-element gi: "A"
+				  attributes: (list (list "NAME" (element-id))))))))))
 
 (define (book-titlepage-separator side)
   (empty-sosofo))
 
-;; I want to change this so that for programlisting we use a blue background,
-;; but for example or informalexample we use green.
-(define ($shade-verbatim-attr$)
-  ;; Attributes used to create a shaded verbatim environment.
-  (let* ((wrapper-gi (gi (parent (current-node))))
-	 (bgcolor (if (or (equal? wrapper-gi (normalize "example"))
-			  (equal? wrapper-gi (normalize "informalexample")))
-		      "#D8F8D8"
-		      "#D6E8FF")))
-    (list
-     (list "BORDER" "0")
-     (list "BGCOLOR" bgcolor)
-     (list "WIDTH" ($table-width$))
-     (list "CELLPADDING" "6"))))
-
 
 ;; This overrides the variablelist definition (copied from 1.76,
 ;; dblists.dsl).  It changes the table background color, cell spacing
@@ -83,18 +98,6 @@
 ;;
 ;; I have also removed the code to handle the non-table case.
 (element variablelist
-  (let* ((roleattr (attribute-string (normalize "role") (current-node)))
-	 ;; FIXME: I thought that I should use normalize ("params") etc. here,
-	 ;; but that doesn't work. Anyone know why?
-	 (bgcolor (cond ((equal? roleattr "params")
-			 '(("BGCOLOR" "#FFD0D0")))
-			((equal? roleattr "struct")
-			 '(("BGCOLOR" "#FFF0D0")))
-			((equal? roleattr "enum")
-			 '(("BGCOLOR" "#F0F0D0")))
-			(else
-			 '()))))
-
     (make sequence
       (if %spacing-paras%
           (make element gi: "P" (empty-sosofo))
@@ -102,20 +105,17 @@
       (para-check)
 
       (make element gi: "TABLE"
-            attributes: (append
-                         '(("CLASS" "VARIABLELIST")
-                           ("BORDER" "0")
-                           ("CELLSPACING" "0")
-                           ("CELLPADDING" "4")
-                           ("WIDTH" "100%"))
-                          bgcolor)
+            attributes: '(("CLASS" "variablelist")
+			  ("BORDER" "0")
+			  ("CELLSPACING" "0")
+			  ("CELLPADDING" "4"))
             (if %html40%
                 (make element gi: "TBODY"
                       (with-mode variablelist-table
                         (process-children)))
                 (with-mode variablelist-table
                   (process-children))))
-      (para-check 'restart))))
+      (para-check 'restart)))
 
 (mode variablelist-table
   (element (variablelist title)
@@ -135,17 +135,15 @@
 
       (make element gi: "TR"
             (make element gi: "TD"
-                  attributes: '(("ALIGN" "RIGHT")
-                                ("VALIGN" "TOP")
-                                ("WIDTH" "20%"))
+                  attributes: '(("ALIGN" "LEFT")
+                                ("VALIGN" "TOP"))
                   (make empty-element gi: "A"
                         attributes: (list
                                      (list "NAME" (element-id))))
                   (process-node-list terms))
             (make element gi: "TD"
                   attributes: '(("ALIGN" "LEFT")
-                                ("VALIGN" "TOP")
-                                ("WIDTH" "80%"))
+                                ("VALIGN" "TOP"))
                   (process-node-list listitem)))))
   
   (element (varlistentry term)
@@ -287,252 +285,148 @@
 ;; I want 'Home' and 'Up' links at the top of each page, and white text on
 ;; black.
 (define (default-header-nav-tbl-noff elemnode prev next prevsib nextsib)
-  (let* ((r1? (nav-banner? elemnode))
-	 (r1-sosofo (make element gi: "TR"
-			  (make element gi: "TH"
-				attributes: (list
-					     (list "COLSPAN" "4")
-					     (list "ALIGN" "center"))
-				(make element gi: "FONT"
-				      attributes: (list
-						   (list "COLOR" "#FFFFFF")
-						   (list "SIZE" "5"))
-				      (nav-banner elemnode)))))
-	 (r2? (or (not (node-list-empty? prev))
-		  (not (node-list-empty? next))
-		  (nav-context? elemnode)))
-	 (r2-sosofo (make element gi: "TR"
-			  (make element gi: "TD"
-				attributes: (list
-					     (list "WIDTH" "25%")
-					     (list "BGCOLOR" "#C00000")
-					     (list "ALIGN" "left"))
-				(if (node-list-empty? prev)
-				    (make entity-ref name: "nbsp")
-				    (make element gi: "A"
+  (let* ((up (parent elemnode))
+	 (home (nav-home elemnode))
+	 (show-title? (nav-banner? elemnode))
+	 (title-sosofo
+	      (make element gi: "TH"
+		    attributes: (list
+				 (list "WIDTH" "100%")
+				 (list "align" "center"))
+		    (if show-title?
+			(nav-banner elemnode)
+			(empty-sosofo))))
+	 (show-banner? (or show-title?
+			   (not (node-list-empty? prev))
+			   (not (node-list-empty? next))
+			   (nav-context? elemnode)))
+	 (banner-sosofo
+	      (make element gi: "TR"
+		    attributes: (list
+				 (list "VALIGN" "middle"))
+		    (if (not (node-list-empty? prev))
+			(make element gi: "TD"
+			      (make element gi: "A"
+				    attributes: (list
+						 (list "ACCESSKEY" "p")
+						 (list "HREF"
+						       (href-to prev)))
+				    (make empty-element gi: "IMG"
+					  attributes: (list
+						       (list "SRC" "left.png")
+						       (list "WIDTH" "24")
+						       (list "HEIGHT" "24")
+						       (list "BORDER" "0")
+						       (list "ALT" "Prev")))))
+			(empty-sosofo))
+		    (if (nav-up? elemnode)
+			(make element gi: "TD"
+			      (make element gi: "A"
+				    attributes: (list
+						 (list "ACCESSKEY" "u")
+						 (list "HREF"
+						       (href-to up)))
+				    (make empty-element gi: "IMG"
+					  attributes: (list
+						       (list "SRC" "up.png")
+						       (list "WIDTH" "24")
+						       (list "HEIGHT" "24")
+						       (list "BORDER" "0")
+						       (list "ALT" "Up")))))
+			(empty-sosofo))
+		    (if (nav-home? elemnode)
+			(make element gi: "TD"
+			      (make element gi: "A"
+				    attributes: (list
+						 (list "ACCESSKEY" "h")
+						 (list "HREF"
+						       (href-to home)))
+				    (make empty-element gi: "IMG"
 					  attributes: (list
-						       (list "HREF" 
-							     (href-to 
-							      prev)))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (gentext-nav-prev prev))))))
-			 (make element gi: "TD"
-			       attributes: (list
-					    (list "WIDTH" "25%")
-					    (list "BGCOLOR" "#0000C0")
-					    (list "ALIGN" "center"))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (nav-home-link elemnode))))
-			 (make element gi: "TD"
-			       attributes: (list
-					    (list "WIDTH" "25%")
-					    (list "BGCOLOR" "#00C000")
-					    (list "ALIGN" "center"))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (if (nav-up? elemnode)
-							  (nav-up elemnode)
-							  (make entity-ref name: "nbsp")))))
-			  (make element gi: "TD"
-				attributes: (list
-					     (list "WIDTH" "25%")
-					     (list "BGCOLOR" "#C00000")
-					     (list "ALIGN" "right"))
-				(if (node-list-empty? next)
-				    (make entity-ref name: "nbsp")
-				    (make element gi: "A"
+						       (list "SRC" "home.png")
+						       (list "WIDTH" "24")
+						       (list "HEIGHT" "24")
+						       (list "BORDER" "0")
+						       (list "ALT" "Home")))))
+			(empty-sosofo))
+		    title-sosofo
+		    (if (not (node-list-empty? next))
+			(make element gi: "TD"
+			      (make element gi: "A"
+				    attributes: (list
+						 (list "ACCESSKEY" "n")
+						 (list "HREF"
+						       (href-to next)))
+				    (make empty-element gi: "IMG"
 					  attributes: (list
-						       (list "HREF" 
-							     (href-to
-							      next)))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (gentext-nav-next next)))))))))
-    (if (or r1? r2?)
-	(make element gi: "DIV"
-	      attributes: '(("CLASS" "NAVHEADER"))
-	  (make element gi: "TABLE"
-		attributes: (list
-			     (list "WIDTH" %gentext-nav-tblwidth%)
-			     (list "BORDER" "0")
-			     (list "BGCOLOR" "#000000")
-			     (list "CELLPADDING" "1")
-			     (list "CELLSPACING" "0"))
-		(if r1? r1-sosofo (empty-sosofo))
-		(if r2? r2-sosofo (empty-sosofo))))
+						       (list "SRC" "right.png")
+						       (list "WIDTH" "24")
+						       (list "HEIGHT" "24")
+						       (list "BORDER" "0")
+						       (list "ALT" "Next")))))
+			(empty-sosofo)))))
+	 
+    (if show-banner?
+	(make element gi: "TABLE"
+	      attributes: (list
+			   (list "WIDTH" %gentext-nav-tblwidth%)
+			   (list "CLASS" "navigation")
+			   (list "SUMMARY" "Navigation header")
+			   (list "CELLPADDING" "2")
+			   (list "CELLSPACING" "2"))
+	      banner-sosofo)
 	(empty-sosofo))))
 
-
 ;; This overrides default-footer-nav-tbl (copied from 1.20, dbnavig.dsl).
 ;; It matches the header above.
 (define (default-footer-nav-tbl elemnode prev next prevsib nextsib)
-  (let ((r1? (or (not (node-list-empty? prev))
-		 (not (node-list-empty? next))
-		 (nav-home? elemnode)))
-	(r2? (or (not (node-list-empty? prev))
-		 (not (node-list-empty? next))
-		 (nav-up? elemnode)))
-
-	(r1-sosofo (make element gi: "TR"
-			  (make element gi: "TD"
-				attributes: (list
-					     (list "WIDTH" "25%")
-					     (list "BGCOLOR" "#C00000")
-					     (list "ALIGN" "left"))
-				(if (node-list-empty? prev)
-				    (make entity-ref name: "nbsp")
-				    (make element gi: "A"
-					  attributes: (list
-						       (list "HREF" 
-							     (href-to 
-							      prev)))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (gentext-nav-prev prev))))))
-			 (make element gi: "TD"
-			       attributes: (list
-					    (list "WIDTH" "25%")
-					    (list "BGCOLOR" "#0000C0")
-					    (list "ALIGN" "center"))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (nav-home-link elemnode))))
-			 (make element gi: "TD"
-			       attributes: (list
-					    (list "WIDTH" "25%")
-					    (list "BGCOLOR" "#00C000")
-					    (list "ALIGN" "center"))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (if (nav-up? elemnode)
-							  (nav-up elemnode)
-							  (make entity-ref name: "nbsp")))))
-			  (make element gi: "TD"
-				attributes: (list
-					     (list "WIDTH" "25%")
-					     (list "BGCOLOR" "#C00000")
-					     (list "ALIGN" "right"))
-				(if (node-list-empty? next)
-				    (make entity-ref name: "nbsp")
-				    (make element gi: "A"
-					  attributes: (list
-						       (list "HREF" 
-							     (href-to
-							      next)))
-					  (make element gi: "FONT"
-						attributes: (list
-							     (list "COLOR" "#FFFFFF")
-							     (list "SIZE" "3"))
-						(make element gi: "B"
-						      (gentext-nav-next next))))))))
-
-	(r2-sosofo (make element gi: "TR"
-			 (make element gi: "TD"
-			       attributes: (list
-					    (list "COLSPAN" "2")
-					    (list "ALIGN" "left"))
-			       (if (node-list-empty? prev)
-				   (make entity-ref name: "nbsp")
-				   (make element gi: "FONT"
-					 attributes: (list
-						      (list "COLOR" "#FFFFFF")
-						      (list "SIZE" "3"))
-					 (make element gi: "B"
-					       (element-title-sosofo prev)))))
-			 (make element gi: "TD"
-			       attributes: (list
-					    (list "COLSPAN" "2")
-					    (list "ALIGN" "right"))
-			       (if (node-list-empty? next)
-				   (make entity-ref name: "nbsp")
-				   (make element gi: "FONT"
-					 attributes: (list
-						      (list "COLOR" "#FFFFFF")
-						      (list "SIZE" "3"))
-					 (make element gi: "B"
-					       (element-title-sosofo next))))))))
-    (if (or r1? r2?)
-	(make element gi: "DIV"
-	      attributes: '(("CLASS" "NAVFOOTER"))
-	      (make empty-element gi: "BR"
-		    attributes: (list (list "CLEAR" "all")))
-	      (make empty-element gi: "BR")
-
-	      (make element gi: "TABLE"
-		    attributes: (list
-				 (list "WIDTH" %gentext-nav-tblwidth%)
-				 (list "BORDER" "0")
-				 (list "BGCOLOR" "#000000")
-				 (list "CELLPADDING" "1")
-				 (list "CELLSPACING" "0"))
-		    (if r1? r1-sosofo (empty-sosofo))
-		    (if r2? r2-sosofo (empty-sosofo))))
-	(empty-sosofo))))
-
-
-;; This overrides nav-up (copied from 1.20, dbnavig.dsl).
-;; We want to change the size and color of the text.
-(define (nav-up elemnode)
-  (let ((up (parent elemnode)))
-    (if (or (node-list-empty? up)
-	    (node-list=? up (sgml-root-element)))
-	(make entity-ref name: "nbsp")
-	(make element gi: "A"
-	      attributes: (list
-			   (list "HREF" (href-to up)))
-	      (make element gi: "FONT"
-		    attributes: (list
-				 (list "COLOR" "#FFFFFF")
-				 (list "SIZE" "3"))
-		    (make element gi: "B"
-			  (gentext-nav-up up)))))))
-
-;; This overrides nav-home-link (copied from 1.20, dbnavig.dsl).
-;; We want to change the size and color of the text.
-(define (nav-home-link elemnode)
-  (let ((home (nav-home elemnode)))
-    (if (node-list=? elemnode home)
-	(make entity-ref name: "nbsp")
-	(make element gi: "A"
+  (let* ((show-footer? (or (not (node-list-empty? prev))
+			  (not (node-list-empty? next))))
+	 (footer-sosofo
+	     (make element gi: "TR"
+		   attributes: (list
+				(list "VALIGN" "middle"))
+		   (make element gi: "TD"
+			 attributes: (list
+				      (list "ALIGN" "left"))
+			 (if (not (node-list-empty? prev))
+			     (make element gi: "A"
+				   attributes: (list
+						(list "ACCESSKEY" "p")
+						(list "HREF" (href-to prev)))
+				   (make element gi: "B"
+					 (make entity-ref name: "lt")
+					 (make entity-ref name: "lt")
+					 (make entity-ref name: "lt")
+					 (make entity-ref name: "nbsp")
+					 (element-title-sosofo prev)))
+			     (empty-sosofo)))
+		   (make element gi: "TD"
+			 attributes: (list
+				      (list "ALIGN" "right"))
+			 (if (not (node-list-empty? next))
+			     (make element gi: "A"
+				   attributes: (list
+						(list "ACCESSKEY" "n")
+						(list "HREF" (href-to next)))
+				   (make element gi: "B"
+					 (element-title-sosofo next)
+					 (make entity-ref name: "nbsp")
+					 (make entity-ref name: "gt")
+					 (make entity-ref name: "gt")
+					 (make entity-ref name: "gt")))
+			     (empty-sosofo))))))
+  
+    (if show-footer?
+	(make element gi: "TABLE"
 	      attributes: (list
-			   (list "HREF" 
-				 (href-to home)))
-	      (make element gi: "FONT"
-		    attributes: (list
-				 (list "COLOR" "#FFFFFF")
-				 (list "SIZE" "3"))
-		    (make element gi: "B"
-			  (gentext-nav-home home)))))))
-
-;; These override 2 functions which return the English text to use for links to
-;; previous and next pages. (copied from 1.20, dbl1en.dsl).
-(define (gentext-en-nav-prev prev) 
-  (make sequence (literal "<<< Previous Page")))
-(define (gentext-en-nav-next next)
-  (make sequence (literal "Next Page >>>")))
+			   (list "CLASS" "navigation")
+			   (list "WIDTH" %gentext-nav-tblwidth%)
+			   (list "SUMMARY" "Navigation footer")
+			   (list "CELLPADDING" "2")
+			   (list "CELLSPACING" "2"))
+	      footer-sosofo)
+	(empty-sosofo))))
 
 
 (define ($section-body$)
Index: gtkdoc-mkhtml.in
===================================================================
RCS file: /cvs/gnome/gtk-doc/gtkdoc-mkhtml.in,v
retrieving revision 1.11
diff -u -p -r1.11 gtkdoc-mkhtml.in
--- gtkdoc-mkhtml.in	10 Nov 2002 15:07:52 -0000	1.11
+++ gtkdoc-mkhtml.in	26 Nov 2002 02:41:43 -0000
@@ -35,13 +35,16 @@ fi
 
 if $is_xml; then
   @XSLTPROC@ --xinclude --stringparam gtkdoc.bookname $module $gtkdocdir/gtk-doc.xsl $document
-  cp -f $gtkdocdir/*.png .
 else
   @JADE@ -t sgml -w no-idref -d $gtkdocdir/gtk-doc.dsl \
       $gtkdocdir/gtk-doc.dcl $document
 
   sed s%href=\"%href=\"$module/% < index.sgml > index.sgml.tmp && mv index.sgml.tmp index.sgml
 fi
+
+# copy navigation images to html directory ...
+cp -f $gtkdocdir/*.png .
+
 
 echo "timestamp" > ../html.stamp
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]