view xsls/content.xsls @ 721:81ad082bc837

Simplified things by including books.xslt, download.xslt and security.xslt into article.xslt, and always using article.xslt to generate HTMLs. While here, moved versions.xml from common dependencies to article dependencies. Fixed menu in 404.html by applying templates from menu.xslt, and fixed its dependency on DTD.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 12 Oct 2012 09:10:31 +0000
parents a8f7b93b0a5f
children 3b0ea2ab2b24
line wrap: on
line source

<!--
  Copyright (C) Igor Sysoev
  Copyright (C) Nginx, Inc.
  -->

X:stylesheet {

    X:template = "section[@id and @name]" {
        <a name="{@id}" /> <center><h4> !{@name} </h4></center>
        !!;
    }

    X:template = "section/section[@id and @name]" {
        <a name="{@id}" /> <center><h5> !{@name} </h5></center>
        !!;
    }

    X:template = "section[@id and not(@name)]" {
        <a name="{@id}" />
        !!;
    }

    X:template = "section[not(@id) and @name]" {
        <center><h4> !{@name} </h4></center>
        !!;
    }

    X:template = "section/section[not(@id) and @name]" {
        <center><h5> !{@name} </h5></center>
        !!;
    }

    X:template = "para" { <p> !!; </p> }

    X:template = "para[@align]" { <p align="{@align}"> !!; </p> }

    X:template = "initial" { <span class="initial"><b> !!; </b></span> }


    X:template = "programlisting" { <blockquote class="example"><pre> !!; </pre></blockquote> }

    X:template = "para/programlisting" {
        X:text disable-output-escaping="yes" {&lt;/p&gt; }
        <blockquote class="example"><pre> !!; </pre></blockquote>
        X:text disable-output-escaping="yes" {&lt;p&gt; }
    }


    X:template = "note" { <blockquote class="note"> !!; </blockquote> }

    X:template = "para/note" {
        X:text disable-output-escaping="yes" {&lt;/p&gt; }
        <blockquote class="note"> !!; </blockquote>
        X:text disable-output-escaping="yes" {&lt;p&gt; }
    }

    X:template = "list[@type='bullet']" {
        X:if "@compact = 'yes'" {
            <ul class="compact"> !!; </ul>
        } else {
            <ul> !!; </ul>
        }
    }
    X:template = "para/list[@type='bullet']" {
        X:text disable-output-escaping="yes" {&lt;/p&gt; }
        X:if "@compact = 'yes'" {
            <ul class="compact"> !!; </ul>
        } else {
            <ul> !!; </ul>
        }
        X:text disable-output-escaping="yes" {&lt;p&gt; }
    }

    X:template = "list[@type='enum']" {
        X:if "@compact = 'yes'" {
            <ol class="compact"> !!; </ol>
        } else {
            <ol> !!; </ol>
        }
    }
    X:template = "para/list[@type='enum']" {
        X:text disable-output-escaping="yes" {&lt;/p&gt; }
        X:if "@compact = 'yes'" {
            <ol class="compact"> !!; </ol>
        } else {
            <ol> !!; </ol>
        }
        X:text disable-output-escaping="yes" {&lt;p&gt; }
    }

    X:template = "listitem" { <li> !!; </li> }
    
    X:template = "list[@type='tag']" {
        X:if "@compact = 'yes'" {
            <dl class="compact"> !!; </dl>
        } else {
            <dl> !!; </dl>
        }
    }
    X:template = "para/list[@type='tag']" {
        X:text disable-output-escaping="yes" {&lt;/p&gt; }
        X:if "@compact = 'yes'" {
            <dl class="compact"> !!; </dl>
        } else {
            <dl> !!; </dl>
        }
        X:text disable-output-escaping="yes" {&lt;p&gt; }
    }

    X:template = "tag-name" { <dt> !!; </dt> }
    X:template = "tag-desc" { <dd> !!; </dd> }

    X:template = "table[@note and @width]" {
        <blockquote><table width="{@width}"> !!; </table></blockquote>
    }
    X:template = "table[@note and not(@width)]" {
        <blockquote><table width="100%"> !!; </table></blockquote>
    }
    X:template = "table[not(@note) and @width]" {
        <table width="{@width}"> !!; </table>
    }
    X:template = "table" { <table width="100%"> !!; </table> }
    X:template = "tr" { <tr> !!; </tr> }
    X:template = "td[@width]" { <td width="{@width}"> !!; </td> }
    X:template = "td" { <td> !!; </td> }

    X:template = "c-def" { <code> !!; </code> }

    X:template = "c-func" { <code> !!; X:text{()} </code> }

    X:template = "command" { <code> !!; </code> }

    X:template = "emphasis" { <strong> !!; </strong> }

    X:template = "example" { <blockquote class="example"><pre> !!; </pre></blockquote> }

    X:template = "para/example" {
        X:text disable-output-escaping="yes" {&lt;/p&gt; }
        <blockquote class="example"><pre> !!; </pre></blockquote>
        X:text disable-output-escaping="yes" {&lt;p&gt; }
    }

    X:template = "literal" { <code> !!; </code> }

    X:template = "header" {
        X:text {&#8220;} !!; X:text {&#8221;}
    }

    X:template = "http-status" {
        !{@code} X:text { (} !{@text} X:text{)}
    }

    X:template = "value" { <code><i> !!; </i></code> }

    X:template = "registered" { !!; <sup> X:text {&#174;} </sup> }

    X:template = "var" { <code> !!; </code> }

    X:template = "path" { <code> !!; </code> }
    X:template = "i" { <i> !!; </i> }
    X:template = "b" { <b> !!; </b> }
    X:template = "nobr" { <nobr> !!; </nobr> }
    X:template = "br" { <br/> }


}