FreedomBox/doc/fetch-images.xslt
Sunil Mohan Adapa ef2d3a4787 doc: Fetch manual from the Wiki
- Already reorganised the manual page on the wiki for this purpose.

- Fix several issues with the Docbook export of MoinMoin.

  - Replace / in title with a space.

  - Remove revision history.

  - Convert image dimensions to points from pixels.

  - Fix incorrect wiki paths.

- Implement mechnism for downloading images and using them with
  relative paths.

- Remove the old way of compiling the manual.  Its contents are mostly
  not applicable for end users.  Design documents are outdated.  INSTALL
  and HACKING talk about Plinth installation not FreedomBox in general.
  A fresh man page will be written later.
2015-09-27 09:49:45 -04:00

68 lines
2.2 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!--
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Set output method to text -->
<xsl:output method="text"/>
<!-- Process and ignore all nodes by default -->
<xsl:template match="@*|node()">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<!-- Output URLs from imagedata nodes -->
<xsl:template match="imagedata">
<xsl:call-template name="filename">
<xsl:with-param name="path" select="@fileref"/>
</xsl:call-template>
<xsl:text> "</xsl:text>
<xsl:value-of select="@fileref"/>
<xsl:text>"&#010;</xsl:text>
</xsl:template>
<!-- Output just the filename from a URL -->
<xsl:template match="@fileref[parent::imagedata]">
<xsl:attribute name="fileref">
<xsl:call-template name="filename">
<xsl:with-param name="path" select="."/>
</xsl:call-template>
</xsl:attribute>
</xsl:template>
<xsl:template name="filename">
<xsl:param name="path"/>
<xsl:choose>
<xsl:when test="contains($path, 'target=')">
<xsl:value-of select="substring-after($path, 'target=')"/>
</xsl:when>
<xsl:when test="not(contains($path, '/'))">
<xsl:value-of select="$path"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="filename">
<xsl:with-param name="path" select="substring-after($path, '/')"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>