diff options
author | Paul W. Frields <stickster@gmail.com> | 2005-12-25 19:26:10 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2005-12-25 19:26:10 +0000 |
commit | 68e66cf66e6657255f0494f69d92c982ed2a9a33 (patch) | |
tree | 6a1d6936b7e947771f7795f41160bad3ce38ce27 /packaging | |
parent | b2da077060ad98d4e6d3a7f662aa616c4bb7101c (diff) | |
download | fedora-doc-utils-68e66cf66e6657255f0494f69d92c982ed2a9a33.tar.gz fedora-doc-utils-68e66cf66e6657255f0494f69d92c982ed2a9a33.tar.xz fedora-doc-utils-68e66cf66e6657255f0494f69d92c982ed2a9a33.zip |
Additional helpful XSLT, also provide doctype dynamically
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/doctype.xsl | 8 | ||||
-rw-r--r-- | packaging/gnome-desktop.xsl | 18 | ||||
-rw-r--r-- | packaging/kde-desktop.xsl | 34 |
3 files changed, 58 insertions, 2 deletions
diff --git a/packaging/doctype.xsl b/packaging/doctype.xsl new file mode 100644 index 0000000..8cf535e --- /dev/null +++ b/packaging/doctype.xsl @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output omit-xml-declaration="yes"/> + <xsl:template match="/article">articleinfo</xsl:template> + <xsl:template match="/book">bookinfo</xsl:template> + +</xsl:stylesheet> diff --git a/packaging/gnome-desktop.xsl b/packaging/gnome-desktop.xsl index 85a0fa3..02dcdfc 100644 --- a/packaging/gnome-desktop.xsl +++ b/packaging/gnome-desktop.xsl @@ -15,16 +15,20 @@ Name=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/> GenericName=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/> Exec=gnome-help file:///usr/share/fedora/doc/fedora-doc-<xsl:value-of select="$docbase"/>/C/<xsl:value-of select="$docbase"/>-en.xml +Comment=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/desc"/> <xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != 'en'">Name[<xsl:value-of - select="@lang"/>]=<xsl:value-of - select="/rpm-info/titles/translation[@lang]/title"/></xsl:if></xsl:for-each> + select="@lang"/>]=<xsl:apply-templates select="title"/></xsl:if></xsl:for-each> + <xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != 'en'">Exec[<xsl:value-of select="@lang"/>]=gnome-help file:///usr/share/fedora/doc/fedora-doc-<xsl:value-of select="$docbase"/>/<xsl:value-of select="@lang"/>/<xsl:value-of select="$docbase"/>-<xsl:value-of select="@lang"/>.xml</xsl:if></xsl:for-each> +<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != + 'en'">Comment[<xsl:value-of select="@lang"/>]=<xsl:apply-templates select="desc"/></xsl:if></xsl:for-each> + Icon=icon-documentation.png Terminal=false Type=Application @@ -41,4 +45,14 @@ OnlyShowIn=GNOME; </xsl:for-each> </xsl:template> + <xsl:template name="get-desc"> + <xsl:for-each select="/rpm-info/titles/translation"> + <xsl:choose> + <xsl:when test="@lang = $lang"> + <xsl:value-of select="desc"/> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:template> + </xsl:stylesheet> diff --git a/packaging/kde-desktop.xsl b/packaging/kde-desktop.xsl new file mode 100644 index 0000000..762c184 --- /dev/null +++ b/packaging/kde-desktop.xsl @@ -0,0 +1,34 @@ +<!-- Transform rpm-info.xml into a .desktop file for KDE --> +<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output encoding="UTF-8" indent="no" method="text" omit-xml-declaration="yes" standalone="no" version="1.0"/> + +<!-- Note: do not indent this file! Any whitespace here + will be reproduced in the output --> + + <xsl:param name="lang" select="'en'" /> + <xsl:param name="docbase" select="'example-tutorial'" /> + +<xsl:template match="/">[Desktop Entry] +Encoding=UTF-8 +Categories=X-Fedora-Documentation; +Name=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/> +Exec=khelpcenter help:/fedora-doc-<xsl:value-of + select="$docbase"/>/index.html + +<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != 'en'">Name[<xsl:value-of + select="@lang"/>]=<xsl:apply-templates + select="title"/></xsl:if></xsl:for-each> + +<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != + 'en'">Comment[<xsl:value-of select="@lang"/>]=<xsl:apply-templates + select="desc"/></xsl:if></xsl:for-each> + +Icon=icon-documentation.png +Terminal=false +Keywords=fedora +OnlyShowIn=KDE; +</xsl:template> + +<xsl:template name="get-title"><xsl:for-each select="/rpm-info/titles/translation"><xsl:choose><xsl:when test="@lang = $lang"><xsl:value-of select="title"/></xsl:when></xsl:choose></xsl:for-each></xsl:template> + +</xsl:stylesheet> |