diff options
author | Rob Austein <sra@hactrn.net> | 2010-04-16 22:07:15 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-04-16 22:07:15 +0000 |
commit | 27f1137ac1e65d5bc1e21d43c9bdf6166dce6bb0 (patch) | |
tree | 6d869598505fa6facbfcbbfcb2da172bd30b9c22 /rpkid/doc/tweak-doc.xsl | |
parent | a2c9b2e8b342915e635d58b16f260a548e09cf1e (diff) |
Use html2text instead of lynx for dumping doc to flat text
svn path=/rpkid/Makefile; revision=3208
Diffstat (limited to 'rpkid/doc/tweak-doc.xsl')
-rw-r--r-- | rpkid/doc/tweak-doc.xsl | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/rpkid/doc/tweak-doc.xsl b/rpkid/doc/tweak-doc.xsl index a168e25b..04308c8b 100644 --- a/rpkid/doc/tweak-doc.xsl +++ b/rpkid/doc/tweak-doc.xsl @@ -1,7 +1,7 @@ <!-- $Id$ - - Suppress bits of HTML that we want filtered out before running - - through lynx -dump to get flat text. + - through html2text to get flat text. - - Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC") - @@ -35,33 +35,11 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <!-- - - Suppress navigational elements that have no place in flat text. + - Suppress elements that have no place in flat text. --> - <xsl:template match="div[@class = 'navigation' or @id = 'MSearchSelectWindow']"/> - - <!-- - - Add null p element after p element immediately followed by ul - - element, or p element immediately followed by div element - - containing verbatim fragment. This is sick, but fakes lynx - - into producing more reasonable output, which is all we really - - care about here. - --> - <xsl:template match="p[(name(following-sibling::*[1]) = 'ul') or - (name(following-sibling::*[1]) = 'div' and - following-sibling::*[1]/@class = 'fragment')]"> - <p><xsl:apply-templates/></p> - <p/> - </xsl:template> - - <!-- - - Add delimiters around code examples. - --> - <xsl:template match="div[@class = 'fragment']" mode="disabled"> - <p>================================================================</p> - <p/> - <xsl:call-template name="identity"/> - <p>================================================================</p> - </xsl:template> + <xsl:template match="div[@class = 'navigation' or @id = 'MSearchSelectWindow'] | + hr[@class = 'footer'] | + body/address[count(following-sibling::*) = 0]"/> <!-- - Copy everything else unmodified (XSL "identity" template). |