view xsls/directive.xsls @ 166:28ba010fce96

The rendering of "syntax", "default", and "context" is made non-bold. The rendering of the directive's name under "syntax" is made bold.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 02 Nov 2011 11:50:40 +0000
parents 273d7407de69
children 6eeaa9e1f3b5
line wrap: on
line source

X:stylesheet {

    X:template = "directive" {
        <a name="{@name}"/>
        <!-- <center><h4> !{@name} </h4></center> -->
        <div class="directive">
        <table cellspacing="0">
        !! "syntax";
        !! "default";
        !! "context";
        </table>
        X:if "(@appeared-in)" {
            <p>This directive appeared in version !{@appeared-in}.</p>
        }
        </div>
        !! "para";
    }

    X:template = "syntax" {
        X:if "position() = 1" {
            X:text disable-output-escaping="yes" {
                &lt;tr&gt;
                &lt;td&gt;
            }
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='syntax']}
            X:text{:}
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;td&gt;
            }
        }
        <code>
        <strong>
        !{../@name}
        </strong>
        X:if "count(node()) != 0" {
            X:text{ } !!;
        }
        X:if "@block = 'yes'" {
            X:text{ \{ ... \}}
        } else {
            X:text{;}
        }
        </code>
        <br/>
        X:if "position() = last()" {
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;/tr&gt;
            }
        }
    }

    X:template = "default" {
        X:if "position() = 1" {
            X:text disable-output-escaping="yes" {
                &lt;tr&gt;
                &lt;td&gt;
            }
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='default']}
            X:text{:}
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;td&gt;
            }
        }
        X:if "count(node()) = 0" {
            &#8212;
        } else {
            <pre>
            !{../@name}
            X:if "count(../syntax[@block='yes'])" {
                X:text{ \{} !!; X:text{\}}
            } else {
                X:text{ } !!; X:text{;}
            }
            </pre>
        }
        X:if "position() = last()" {
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;/tr&gt;
            }
        }
    }

    X:template = "context" {
        X:if "position() = 1" {
            X:text disable-output-escaping="yes" {
                &lt;tr&gt;
                &lt;td&gt;
            }
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='context']}
            X:text{:}
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;td&gt;
            }
        }
        <code>
        X:if "count(node()) = 0" {
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='context.any']}
        } else {
            !!;
        }
        </code>
        X:if "position() != last()" {
            X:text{, }
        } else {
            <br/>
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;/tr&gt;
            }
        }
    }

}