diff options
Diffstat (limited to 'doc/html2texi.xsl')
-rw-r--r-- | doc/html2texi.xsl | 367 |
1 files changed, 0 insertions, 367 deletions
diff --git a/doc/html2texi.xsl b/doc/html2texi.xsl deleted file mode 100644 index dc432c6..0000000 --- a/doc/html2texi.xsl +++ /dev/null @@ -1,367 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet - version="1.0" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:html="http://www.w3.org/1999/xhtml" - xmlns:info="http://planete-kraus.eu/ns/info"> - - <xsl:output method="text"/> - - <xsl:template match="html:html"> - <xsl:text>\input texinfo @c -*-texinfo-*-
</xsl:text> - <xsl:text>@comment $Id@w{$}
</xsl:text> - <xsl:if test="@xml:lang"> - <xsl:text>@documentlanguage </xsl:text> - <xsl:value-of select="@xml:lang" /> - <xsl:text>
</xsl:text> - </xsl:if> - <xsl:apply-templates select="html:head" /> - <xsl:text>@contents
</xsl:text> - <xsl:apply-templates select="html:body" /> - <xsl:text>@bye
</xsl:text> - </xsl:template> - - <xsl:template match="html:head"> - <xsl:text>@comment %**start of header
</xsl:text> - <xsl:text>@include version.texi
</xsl:text> - <xsl:text>@settitle </xsl:text> - <xsl:apply-templates select="html:title" /> - <xsl:text>
</xsl:text> - <xsl:text>@syncodeindex pg cp
</xsl:text> - <xsl:text>@syncodeindex fn cp
</xsl:text> - <xsl:text>@syncodeindex vr cp
</xsl:text> - <xsl:text>@syncodeindex tp cp
</xsl:text> - <xsl:text>@comment %**end of header
</xsl:text> - <xsl:text>
</xsl:text> - <xsl:apply-templates select="info:copying" /> - <xsl:text>
</xsl:text> - <xsl:apply-templates select="info:dircategory" /> - <xsl:text>
</xsl:text> - <xsl:apply-templates select="info:direntry" /> - <xsl:text>
</xsl:text> - <xsl:text>@titlepage
</xsl:text> - <xsl:text>@title </xsl:text> - <xsl:apply-templates select="html:title" /> - <xsl:text>
</xsl:text> - <xsl:text>@subtitle for version @value{VERSION}, @value{UPDATED}
</xsl:text> - <xsl:text>@author </xsl:text> - <xsl:apply-templates select="info:author" /> - <xsl:text>
</xsl:text> - <xsl:text>@page
</xsl:text> - <xsl:text>@vskip 0pt plus 1fill
</xsl:text> - <xsl:text>@insertcopying
</xsl:text> - <xsl:text>@end titlepage
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:copying"> - <xsl:text>@copying
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end copying
</xsl:text> - </xsl:template> - - <xsl:template match="info:quotation"> - <xsl:text>@quotation
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end quotation
</xsl:text> - </xsl:template> - - <xsl:template match="info:version"> - <xsl:text>@value{VERSION}</xsl:text> - </xsl:template> - - <xsl:template match="info:updated"> - <xsl:text>@value{UPDATED}</xsl:text> - </xsl:template> - - <xsl:template match="info:copyright-symbol"> - <xsl:text>@copyright{}</xsl:text> - </xsl:template> - - <xsl:template match="info:dircategory"> - <xsl:text>@dircategory </xsl:text> - <xsl:apply-templates /> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:direntry"> - <xsl:text>@direntry
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end direntry
</xsl:text> - </xsl:template> - - <xsl:template match="info:direntry-entry"> - <xsl:text>* </xsl:text> - <xsl:value-of select="@name" /> - <xsl:text>: (</xsl:text> - <xsl:value-of select="@name" /> - <xsl:text>)</xsl:text> - <xsl:apply-templates /> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:author"> - <xsl:apply-templates /> - </xsl:template> - - <xsl:template match="html:a[starts-with(@href, 'mailto:')]"> - <xsl:apply-templates /> - <xsl:text> (@email{</xsl:text> - <xsl:variable name="address" select="substring-after(@href, 'mailto:')" /> - <xsl:value-of select="substring-before($address, '@')" /> - <xsl:text>@@</xsl:text> - <xsl:value-of select="substring-after($address, '@')" /> - <xsl:text>})</xsl:text> - </xsl:template> - - <xsl:template match="html:body"> - <xsl:text>@ifnottex
</xsl:text> - <xsl:text>@node Top
</xsl:text> - <xsl:text>@top Webid-oidc
</xsl:text> - <xsl:apply-templates select="child::*[not(self::html:h1) and count(preceding-sibling::html:h1) = 0]" /> - <xsl:text>@end ifnottex
</xsl:text> - <xsl:text>
</xsl:text> - <xsl:text>@menu
</xsl:text> - <xsl:apply-templates mode="menu" select="html:h1" /> - <xsl:text>@end menu
</xsl:text> - <xsl:text>
</xsl:text> - <xsl:apply-templates select="child::*[self::html:h1 or count(preceding-sibling::html:h1) >= 1]" /> - </xsl:template> - - <xsl:template match="*" mode="menu"> - <xsl:text>* </xsl:text> - <xsl:apply-templates /> - <xsl:text>::
</xsl:text> - </xsl:template> - - <xsl:template match="html:h1"> - <xsl:text>@node </xsl:text> - <xsl:apply-templates /> - <xsl:text>
</xsl:text> - <xsl:text>@</xsl:text> - <xsl:choose> - <xsl:when test="@type"> - <xsl:value-of select="@type" /> - </xsl:when> - <xsl:otherwise> - <xsl:text>chapter</xsl:text> - </xsl:otherwise> - </xsl:choose> - <xsl:text> </xsl:text> - <xsl:apply-templates /> - <xsl:text>
</xsl:text> - <xsl:text>
</xsl:text> - <xsl:variable name="chapter-number" - select="count(preceding-sibling::html:h1) + 1" /> - <xsl:if test="count(following-sibling::html:h2[count(preceding-sibling::html:h1) = $chapter-number]) > 0"> - <!-- There are sub-sections; we need a menu --> - <xsl:text>@menu
</xsl:text> - <xsl:apply-templates mode="menu" - select="following-sibling::html:h2[count(preceding-sibling::html:h1) = $chapter-number]" /> - <xsl:text>@end menu
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:if> - </xsl:template> - - <xsl:template match="html:h2"> - <xsl:text>@node </xsl:text> - <xsl:apply-templates /> - <xsl:text>
</xsl:text> - <xsl:text>@section </xsl:text> - <xsl:apply-templates /> - <xsl:text>
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="text()"> - <!-- Normalize the spaces, but keep one space before or after if - needed --> - <xsl:variable name="normalized" select="normalize-space(.)" /> - <xsl:variable name="first-char"> - <xsl:value-of select="substring(., 1, 1)" /> - </xsl:variable> - <xsl:variable name="last-char"> - <xsl:value-of select="substring(., string-length(.))" /> - </xsl:variable> - <xsl:variable name="first-char-space"> - <xsl:if test="$first-char = ' ' or $first-char = '	' or $first-char = '
'"> - <xsl:text> </xsl:text> - </xsl:if> - </xsl:variable> - <xsl:variable name="last-char-space"> - <xsl:if test="$last-char = ' ' or $last-char = '	' or $last-char = '
'"> - <xsl:text> </xsl:text> - </xsl:if> - </xsl:variable> - <xsl:variable name="space-left"> - <xsl:if test="count(preceding-sibling::*) >= 1 "> - <xsl:value-of select="$first-char-space" /> - </xsl:if> - </xsl:variable> - <xsl:variable name="space-right"> - <xsl:if test="count(following-sibling::*) >= 1 "> - <xsl:value-of select="$last-char-space" /> - </xsl:if> - </xsl:variable> - <xsl:if test="$normalized != ''"> - <xsl:value-of select="$space-left" /> - <xsl:value-of select="$normalized" /> - <xsl:value-of select="$space-right" /> - </xsl:if> - </xsl:template> - - <xsl:template match="html:p[position() < last()]"> - <!-- Leave an empty line --> - <xsl:apply-templates /> - <xsl:text>@c fill
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="html:p"> - <xsl:apply-templates /> - <xsl:text>@c fill
</xsl:text> - </xsl:template> - - <xsl:template match="info:dfn"> - <xsl:text>@dfn{</xsl:text> - <xsl:apply-templates /> - <xsl:text>}</xsl:text> - </xsl:template> - - <xsl:template match="html:pre"> - <xsl:text>@code{</xsl:text> - <xsl:apply-templates /> - <xsl:text>}</xsl:text> - </xsl:template> - - <xsl:template match="info:deffn"> - <xsl:text>@deffn </xsl:text> - <xsl:value-of select="@type" /> - <xsl:text> </xsl:text> - <xsl:value-of select="@name" /> - <xsl:text> </xsl:text> - <xsl:call-template name="arglist"> - <xsl:with-param name="arguments" select="@arguments" /> - </xsl:call-template> - <xsl:text>
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end deffn
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:deffnx"> - <xsl:text>@deffnx </xsl:text> - <xsl:value-of select="@type" /> - <xsl:text> </xsl:text> - <xsl:value-of select="@name" /> - <xsl:text> </xsl:text> - <xsl:call-template name="arglist"> - <xsl:with-param name="arguments" select="@arguments" /> - </xsl:call-template> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:defvr"> - <xsl:text>@defvr {</xsl:text> - <xsl:value-of select="@type" /> - <xsl:text>} </xsl:text> - <xsl:value-of select="@name" /> - <xsl:text>
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end defvr
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:deftp"> - <xsl:text>@deftp {</xsl:text> - <xsl:value-of select="@type" /> - <xsl:text>} </xsl:text> - <xsl:value-of select="@name" /> - <xsl:text> </xsl:text> - <xsl:call-template name="arglist"> - <xsl:with-param name="arguments" select="@arguments" /> - </xsl:call-template> - <xsl:text>
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end deftp
</xsl:text> - <xsl:text>
</xsl:text> - </xsl:template> - - <xsl:template match="info:var"> - <xsl:call-template name="arglist"> - <xsl:with-param name="arguments"> - <xsl:apply-templates /> - </xsl:with-param> - </xsl:call-template> - </xsl:template> - - <xsl:template name="arglist"> - <xsl:param name="arguments" /> - <xsl:variable name="content" select="normalize-space($arguments)" /> - <xsl:choose> - <xsl:when test="contains($content, ' ')"> - <xsl:call-template name="arglist"> - <xsl:with-param - name="arguments" - select="substring-before($content, ' ')" /> - </xsl:call-template> - <xsl:text> </xsl:text> - <xsl:call-template name="arglist"> - <xsl:with-param - name="arguments" - select="substring-after($content, ' ')" /> - </xsl:call-template> - </xsl:when> - <xsl:when test="$content != ''"> - <xsl:text>@var{</xsl:text> - <xsl:value-of select="$content" /> - <xsl:text>}</xsl:text> - </xsl:when> - <xsl:otherwise /> - </xsl:choose> - </xsl:template> - - <xsl:template match="html:strong"> - <xsl:text>@strong{</xsl:text> - <xsl:apply-templates /> - <xsl:text>}</xsl:text> - </xsl:template> - - <xsl:template match="html:ul"> - <xsl:text>@itemize
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end itemize
</xsl:text> - </xsl:template> - - <xsl:template match="html:ol"> - <xsl:text>@enumerate
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@end enumerate
</xsl:text> - </xsl:template> - - <xsl:template match="html:li"> - <xsl:text>@item
</xsl:text> - <xsl:apply-templates /> - <xsl:text>@c fill
</xsl:text> - </xsl:template> - - <xsl:template match="html:emph"> - <xsl:text>@emph{</xsl:text> - <xsl:apply-templates /> - <xsl:text>}</xsl:text> - </xsl:template> - - <xsl:template match="info:var"> - <xsl:text>@var{</xsl:text> - <xsl:apply-templates /> - <xsl:text>}</xsl:text> - </xsl:template> - - <xsl:template match="info:gfdl"> - <xsl:text>@include fdl.texi

</xsl:text> - </xsl:template> - - <xsl:template match="info:printindex"> - <xsl:text>@printindex cp

</xsl:text> - </xsl:template> -</xsl:stylesheet> |