Package: w3-recs
Version: 20070917-1+smcv
Severity: wishlist
Tags: patch

It's quite easy to register HTML documentation with devhelp, the GNOME
documentation browser. I attach a patch which does this for the W3C
recommendations in w3-recs.

The .devhelp file is generated in a rather simple-minded way - it treats
all the W3C RECs as a single book, with each recommendation as a chapter
and no internal links - but I think it's still useful.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (101, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.23-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

w3-recs depends on no packages.

Versions of packages w3-recs recommends:
ii  elinks [www-browser]        0.11.1-1.5   advanced text-mode WWW browser
ii  epiphany-gecko [www-browser 2.20.0-3     Intuitive GNOME web browser - Geck
ii  epiphany-webkit [www-browse 2.20.0-3     Intuitive GNOME web browser - webk
ii  iceweasel [www-browser]     2.0.0.7-2    lightweight web browser based on M
ii  netsurf [www-browser]       1.1-2        Small portable web browser with CS
ii  w3m [www-browser]           0.5.1-5.1+b1 WWW browsable pager with excellent

-- no debconf information
diff -u w3-recs-20070917/debian/rules w3-recs-20070917/debian/rules
--- w3-recs-20070917/debian/rules
+++ w3-recs-20070917/debian/rules
@@ -17,6 +17,7 @@
 XSL_IDS = xsl/grep-ids.xsl
 XSL_INDEX = xsl/deb-control-index.xsl
 XSL_HTML = xsl/gen-html-index.xsl
+XSL_DEVHELP = xsl/deb-gen-devhelp.xsl
 XSL_DOCBASE = xsl/deb-gen-doc-base.xsl
 TXT_INDEX = debian/control-index.txt
 DEST_BASEDIR = /usr/share/doc/w3-recs/html/
@@ -28,10 +29,10 @@
 
 ORIG_DIR = ../tarballs/$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)
 
-common-post-build-indep:: doc-base-stamp index.html
+common-post-build-indep:: doc-base-stamp w3-recs.devhelp index.html
 clean::
 	rm -f debian/w3-recs.doc-base.tr-*
-	rm -f doc-base-stamp index.html url-list.txt
+	rm -f doc-base-stamp index.html url-list.txt w3-recs.devhelp
 
 .PHONY: get-orig-source clean-orig-source build-orig
 get-orig-source: download
@@ -63,6 +64,10 @@
 		--stringparam format $(DOCBASE_FORMAT) \
 		$(XSL_DOCBASE) $(TR_FILE) | scripts/multiplex "debian/w3-recs.doc-base.tr-"
 
+w3-recs.devhelp: $(XSL_DEVHELP) $(TR_FILE)
+	$(XSLT) \
+		$^ | xmllint --format - > $@
+
 index.html: $(XSL_HTML) $(TR_FILE)
 	$(XSLT) \
 		--stringparam basepath $(DOC_BASEPATH) \
diff -u w3-recs-20070917/debian/w3-recs.install w3-recs-20070917/debian/w3-recs.install
--- w3-recs-20070917/debian/w3-recs.install
+++ w3-recs-20070917/debian/w3-recs.install
@@ -2,0 +3 @@
+w3-recs.devhelp		/usr/share/doc/w3-recs/html/
only in patch2:
unchanged:
--- w3-recs-20070917.orig/debian/w3-recs.links
+++ w3-recs-20070917/debian/w3-recs.links
@@ -0,0 +1 @@
+/usr/share/doc/w3-recs/html /usr/share/devhelp/books/w3-recs
only in patch2:
unchanged:
--- w3-recs-20070917.orig/xsl/deb-gen-devhelp.xsl
+++ w3-recs-20070917/xsl/deb-gen-devhelp.xsl
@@ -0,0 +1,44 @@
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+    xmlns:exslt="http://exslt.org/common";
+    xmlns:str="http://exslt.org/strings";
+    xmlns:dc="http://purl.org/dc/elements/1.1/";
+    xmlns:rec="http://www.w3.org/2001/02pd/rec54#";
+    exclude-result-prefixes="rec dc exslt str">
+
+  <xsl:import href="w3-tr-lib.xsl" />
+  <xsl:output mode="xml" encoding="utf-8" />
+
+  <xsl:template match="/">
+    <xsl:variable name="trs"> <!-- selected technical reports -->
+      <xsl:call-template name="find_trs" />
+    </xsl:variable>
+
+    <book title="W3C Recommendations" name="W3C Recs" version="" link="index.html">
+      <chapters>
+        <xsl:apply-templates select="exslt:node-set($trs)/*">
+	  <xsl:sort select="normalize-space(dc:title)" />
+	</xsl:apply-templates>
+      </chapters>
+    </book>
+
+  </xsl:template>
+
+  <xsl:template match="rec:REC">
+    <xsl:variable name="title">
+      <xsl:call-template name="title_of_tr">
+        <xsl:with-param name="rec" select="." />
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="docpath">
+      <xsl:call-template name="path_of_tr">
+        <xsl:with-param name="rec" select="." />
+        <xsl:with-param name="basepath" select="'.'" />
+      </xsl:call-template>
+    </xsl:variable>
+
+    <sub link="{str:replace($docpath, './html/', '')}index.html" name="{$title}" />
+  </xsl:template>
+
+</xsl:stylesheet>

Attachment: signature.asc
Description: Digital signature

Reply via email to