diff options
Diffstat (limited to 'sandbox/mallard/xslt')
-rw-r--r-- | sandbox/mallard/xslt/mal2html-block.xsl | 289 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html-css.xsl | 134 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html-inline.xsl | 253 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html-list.xsl | 90 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html-media.xsl | 41 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html-page.xsl | 789 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html-table.xsl | 407 | ||||
-rw-r--r-- | sandbox/mallard/xslt/mal2html.xsl | 67 |
8 files changed, 0 insertions, 2070 deletions
diff --git a/sandbox/mallard/xslt/mal2html-block.xsl b/sandbox/mallard/xslt/mal2html-block.xsl deleted file mode 100644 index b2c4b72..0000000 --- a/sandbox/mallard/xslt/mal2html-block.xsl +++ /dev/null @@ -1,289 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - Block Elements - -REMARK: Describe this module ---> - - -<!--**========================================================================== -mal2html.block.css -Outputs CSS that controls the appearance of block elements - -REMARK: Describe this template ---> -<xsl:template name="mal2html.block.css"> -<xsl:text> -div.title { - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'text-light'"/> - </xsl:call-template> - <xsl:text>; - font-weight: bold; -} -pre.code { - <!-- FIXME: theme --> - background: url(mallard-icon-code.png) no-repeat top right; - border: solid 2px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-light'"/> - </xsl:call-template> - <xsl:text>; - padding: 0.5em 1em 0.5em 1em; -} -div.comment { - padding: 0.5em; - border: solid 2px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'red-border'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'red-background'"/> - </xsl:call-template> - <xsl:text>; -} -div.comment div.comment { - margin: 1em 0 0 1em; -} -div.comment div.cite { margin: 0; font-style: italic; } - -div.figure { - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'text-light'"/> - </xsl:call-template> - <xsl:text>; - border: solid 1px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-border'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-background'"/> - </xsl:call-template> - <xsl:text>; - margin-left: 1.72em; - padding: 4px; -} -div.figure-contents { - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'text'"/> - </xsl:call-template> - <xsl:text>; - border: solid 1px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-border'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'background'"/> - </xsl:call-template> - <xsl:text>; - padding: 0.5em 1em 0.5em 1em; - margin: 0; - text-align: center; -} -div.figure div.title { margin: 0 0 4px 0; } -div.figure div.caption { margin: 4px 0 0 0; } - -div.synopsis { - border-top: solid 2px; - border-bottom: solid 2px; - border-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'blue-border'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-background'"/> - </xsl:call-template> - <xsl:text>; - padding: 0.5em 1em 0.5em 1em; -} -div.synopsis pre.code { - background: none; - border: none; - padding: 0; -} -div.title { - font-size: 1.2em; - margin-top: 0; - font-weight: bold; -} -</xsl:text> -</xsl:template> - - -<!-- == Matched Templates == --> - -<!-- = caption = --> -<xsl:template mode="mal2html.block.mode" match="mal:caption"> - <div class="caption"> - <xsl:apply-templates mode="mal2html.block.mode"/> - </div> -</xsl:template> - -<!-- = code = --> -<xsl:template mode="mal2html.block.mode" match="mal:code"> - <xsl:variable name="first" select="node()[1]/self::text()"/> - <xsl:variable name="last" select="node()[last()]/self::text()"/> - <pre class="code"> - <xsl:if test="not(preceding-sibling::*)"> - <xsl:attribute name="class"> - <xsl:text>first-child</xsl:text> - </xsl:attribute> - </xsl:if> - <xsl:if test="$first"> - <xsl:call-template name="util.strip_newlines"> - <xsl:with-param name="string" select="$first"/> - <xsl:with-param name="leading" select="true()"/> - <xsl:with-param name="trailing" select="$first = $last"/> - </xsl:call-template> - </xsl:if> - <xsl:apply-templates mode="mal2html.inline.mode" - select="node()[not(. = $first or . = $last)]"/> - <xsl:if test="$last and ($first != $last)"> - <xsl:call-template name="util.strip_newlines"> - <xsl:with-param name="string" select="$last"/> - <xsl:with-param name="leading" select="false()"/> - <xsl:with-param name="trailing" select="true()"/> - </xsl:call-template> - </xsl:if> - </pre> -</xsl:template> - -<!-- = comment = --> -<xsl:template mode="mal2html.block.mode" match="mal:comment"> - <div class="comment"> - <xsl:if test="not(preceding-sibling::*)"> - <xsl:attribute name="class"> - <xsl:text>first-child</xsl:text> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates mode="mal2html.block.mode"/> - </div> -</xsl:template> - -<!-- = comment/title = --> -<xsl:template mode="mal2html.block.mode" match="mal:comment/mal:title"> - <div class="title"> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </div> -</xsl:template> - -<!-- = comment/cite = --> -<xsl:template mode="mal2html.block.mode" match="mal:comment/mal:cite"> - <div class="cite"> - <!-- FIXME: i18n --> - <xsl:choose> - <xsl:when test="@name and @date"> - <xsl:text>from </xsl:text> - <xsl:apply-templates mode="mal2html.inline.mode" select="@name"/> - <xsl:text> on </xsl:text> - <xsl:apply-templates mode="mal2html.inline.mode" select="@date"/> - </xsl:when> - <xsl:otherwise> - <xsl:text>from </xsl:text> - <xsl:apply-templates mode="mal2html.inline.mode" select="@name"/> - </xsl:otherwise> - </xsl:choose> - </div> -</xsl:template> - -<!-- = figure = --> -<xsl:template mode="mal2html.block.mode" match="mal:figure"> - <div class="figure"> - <xsl:if test="not(preceding-sibling::*)"> - <xsl:attribute name="class"> - <xsl:text>first-child</xsl:text> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/> - <div class="figure-contents"> - <xsl:apply-templates mode="mal2html.block.mode" - select="*[not(self::mal:title or self::mal:caption)]"/> - </div> - <xsl:apply-templates mode="mal2html.block.mode" select="mal:caption"/> - </div> -</xsl:template> - -<!-- = figure/title = --> -<xsl:template mode="mal2html.block.mode" match="mal:figure/mal:title"> - <div class="title"> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </div> -</xsl:template> - -<!-- = info = --> -<xsl:template mode="mal2html.block.mode" match="mal:info"/> - -<!-- = p = --> -<xsl:template mode="mal2html.block.mode" match="mal:p"> - <p class="p"> - <xsl:if test="not(preceding-sibling::*)"> - <xsl:attribute name="class"> - <xsl:text>first-child</xsl:text> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </p> -</xsl:template> - -<!-- = synopsis = --> -<xsl:template mode="mal2html.block.mode" match="mal:synopsis"> - <div class="synopsis"> - <xsl:if test="not(preceding-sibling::*)"> - <xsl:attribute name="class"> - <xsl:text>first-child</xsl:text> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates mode="mal2html.block.mode"/> - </div> -</xsl:template> - -<!-- = synopsis/title = --> -<xsl:template mode="mal2html.block.mode" match="mal:synopsis/mal:title"> - <div class="title"> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </div> -</xsl:template> - -<!-- FIXME --> -<xsl:template mode="mal2html.block.mode" match="*"> - <xsl:message> - <xsl:text>Unmatched block element: </xsl:text> - <xsl:value-of select="local-name(.)"/> - </xsl:message> - <xsl:apply-templates mode="mal2html.inline.mode"/> -</xsl:template> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-css.xsl b/sandbox/mallard/xslt/mal2html-css.xsl deleted file mode 100644 index fcdcc2f..0000000 --- a/sandbox/mallard/xslt/mal2html-css.xsl +++ /dev/null @@ -1,134 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:exsl="http://exslt.org/common" - xmlns="http://www.w3.org/1999/xhtml" - extension-element-prefixes="exsl" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - CSS - -REMARK: Describe this module ---> - - -<!--@@========================================================================== -mal2html.css.file -The file to output CSS to - -This parameter allows you to output the CSS to separate file which is referenced -by each HTML file. If this parameter is blank, then the CSS is embedded inside -a #{style} tag in the HTML instead. ---> -<xsl:param name="mal2html.css.file" select="''"/> - - -<!--**========================================================================== -mal2html.css -Outputs the CSS that controls the appearance of the entire document -$css_file: Whether to create a CSS file when @{mal2html.css.file} is set. - -This template outputs a #{style} or #{link} tag and calls *{mal2html.css.content} -to output the actual CSS directives. An external CSS file will only be created -when ${css_file} is true. ---> -<xsl:template name="mal2html.css"> - <xsl:param name="css_file" select="false()"/> - <xsl:choose> - <xsl:when test="$mal2html.css.file != ''"> - <xsl:if test="$css_file"> - <exsl:document href="{$mal2html.css.file}" method="text"> - <xsl:call-template name="mal2html.css.content"/> - </exsl:document> - </xsl:if> - <link rel="stylesheet" type="text/css" href="{$mal2html.css.file}"/> - </xsl:when> - <xsl:otherwise> - <style type="text/css"> - <xsl:call-template name="mal2html.css.content"/> - </style> - </xsl:otherwise> - </xsl:choose> -</xsl:template> - - -<!--**========================================================================== -mal2html.css.content -Outputs the actual CSS directives - -This template is called by *{mal2html.css} to output CSS content. It also calls -templates from other modules to output CSS specific to the content addressed in -those modules. - -This template calls *{mal2html.css.custom} at the end. That template may be used -by extension stylesheets to extend or override the CSS. ---> -<xsl:template name="mal2html.css.content"> - <xsl:call-template name="mal2html.block.css"/> - <xsl:call-template name="mal2html.inline.css"/> - <xsl:call-template name="mal2html.list.css"/> - <xsl:call-template name="mal2html.page.css"/> - <xsl:call-template name="mal2html.table.css"/> -<xsl:text> -div, pre, p { margin: 1em 0 0 0; padding: 0; } -.first-child { margin-top: 0; } -a { - text-decoration: none; - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'link'"/> - </xsl:call-template> - <xsl:text>; -} -a:visited { - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'link-visited'"/> - </xsl:call-template> - <xsl:text>; -} -a:hover { text-decoration: underline; } -</xsl:text> -<xsl:call-template name="mal2html.css.custom"/> -</xsl:template> -<!-- -2.4 -2 -1.72 -1.44 -1.2 -1 -0.83 -0.69 -0.5 ---> - - -<!--**========================================================================== -mal2html.css.custom -Allows extension stylesheets to extend or override CSS -:Stub: true - -This stub template has no content. Extension stylesheets can override this -template to output extra CSS. ---> -<xsl:template name="mal2html.css.custom"/> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-inline.xsl b/sandbox/mallard/xslt/mal2html-inline.xsl deleted file mode 100644 index 5edcd00..0000000 --- a/sandbox/mallard/xslt/mal2html-inline.xsl +++ /dev/null @@ -1,253 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - Inline Elements - -REMARK: Describe this module ---> - - -<!--**========================================================================== -mal2html.span -Renders an inline element as a #{span} -$node: The element to render -$content: An optional parameter specifying the content of the #{span} - -REMARK: Document this template ---> -<xsl:template name="mal2html.span"> - <xsl:param name="node" select="."/> - <xsl:param name="content" select="false()"/> - <span class="{local-name($node)}"> - <xsl:choose> - <xsl:when test="$node/@xref"> - <a class="xref"> - <xsl:attribute name="href"> - <xsl:call-template name="mal.link.target"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="xref" select="$node/@xref"/> - </xsl:call-template> - </xsl:attribute> - <xsl:attribute name="title"> - <xsl:call-template name="mal.link.tooltip"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="xref" select="$node/@xref"/> - </xsl:call-template> - </xsl:attribute> - <xsl:choose> - <xsl:when test="$content"> - <xsl:copy-of select="$content"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates mode="mal2html.inline.mode" select="$node/node()"/> - </xsl:otherwise> - </xsl:choose> - </a> - </xsl:when> - <xsl:when test="$node/@href"> - <a class="href" href="{$node/@href}"> - <xsl:attribute name="title"> - <xsl:call-template name="mal.link.tooltip"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="href" select="$node/@href"/> - </xsl:call-template> - </xsl:attribute> - <xsl:choose> - <xsl:when test="$content"> - <xsl:copy-of select="$content"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates mode="mal2html.inline.mode" select="$node/node()"/> - </xsl:otherwise> - </xsl:choose> - </a> - </xsl:when> - <xsl:otherwise> - <xsl:choose> - <xsl:when test="$content"> - <xsl:copy-of select="$content"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates mode="mal2html.inline.mode" select="$node/node()"/> - </xsl:otherwise> - </xsl:choose> - </xsl:otherwise> - </xsl:choose> - </span> -</xsl:template> - - -<!--**========================================================================== -mal2html.inline.css -Outputs CSS that controls the appearance of inline elements - -REMARK: Describe this template ---> -<xsl:template name="mal2html.inline.css"> -<xsl:text> -span.app { font-style: italic; } -span.cmd { - font-family: monospace; - background-color: #f0f0f0; - padding-left: 0.2em; - padding-right: 0.4em; -} -span.code { font-family: monospace; } -span.em { font-style: italic; } -span.email { color: red; } -span.file { font-family: monospace; } -span.gui { color: red; } -span.input { color: red; } -span.key { color: red; } -span.output { color: red; } -span.sys { font-family: monospace; } -span.var { font-style: italic; } -</xsl:text> -</xsl:template> - - -<!-- == Matched Templates == --> - -<!-- = app = --> -<xsl:template mode="mal2html.inline.mode" match="mal:app"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = cmd = --> -<xsl:template mode="mal2html.inline.mode" match="mal:cmd"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = code = --> -<xsl:template mode="mal2html.inline.mode" match="mal:code"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = date = --> -<xsl:template mode="mal2html.inline.mode" match="mal:date"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = em = --> -<xsl:template mode="mal2html.inline.mode" match="mal:em"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = email = --> -<xsl:template mode="mal2html.inline.mode" match="mal:email"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = file = --> -<xsl:template mode="mal2html.inline.mode" match="mal:file"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = gui = --> -<xsl:template mode="mal2html.inline.mode" match="mal:gui"> - <!-- FIXME: menu --> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = input = --> -<xsl:template mode="mal2html.inline.mode" match="mal:input"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = key = --> -<xsl:template mode="mal2html.inline.mode" match="mal:key"> - <!-- FIXME: keycombo --> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = link = --> -<xsl:template mode="mal2html.inline.mode" match="mal:link"> - <xsl:call-template name="mal2html.span"> - <xsl:with-param name="content"> - <xsl:choose> - <xsl:when test="normalize-space(.) != ''"> - <xsl:apply-templates/> - </xsl:when> - <xsl:when test="@xref"> - <xsl:call-template name="mal.link.content"> - <xsl:with-param name="node" select="."/> - <xsl:with-param name="xref" select="@xref"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="@href"> - <xsl:value-of select="@href"/> - </xsl:when> - </xsl:choose> - </xsl:with-param> - </xsl:call-template> -</xsl:template> - -<!-- = media = --> -<xsl:template mode="mal2html.inline.mode" match="mal:media"> - <!-- FIXME --> -</xsl:template> - -<!-- = name = --> -<xsl:template mode="mal2html.inline.mode" match="mal:name"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = output = --> -<xsl:template mode="mal2html.inline.mode" match="mal:output"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = quote = --> -<xsl:template mode="mal2html.inline.mode" match="mal:quote"> - <!-- FIXME: do smart quoting --> - <xsl:text>"</xsl:text> - <xsl:call-template name="mal2html.span"/> - <xsl:text>"</xsl:text> -</xsl:template> - -<!-- = sys = --> -<xsl:template mode="mal2html.inline.mode" match="mal:sys"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = var = --> -<xsl:template mode="mal2html.inline.mode" match="mal:var"> - <xsl:call-template name="mal2html.span"/> -</xsl:template> - -<!-- = text() = --> -<xsl:template mode="mal2html.inline.mode" match="text()"> - <xsl:value-of select="."/> -</xsl:template> - -<!-- = FIXME = --> -<xsl:template mode="mal2html.inline.mode" match="*"> - <xsl:message> - <xsl:text>Unmatched inline element: </xsl:text> - <xsl:value-of select="local-name(.)"/> - </xsl:message> - <xsl:apply-templates mode="mal2html.inline.mode"/> -</xsl:template> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-list.xsl b/sandbox/mallard/xslt/mal2html-list.xsl deleted file mode 100644 index 23207da..0000000 --- a/sandbox/mallard/xslt/mal2html-list.xsl +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - List Elements - -REMARK: Describe this module ---> - - -<!--**========================================================================== -mal2html.list.css -Outputs CSS that controls the appearance of lists - -REMARK: Describe this template ---> -<xsl:template name="mal2html.list.css"> -<xsl:text> -ul.list-tree { - margin: 0; padding: 0; - list-style-type: none; -} -ul.list-tree li { - margin: 0; padding: 0; -} -ul.list-tree li p { - margin: 0; padding: 0; -} -ul.list-tree ul.list-tree { - margin-left: 1.44em; -} -ul.list-tree ul.list-tree li { - margin-top: 0.69em; -} -</xsl:text> -</xsl:template> - - -<!-- == Bullet Lists == --> - -<!-- == Numbered Lists == --> - -<!-- == Definition Lists == --> - -<!-- == Tree Lists == --> - -<xsl:template mode="mal2html.block.mode" match="mal:list[@type='tree']"> - <div class="list list-tree"> - <ul class="list list-tree"> - <xsl:apply-templates mode="mal2html.list.tree.mode"/> - </ul> - </div> -</xsl:template> - -<xsl:template mode="mal2html.list.tree.mode" match="mal:item"> - <li> - <p> - <xsl:apply-templates mode="mal2html.inline.mode" - select="*[not(self::mal:item)]"/> - </p> - </li> - <xsl:if test="mal:item"> - <ul class="list list-tree"> - <xsl:apply-templates mode="mal2html.list.tree.mode" - select="mal:item"/> - </ul> - </xsl:if> -</xsl:template> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-media.xsl b/sandbox/mallard/xslt/mal2html-media.xsl deleted file mode 100644 index 0d56215..0000000 --- a/sandbox/mallard/xslt/mal2html-media.xsl +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - Media Elements - -REMARK: Describe this module ---> - - -<!-- == Matched Templates == --> - -<!-- = mal2html.block.mode % media/image = --> -<xsl:template mode="mal2html.block.mode" - match="mal:media[@type='image']"> - <div class="media media-image"> - <img src="{@href}"/> - </div> -</xsl:template> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-page.xsl b/sandbox/mallard/xslt/mal2html-page.xsl deleted file mode 100644 index 6fb6ff8..0000000 --- a/sandbox/mallard/xslt/mal2html-page.xsl +++ /dev/null @@ -1,789 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - Pages - -REMARK: Describe this module ---> - - -<!--**========================================================================== -mal2html.page.copyright -Outputs the copyright notice at the bottom of a page -$node: The top-level #{page} element - -REMARK: Describe this template ---> -<xsl:template name="db2html.page.copyrights"> - <xsl:param name="node"/> - <div class="copyrights"> - <xsl:for-each select="$node/mal:info/mal:copyright"> - <div class="copyright"> - <!-- FIXME: i18n --> - <xsl:value-of select="concat('© ', @year, ' ', @name)"/> - </div> - </xsl:for-each> - </div> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.guidelinks -Outputs the automatic links from a page to guide pages and sections -$node: The #{page} or #{section} element containing the links - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.guidelinks"> - <xsl:param name="node" select="."/> - <xsl:variable name="id"> - <xsl:choose> - <xsl:when test="$node/self::mal:section"> - <xsl:value-of select="concat(ancestor::mal:page[1]/@id, '#', @id)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="@id"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <!-- FIXME: // is slow --> - <xsl:variable name="pagelinks" - select="$cache//*[mal:info/mal:link[@type = 'topic'][@xref = $id]]"/> - <xsl:variable name="guidelinks" - select="$node/mal:info/mal:link[@type = 'guide']"/> - <xsl:if test="$pagelinks or $guidelinks"> - <ul class="guidelinks"> - <xsl:for-each select="$pagelinks"> - <xsl:variable name="position"> - <xsl:choose> - <xsl:when test="last() = 1 and count($guidelinks) = 0"> - <xsl:text>only</xsl:text> - </xsl:when> - <xsl:when test="position() = 1"> - <xsl:text>first</xsl:text> - </xsl:when> - <xsl:when test="position() = last() and count($guidelinks) = 0"> - <xsl:text>last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:call-template name="mal2html.page.guidelink"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="page" select="."/> - <xsl:with-param name="position" select="$position"/> - </xsl:call-template> - </xsl:for-each> - <!-- FIXME: exclude pagelinks --> - <xsl:for-each select="$guidelinks"> - <xsl:variable name="linkid"> - <xsl:choose> - <xsl:when test="contains(@xref, '#')"> - <xsl:value-of select="@xref"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat(@xref, '#', @xref)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="position"> - <xsl:choose> - <xsl:when test="last() = 1 and count($pagelinks) = 0"> - <xsl:text>only</xsl:text> - </xsl:when> - <xsl:when test="position() = 1 and count($pagelinks) = 0"> - <xsl:text>first</xsl:text> - </xsl:when> - <xsl:when test="position() = last()"> - <xsl:text>last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:for-each select="$cache"> - <xsl:call-template name="mal2html.page.guidelink"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="page" select="key('cache_key', $linkid)"/> - <xsl:with-param name="position" select="$position"/> - </xsl:call-template> - </xsl:for-each> - </xsl:for-each> - </ul> - </xsl:if> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.guidelink -Outputs an automatic link block from a page or section to a guide -$node: The #{page} or #{section} element containing the link -$page: The element from the cache file of the page being linked to -$position: The position of this link in the list, either 'first', 'last', or '' - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.guidelink"> - <xsl:param name="node" select="."/> - <xsl:param name="page"/> - <xsl:param name="position"/> - <xsl:variable name="xref"> - <xsl:choose> - <xsl:when test="$page/self::mal:section"> - <xsl:value-of select="$page/ancestor::mal:page[1]/@id"/> - <xsl:text>#</xsl:text> - <xsl:value-of select="$page/@id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$page/@id"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <li> - <xsl:attribute name="class"> - <xsl:text>guidelink</xsl:text> - <xsl:choose> - <xsl:when test="$position = 'only'"> - <xsl:text> guidelink-only</xsl:text> - </xsl:when> - <xsl:when test="$position = 'first'"> - <xsl:text> guidelink-first</xsl:text> - </xsl:when> - <xsl:when test="$position = 'last'"> - <xsl:text> guidelink-last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:attribute> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="mal.link.target"> - <xsl:with-param name="xref" select="$xref"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="mal.link.content"> - <xsl:with-param name="node" select="."/> - <xsl:with-param name="xref" select="$xref"/> - </xsl:call-template> - </a> - </li> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.pagelinks -Outputs the automatic links from a guide page or guide section -$node: The #{page} or #{section} element containing the links - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.pagelinks"> - <xsl:param name="node" select="."/> - <xsl:variable name="id"> - <xsl:choose> - <xsl:when test="$node/self::mal:section"> - <xsl:value-of select="concat(ancestor::mal:page[1]/@id, '#', @id)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="@id"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="pagelinks" - select="$node/mal:info/mal:link[@type = 'topic']"/> - <!-- FIXME: // selectors are slow --> - <!-- FIXME: exclude $pagelinks from $guidelinks --> - <xsl:variable name="guidelinks" - select="$cache//*[mal:info/mal:link[@type = 'guide'][@xref = $id]]"/> - <xsl:if test="$pagelinks or $guidelinks"> - <div class="pagelinks"> - <xsl:for-each select="$pagelinks"> - <xsl:variable name="linkid"> - <xsl:choose> - <xsl:when test="contains(@xref, '#')"> - <xsl:value-of select="@xref"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat(@xref, '#', @xref)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="position"> - <xsl:choose> - <xsl:when test="last() = 1 and count($guidelinks) = 0"> - <xsl:text>only</xsl:text> - </xsl:when> - <xsl:when test="position() = 1"> - <xsl:text>first</xsl:text> - </xsl:when> - <xsl:when test="position() = last() and count($guidelinks) = 0"> - <xsl:text>last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:for-each select="$cache"> - <xsl:call-template name="mal2html.page.pagelink"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="page" select="key('cache_key', $linkid)"/> - <xsl:with-param name="position" select="$position"/> - </xsl:call-template> - </xsl:for-each> - </xsl:for-each> - <xsl:for-each select="$guidelinks"> - <xsl:sort select="mal:info/mal:link[@type = 'guide'][@xref = $id]/@weight" - data-type="number" order="descending"/> - <!-- FIXME: lang --> - <xsl:sort select="mal:info/mal:title[@type = 'sort']" - data-type="text" order="ascending"/> - <xsl:call-template name="mal2html.page.pagelink"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="page" select="."/> - <xsl:with-param name="position"> - <xsl:choose> - <xsl:when test="last() = 1 and count($pagelinks) = 0"> - <xsl:text>only</xsl:text> - </xsl:when> - <xsl:when test="position() = 1 and count($pagelinks) = 0"> - <xsl:text>first</xsl:text> - </xsl:when> - <xsl:when test="position() = last()"> - <xsl:text>last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:with-param> - </xsl:call-template> - </xsl:for-each> - </div> - </xsl:if> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.pagelink -Outputs an automatic link block from a guide to a page -$node: The #{guide} or #{section} element containing the link -$page: The element from the cache file of the page being linked to -$position: The position of this link in the list, either 'first', 'last', or '' - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.pagelink"> - <xsl:param name="node" select="."/> - <xsl:param name="page"/> - <xsl:param name="position"/> - <xsl:variable name="xref"> - <xsl:choose> - <xsl:when test="$page/self::mal:section"> - <xsl:value-of select="$page/ancestor::mal:page[1]/@id"/> - <xsl:text>#</xsl:text> - <xsl:value-of select="$page/@id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$page/@id"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="linkid"> - <xsl:choose> - <xsl:when test="contains($xref, '#')"> - <xsl:value-of select="$xref"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat($xref, '#', $xref)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="mal.link.target"> - <xsl:with-param name="xref" select="$xref"/> - </xsl:call-template> - </xsl:attribute> - <div> - <xsl:attribute name="class"> - <xsl:text>pagelink</xsl:text> - <xsl:choose> - <xsl:when test="$position = 'only'"> - <xsl:text> pagelink-only</xsl:text> - </xsl:when> - <xsl:when test="$position = 'first'"> - <xsl:text> pagelink-first</xsl:text> - </xsl:when> - <xsl:when test="$position = 'last'"> - <xsl:text> pagelink-last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:attribute> - <!-- FIXME: call a common linkifier? --> - <div class="title"> - <xsl:call-template name="mal.link.content"> - <xsl:with-param name="node" select="."/> - <xsl:with-param name="xref" select="$xref"/> - </xsl:call-template> - </div> - <xsl:for-each select="$cache"> - <xsl:variable name="desc" - select="key('cache_key', $linkid)/mal:info/mal:desc[1]"/> - <xsl:if test="$desc"> - <div class="desc"> - <!-- FIXME: should desc contain inline or block? --> - <xsl:apply-templates mode="mal2html.inline.mode" select="$desc/node()"/> - </div> - </xsl:if> - </xsl:for-each> - </div> - </a> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.seealsolinks -Outputs the automatic seealso links from a page related pages -$node: The #{topic} or #{section} element containing the links - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.seealsolinks"> - <xsl:param name="node" select="."/> - <xsl:variable name="id"> - <xsl:choose> - <xsl:when test="$node/self::mal:section"> - <xsl:value-of select="concat(ancestor::mal:page[1]/@id, '#', @id)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="@id"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <!-- FIXME: // is slow --> - <xsl:variable name="inlinks" - select="$cache//*[mal:info/mal:link[@type = 'seealso'][@xref = $id]]"/> - <xsl:variable name="outlinks" - select="$node/mal:info/mal:link[@type = 'seealso']"/> - <xsl:if test="$inlinks or $outlinks"> - <div class="seealsolinks"> - <!-- FIXME: i18n --> - <div class="title">See Also</div> - <xsl:for-each select="$inlinks"> - <xsl:call-template name="mal2html.page.seealsolink"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="page" select="."/> - <xsl:with-param name="position"> - <xsl:choose> - <xsl:when test="last() = 1 and count($outlinks) = 0"> - <xsl:text>only</xsl:text> - </xsl:when> - <xsl:when test="position() = 1"> - <xsl:text>first</xsl:text> - </xsl:when> - <xsl:when test="position() = last() and count($outlinks) = 0"> - <xsl:text>last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:with-param> - </xsl:call-template> - </xsl:for-each> - <xsl:for-each select="$outlinks"> - <xsl:variable name="linkid"> - <xsl:choose> - <xsl:when test="contains(@xref, '#')"> - <xsl:value-of select="@xref"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat(@xref, '#', @xref)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="position"> - <xsl:choose> - <xsl:when test="last() = 1 and count($inlinks) = 0"> - <xsl:text>only</xsl:text> - </xsl:when> - <xsl:when test="position() = 1 and count($inlinks) = 0"> - <xsl:text>first</xsl:text> - </xsl:when> - <xsl:when test="position() = last()"> - <xsl:text>last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:for-each select="$cache"> - <xsl:call-template name="mal2html.page.seealsolink"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="page" select="key('cache_key', $linkid)"/> - <xsl:with-param name="position" select="$position"/> - </xsl:call-template> - </xsl:for-each> - </xsl:for-each> - </div> - </xsl:if> - <!-- END guidelinks --> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.seealsolink -Outputs an automatic link block for a seealso link -$node: The #{topic} or #{section} element containing the link -$page: The element from the cache file of the page being linked to -$position: The position of this link in the list, either 'first', 'last', or '' - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.seealsolink"> - <xsl:param name="node" select="."/> - <xsl:param name="page"/> - <xsl:param name="position"/> - <xsl:variable name="xref"> - <xsl:choose> - <xsl:when test="$page/self::mal:section"> - <xsl:value-of select="$page/ancestor::mal:page[1]/@id"/> - <xsl:text>#</xsl:text> - <xsl:value-of select="$page/@id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$page/@id"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <div> - <xsl:attribute name="class"> - <xsl:text>seealsolink</xsl:text> - <xsl:choose> - <xsl:when test="$position = 'only'"> - <xsl:text> seealsolink-only</xsl:text> - </xsl:when> - <xsl:when test="$position = 'first'"> - <xsl:text> seealsolink-first</xsl:text> - </xsl:when> - <xsl:when test="$position = 'last'"> - <xsl:text> seealsolink-last</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:attribute> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="mal.link.target"> - <xsl:with-param name="xref" select="$xref"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="mal.link.content"> - <xsl:with-param name="node" select="."/> - <xsl:with-param name="xref" select="$xref"/> - </xsl:call-template> - </a> - </div> -</xsl:template> - - -<!--**========================================================================== -mal2html.page.css -Outputs CSS that controls the appearance of page elements - -REMARK: Describe this template ---> -<xsl:template name="mal2html.page.css"> -<xsl:text> -html { height: 100%; } -body { - direction: </xsl:text><xsl:call-template name="l10n.direction"/><xsl:text>; - margin: 0px; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-background'"/> - </xsl:call-template> - <xsl:text>; - padding: 12px; - min-height: 100%; -} -<!-- FIXME: only in editor mode & better colors --> -<!-- -body.status-stub { background-color: #ffedc9; } -body.status-draft { background-color: #ffedc9; } -body.status-incomplete { background-color: #ffedc9; } -body.status-review { background-color: #ffedc9; } ---> -div.version { - margin: 0 0 1em 0; - padding: 0.5em 1em 0.5em 1em; - max-width: 60em; - border: solid 1px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-border'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'yellow-background'"/> - </xsl:call-template> - <xsl:text>; -} -div.version p.version { - margin-top: 0.2em; -} -div.body { - margin: 0; - padding: 1em; - max-width: 60em; - min-height: 20em; - border: solid 1px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-border'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'background'"/> - </xsl:call-template> - <xsl:text>; -} -div.copyrights { - text-align: center; - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'text-light'"/> - </xsl:call-template> - <xsl:text>; -} -div.section { margin-top: 2em; clear: both; } -div.section div.section { margin-top: 1.72em; margin-left: 1.72em; } -div.section div.section div.section { margin-top: 1.44em; } -div.header { - margin: 0; - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'text-light'"/> - </xsl:call-template> - <xsl:text>; - border-bottom: solid 1px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-border'"/> - </xsl:call-template> - <xsl:text>; -} -div.section div.section div.header { border: none; } -h1, h2, h3, h4, h5, h6, h7 { margin: 0; } -h1.title { font-size: 1.72em; } -h2.title { font-size: 1.44em; } -h3.title { font-size: 1.2em; } -h4.title { font-size: 1em; } -h5.title { font-size: 1em; } -h6.title { font-size: 1em; } -h7.title { font-size: 1em; } - -div.pagelink div.title { - font-size: 1em; - color: inherit; -} -div.pagelink div.desc { - margin-top: 0.2em; - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'text-light'"/> - </xsl:call-template> - <xsl:text>; -} -div.pagelink { - margin: 0; - padding: 0.5em; - border: solid 1px </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'background'"/> - </xsl:call-template> - <xsl:text>; -} -div.pagelink:hover { - border-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'blue-medium'"/> - </xsl:call-template> - <xsl:text>; - background-color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'blue-light'"/> - </xsl:call-template> - <xsl:text>; -} -ul.guidelinks { - display: block; - margin: 0; - text-align: right; -} -li.guidelink { display: inline; } -li.guidelink::before { - content: ' • '; - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-dark'"/> - </xsl:call-template> - <xsl:text>; -} -li.guidelink-first::before, li.guidelink-only::before { - content: ''; -} -div.seealsolinks { margin: 0; } -div.seealsolink { - display: inline; -} -div.seealsolink::before { - content: ' • '; - color: </xsl:text> - <xsl:call-template name="theme.get_color"> - <xsl:with-param name="id" select="'gray-dark'"/> - </xsl:call-template> - <xsl:text>; -} -div.seealsolink-first::before, div.seealsolink-only::before { - content: ' : '; -} -</xsl:text> -</xsl:template> - - -<!-- == Matched Templates == --> - -<!-- = / = --> -<xsl:template match="/"> - <!-- FIXME: find a way to just select the version element --> - <xsl:variable name="date"> - <xsl:for-each select="mal:page/mal:info/mal:version"> - <xsl:sort select="@date" data-type="text" order="descending"/> - <xsl:if test="position() = 1"> - <xsl:value-of select="@date"/> - </xsl:if> - </xsl:for-each> - </xsl:variable> - <xsl:variable name="version" - select="mal:page/mal:info/mal:version[@date = $date][last()]"/> - <html> - <head> - <title> - <xsl:value-of select="mal:page/mal:title"/> - </title> - <xsl:call-template name="mal2html.css"/> - </head> - <body> - <!-- FIXME: only in editor mode --> - <xsl:if test="$version/@status != ''"> - <xsl:attribute name="class"> - <xsl:value-of select="concat(' status-', $version/@status)"/> - </xsl:attribute> - <div class="version"> - <!-- FIXME: i18n --> - <div class="title">Version Information</div> - <p class="version"> - <xsl:text>Version </xsl:text> - <xsl:value-of select="$version/@number"/> - <xsl:text> on </xsl:text> - <xsl:value-of select="$version/@date"/> - <xsl:text> (</xsl:text> - <xsl:choose> - <xsl:when test="$version/@status = 'stub'"> - <xsl:text>Stub</xsl:text> - </xsl:when> - <xsl:when test="$version/@status = 'incomplete'"> - <xsl:text>Incomplete</xsl:text> - </xsl:when> - <xsl:when test="$version/@status = 'draft'"> - <xsl:text>Draft</xsl:text> - </xsl:when> - <xsl:when test="$version/@status = 'review'"> - <xsl:text>Ready for review</xsl:text> - </xsl:when> - <xsl:when test="$version/@status = 'final'"> - <xsl:text>Final</xsl:text> - </xsl:when> - </xsl:choose> - <xsl:text>)</xsl:text> - </p> - <xsl:apply-templates mode="mal2html.block.mode" select="$version/*"/> - </div> - </xsl:if> - <div class="body"> - <xsl:apply-templates select="mal:page"/> - </div> - <xsl:call-template name="db2html.page.copyrights"> - <xsl:with-param name="node" select="mal:page"/> - </xsl:call-template> - </body> - </html> -</xsl:template> - -<!-- = guide = --> -<xsl:template match="mal:page"> - <div class="header"> - <xsl:apply-templates mode="mal2html.block.mode" - select="mal:title | mal:subtitle"/> - </div> - <xsl:call-template name="mal2html.page.guidelinks"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - <xsl:call-template name="mal2html.page.seealsolinks"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - <div class="contents"> - <xsl:apply-templates - mode="mal2html.block.mode" - select="*[not(self::mal:section | self::mal:title | self::mal:subtitle)]"/> - <xsl:if test="@type = 'guide'"> - <xsl:call-template name="mal2html.page.pagelinks"/> - </xsl:if> - </div> - <xsl:apply-templates select="mal:section"/> -</xsl:template> - -<!-- = section = --> -<xsl:template match="mal:section"> - <div class="section" id="{@id}"> - <div class="header"> - <xsl:apply-templates mode="mal2html.block.mode" - select="mal:title | mal:subtitle"/> - </div> - <xsl:call-template name="mal2html.page.guidelinks"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - <xsl:call-template name="mal2html.page.seealsolinks"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - <div class="contents"> - <xsl:apply-templates - mode="mal2html.block.mode" - select="*[not(self::mal:section | self::mal:title | self::mal:subtitle)]"/> - <xsl:if test="/mal:page/@type = 'guide'"> - <xsl:call-template name="mal2html.page.pagelinks"/> - </xsl:if> - </div> - <xsl:apply-templates select="mal:section"/> - </div> -</xsl:template> - -<!-- = title = --> -<xsl:template mode="mal2html.block.mode" match="mal:title"> - <xsl:variable name="depth" - select="count(ancestor::mal:section) + 1"/> - <xsl:element name="{concat('h', $depth)}"> - <xsl:attribute name="class"> - <xsl:text>title</xsl:text> - </xsl:attribute> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </xsl:element> -</xsl:template> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-table.xsl b/sandbox/mallard/xslt/mal2html-table.xsl deleted file mode 100644 index 3598f6e..0000000 --- a/sandbox/mallard/xslt/mal2html-table.xsl +++ /dev/null @@ -1,407 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns:str="http://exslt.org/strings" - xmlns="http://www.w3.org/1999/xhtml" - extension-element-prefixes="str" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - Table Elements - -REMARK: Describe this module ---> - - -<!--**========================================================================== -mal2html.table.css -Outputs CSS that controls the appearance of tables - -REMARK: Describe this template ---> -<xsl:template name="mal2html.table.css"> -<xsl:text> -table.table { - border-collapse: collapse; - border-color: #555753; - border-width: 1px; -} -td { - padding: 0.5em; - border-color: #888a85; - border-width: 1px; -} -</xsl:text> -</xsl:template> - - -<!-- == Matched Templates == --> - -<!-- = table = --> -<xsl:template mode="mal2html.block.mode" match="mal:table"> - <xsl:variable name="cols" select="mal:col | mal:colgroup/mal:col"/> - <xsl:variable name="style"> - <xsl:if test="@frame and @frame != 'none'"> - <xsl:choose> - <xsl:when test="@frame = 'all'"> - <xsl:text>border-style: solid;</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="str:split(@frame)"> - <xsl:choose> - <xsl:when test=". = 'top'"> - <xsl:text>border-top-style: solid;</xsl:text> - </xsl:when> - <xsl:when test=". = 'bottom'"> - <xsl:text>border-bottom-style: solid;</xsl:text> - </xsl:when> - <xsl:when test=". = 'left'"> - <xsl:text>border-left-style: solid;</xsl:text> - </xsl:when> - <xsl:when test=". = 'right'"> - <xsl:text>border-right-style: solid;</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:if> - </xsl:variable> - <xsl:variable name="rowrules"> - <xsl:choose> - <xsl:when test="not(@rules) or @rules = 'none'"> - <xsl:text>none</xsl:text> - </xsl:when> - <xsl:when test="@rules = 'all'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test="@rules = 'groups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="str:split(@rules)"> - <xsl:choose> - <xsl:when test=". = 'rows'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test=". = 'rowgroups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="colrules"> - <xsl:choose> - <xsl:when test="not(@rules) or @rules = 'none'"> - <xsl:text>none</xsl:text> - </xsl:when> - <xsl:when test="@rules = 'all'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test="@rules = 'groups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="str:split(@rules)"> - <xsl:choose> - <xsl:when test=". = 'cols'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test=". = 'colgroups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="rowshade"> - <xsl:choose> - <xsl:when test="not(@shade) or @shade = 'none'"> - <xsl:text>none</xsl:text> - </xsl:when> - <xsl:when test="@shade = 'all'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test="@shade = 'groups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="str:split(@shade)"> - <xsl:choose> - <xsl:when test=". = 'rows'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test=". = 'rowgroups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="colshade"> - <xsl:choose> - <xsl:when test="not(@shade) or @shade = 'none'"> - <xsl:text>none</xsl:text> - </xsl:when> - <xsl:when test="@shade = 'all'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test="@shade = 'groups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="str:split(@shade)"> - <xsl:choose> - <xsl:when test=". = 'cols'"> - <xsl:text>all</xsl:text> - </xsl:when> - <xsl:when test=". = 'colgroups'"> - <xsl:text>groups</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <div class="table"> - <table class="table"> - <xsl:if test="$style != ''"> - <xsl:attribute name="style"> - <xsl:value-of select="$style"/> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates select="mal:thead"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - <xsl:apply-templates select="mal:tfoot"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - <xsl:apply-templates select="mal:tr | mal:tbody"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - </table> - </div> -</xsl:template> - -<!-- = tbody = --> -<xsl:template match="mal:tbody"> - <xsl:param name="cols"/> - <xsl:param name="rowrules"/> - <xsl:param name="colrules"/> - <xsl:param name="rowshade"/> - <xsl:param name="colshade"/> - <tbody> - <xsl:apply-templates select="mal:tr"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - </tbody> -</xsl:template> - -<!-- = thead = --> -<xsl:template match="mal:thead"> - <xsl:param name="cols"/> - <xsl:param name="rowrules"/> - <xsl:param name="colrules"/> - <xsl:param name="rowshade"/> - <xsl:param name="colshade"/> - <thead> - <xsl:apply-templates select="mal:tr"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - </thead> -</xsl:template> - -<!-- = tfoot = --> -<xsl:template match="mal:tfoot"> - <xsl:param name="cols"/> - <xsl:param name="rowrules"/> - <xsl:param name="colrules"/> - <xsl:param name="rowshade"/> - <xsl:param name="colshade"/> - <tfoot> - <xsl:apply-templates select="mal:tr"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - </tfoot> -</xsl:template> - -<!-- = tr = --> -<xsl:template match="mal:tr"> - <xsl:param name="cols"/> - <xsl:param name="rowrules"/> - <xsl:param name="colrules"/> - <xsl:param name="rowshade"/> - <xsl:param name="colshade"/> - <tr> - <xsl:apply-templates select="mal:td"> - <xsl:with-param name="cols" select="$cols"/> - <xsl:with-param name="rowrules" select="$rowrules"/> - <xsl:with-param name="colrules" select="$colrules"/> - <xsl:with-param name="rowshade" select="$rowshade"/> - <xsl:with-param name="colshade" select="$colshade"/> - </xsl:apply-templates> - </tr> -</xsl:template> - -<!-- = td = --> -<xsl:template match="mal:td"> - <xsl:param name="cols"/> - <xsl:param name="rowrules"/> - <xsl:param name="colrules"/> - <xsl:param name="rowshade"/> - <xsl:param name="colshade"/> - <xsl:variable name="trpos" select="count(../preceding-sibling::mal:tr) + 1"/> - <xsl:variable name="tdpos" select="count(preceding-sibling::mal:td) + 1"/> - <!-- FIXME: this all breaks with rowspan/colspan --> - <xsl:variable name="shaderow"> - <xsl:choose> - <xsl:when test="$rowshade = 'all'"> - <xsl:choose> - <xsl:when test="../../self::mal:table"> - <xsl:value-of select="($trpos + 1) mod 2"/> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="bodies" - select="../../preceding-sibling::mal:tbody | - ../../preceding-sibling::mal:thead "/> - <xsl:variable name="trcount" select="count($bodies/mal:tr) + $trpos"/> - <xsl:value-of select="($trcount + 1) mod 2"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:when test="$rowshade = 'groups'"> - <xsl:variable name="bodies" - select="../../preceding-sibling::mal:tbody | - ../../preceding-sibling::mal:thead "/> - <xsl:value-of select="count($bodies) mod 2"/> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:variable name="shadecol"> - <xsl:choose> - <xsl:when test="$colshade = 'all'"> - <xsl:value-of select="($tdpos + 1) mod 2"/> - </xsl:when> - <xsl:when test="$colshade = 'groups'"> - <xsl:if test="count($cols) >= $tdpos"> - <xsl:variable name="col" select="$cols[$tdpos]"/> - <xsl:if test="$col/../self::mal:colgroup"> - <xsl:value-of - select="count($col/../preceding-sibling::mal:colgroup) mod 2"/> - </xsl:if> - </xsl:if> - <!-- FIXME --> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:variable name="style"> - <xsl:choose> - <xsl:when test="$rowrules = 'all'"> - <xsl:choose> - <xsl:when test="../../self::mal:table"> - <xsl:if test="$trpos != 1"> - <xsl:text>border-top-style: solid;</xsl:text> - </xsl:if> - </xsl:when> - <xsl:when test="$trpos != 1 or - ../../preceding-sibling::mal:thead or - ../../preceding-sibling::mal:tbody "> - <xsl:text>border-top-style: solid;</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:when> - <xsl:when test="$rowrules = 'groups'"> - <xsl:if test="$trpos = 1"> - <xsl:choose> - <xsl:when test="../../self::mal:tbody"> - <xsl:if test="../../../mal:thead | ../../preceding-sibling::mal:tbody"> - <xsl:text>border-top-style: solid;</xsl:text> - </xsl:if> - </xsl:when> - <xsl:when test="../../self::mal:tfoot"> - <xsl:text>border-top-style: solid;</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:if> - </xsl:when> - </xsl:choose> - <xsl:choose> - <xsl:when test="$tdpos = 1"/> - <xsl:when test="$colrules = 'all'"> - <xsl:text>border-left-style: solid;</xsl:text> - </xsl:when> - <xsl:when test="$colrules = 'groups'"> - <xsl:if test="count($cols) >= $tdpos"> - <xsl:variable name="col" select="$cols[$tdpos]"/> - <xsl:if test="$col/../self::mal:colgroup and - not($col/preceding-sibling::mal:col)"> - <xsl:text>border-left-style: solid;</xsl:text> - </xsl:if> - </xsl:if> - </xsl:when> - </xsl:choose> - <xsl:choose> - <xsl:when test="$shaderow = 1 and $shadecol = 1"> - <xsl:text>background-color: #d3d7cf;</xsl:text> - </xsl:when> - <xsl:when test="$shaderow = 1 or $shadecol = 1"> - <xsl:text>background-color: #eeeeec;</xsl:text> - </xsl:when> - </xsl:choose> - </xsl:variable> - <td> - <xsl:if test="$style != ''"> - <xsl:attribute name="style"> - <xsl:value-of select="$style"/> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates mode="mal2html.block.mode"/> - </td> -</xsl:template> - -</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html.xsl b/sandbox/mallard/xslt/mal2html.xsl deleted file mode 100644 index cbe3ac6..0000000 --- a/sandbox/mallard/xslt/mal2html.xsl +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> -<!-- -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2 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 Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; see the file COPYING.LGPL. If not, write to the -Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. ---> - -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:mal="http://www.gnome.org/~shaunm/mallard" - xmlns="http://www.w3.org/1999/xhtml" - version="1.0"> - -<!--!!========================================================================== -Mallard to HTML - -REMARK: Describe this module ---> - -<xsl:include href="mal-link.xsl"/> - -<xsl:include href="mal2html-block.xsl"/> -<xsl:include href="mal2html-css.xsl"/> -<xsl:include href="mal2html-inline.xsl"/> -<xsl:include href="mal2html-list.xsl"/> -<xsl:include href="mal2html-media.xsl"/> -<xsl:include href="mal2html-page.xsl"/> -<xsl:include href="mal2html-table.xsl"/> - -<xsl:include href="theme.xsl"/> -<xsl:include href="util.xsl"/> - -<xsl:param name="mal.extension" select="'.xhtml'"/> -<xsl:param name="mal.cache_file"/> -<xsl:variable name="cache" select="document($mal.cache_file)"/> -<xsl:key name="cache_key" match="*[@id]" - use="concat(ancestor-or-self::mal:page[1]/@id, '#', @id)"/> - -<!-- FIXME --> -<xsl:template match="*"> - <xsl:message> - <xsl:text>Unmatched element: </xsl:text> - <xsl:value-of select="local-name(.)"/> - </xsl:message> - <xsl:apply-templates/> -</xsl:template> - -<!-- FIXME --> -<xsl:template name="l10n.gettext"> - <xsl:param name="msgid" select="'email.tooltip'"/> - <xsl:value-of select="$msgid"/> -</xsl:template> -<xsl:template name="l10n.direction"> - <xsl:text>ltr</xsl:text> -</xsl:template> - -</xsl:stylesheet> |