]> granicus.if.org Git - apache/blob - docs/manual/style/xsl/list_for_prettify.xsl
Help doc writer to spot places where:
[apache] / docs / manual / style / xsl / list_for_prettify.xsl
1 <?xml version="1.0"?>
2
3 <!--
4  Licensed to the Apache Software Foundation (ASF) under one or more
5  contributor license agreements.  See the NOTICE file distributed with
6  this work for additional information regarding copyright ownership.
7  The ASF licenses this file to You under the Apache License, Version 2.0
8  (the "License"); you may not use this file except in compliance with
9  the License.  You may obtain a copy of the License at
10
11      http://www.apache.org/licenses/LICENSE-2.0
12
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 -->
19
20 <!DOCTYPE xsl:stylesheet [
21     <!ENTITY lf SYSTEM "util/lf.xml">
22 ]>
23 <xsl:stylesheet version="1.0"
24               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25                   xmlns="http://www.w3.org/1999/xhtml">
26
27 <xsl:output method="text" encoding="ISO-8859-1" indent="no" />
28
29 <!-- ==================================================================== -->
30 <!-- <modulefilelist>                                                     -->
31 <!-- Builds the rewrite map                                               -->
32 <!-- ==================================================================== -->
33 <xsl:template match="modulefilelist">
34 <xsl:text># GENERATED FROM XML -- DO NOT EDIT</xsl:text>&lf;
35 <xsl:text>#</xsl:text>&lf;
36 <xsl:text># Below is the up-to-date list of existing directives. The list is formatted</xsl:text>&lf;
37 <xsl:text># in order to be ready to use for the JS used in prettify.js</xsl:text>&lf;
38 &lf;
39 <xsl:text># The next line has to be copy/pasted into prettify.js around line 135</xsl:text>&lf;
40 <xsl:text># in place of the correponding CONFIG_KEYWORDS array.</xsl:text>&lf;
41 &lf;
42
43 <xsl:variable name="directives"
44     select="document(modulefile)/modulesynopsis[status!='Obsolete']
45                 /directivesynopsis[not(@location)]" />
46
47 <xsl:text>  var CONFIG_KEYWORDS = ["</xsl:text>
48 <xsl:for-each select="$directives">
49     <!-- Sorting is useless here, but the output is nicer -->
50     <xsl:sort select="name" />
51     <xsl:call-template name="list_directive" />
52 </xsl:for-each>
53 <xsl:text>"];</xsl:text>
54
55 &lf;
56 &lf;
57 &lf;
58 <xsl:text># The next line has to be copy/pasted into prettify.js around line 920</xsl:text>&lf;
59 <xsl:text># in place of the correponding PR_TAG array.</xsl:text>&lf;
60 &lf;
61
62 <xsl:text>        [PR_TAG,     /^\b(</xsl:text>
63 <xsl:for-each select="$directives[@type='section']">
64     <!-- Sorting is useless here, but the output is nicer -->
65     <xsl:sort select="name" />
66     <xsl:call-template name="list_section" />
67 </xsl:for-each>
68 <xsl:text>)\b/, null],</xsl:text>
69
70 </xsl:template>
71 <!-- /modulefilelist -->
72
73 <!-- ==================================================================== -->
74 <!-- <list_directive>                                                     -->
75 <!-- ==================================================================== -->
76 <xsl:template name="list_directive">
77
78     <xsl:if test="position()!=1">
79         <xsl:text>,</xsl:text>
80     </xsl:if>
81
82     <xsl:if test="@type = 'section'"><xsl:text>&lt;</xsl:text></xsl:if>
83     <xsl:value-of select="name" />
84     <xsl:if test="@type = 'section'"><xsl:text>&gt;</xsl:text></xsl:if>
85
86 </xsl:template>
87 <!-- /list_directive -->
88
89 <!-- ==================================================================== -->
90 <!-- <list_section>                                                       -->
91 <!-- ==================================================================== -->
92 <xsl:template name="list_section">
93
94     <xsl:if test="position()!=1">
95         <xsl:text>|</xsl:text>
96     </xsl:if>
97
98     <xsl:value-of select="name" />
99
100 </xsl:template>
101 <!-- /list_section -->
102
103 </xsl:stylesheet>