|
12 | 12 | encoding="UTF-8"/>
|
13 | 13 | <xsl:preserve-space elements="*"/>
|
14 | 14 |
|
15 |
| -<!-- Do add border div for figure images in cookbook series --> |
16 |
| -<xsl:param name="figure.border.div" select="1"/> |
| 15 | + |
17 | 16 |
|
18 | 17 | <!-- Generate separate footnote-call markers, so that we don't
|
19 | 18 | need to rely on AH counters to do footnote numbering -->
|
20 | 19 | <xsl:param name="process.footnote.callouts.only" select="1"/>
|
21 | 20 |
|
22 |
| -<!-- ***************** COOKBOOK PARAMS ***************** --> |
23 |
| -<!-- *************** Overrides param.xsl *************** --> |
24 |
| - |
25 |
| -<!-- Recipe format should be "X.1 Title, no second period" --> |
26 |
| -<xsl:param name="recipe.number.and.title.separator" select="' '"/> |
27 |
| - |
28 |
| -<!-- This book should show sect2s in TOC --> |
29 |
| -<xsl:param name="toc.section.depth" select="2"/> |
30 |
| - |
31 |
| -<!-- ***************** LABEL HANDLING ***************** --> |
32 |
| -<!-- ************* Overrides common.xsl *************** --> |
33 |
| - |
34 |
| - <!-- Logic for processing sect1 headings with labels (including section numbers) --> |
35 |
| - <xsl:template match="h:section[@data-type='chapter' and not(contains(@class, 'orm:non-recipe'))]/h:section[@data-type='sect1' and not(contains(@class, 'orm:non-recipe'))]/h:h1" mode="process-heading"> |
36 |
| - <xsl:param name="autogenerate.labels" select="$autogenerate.labels"/> |
37 |
| - <!-- Labeled element is typically the parent element of the heading (e.g., <section> or <figure>) --> |
38 |
| - <xsl:param name="labeled-element" select="(parent::h:header/parent::*|parent::*[not(self::h:header)])[1]"/> |
39 |
| - <!-- Labeled element semantic name is typically the parent element of the heading's @data-type --> |
40 |
| - <xsl:param name="labeled-element-semantic-name" select="(parent::h:header/parent::*|parent::*[not(self::h:header)])[1]/@data-type"/> |
41 |
| - <!-- Name for output heading element; same as current node name by default --> |
42 |
| - <xsl:param name="output-element-name" select="local-name(.)"/> |
43 |
| - <xsl:element name="{$output-element-name}" namespace="http://www.w3.org/1999/xhtml"> |
44 |
| - <xsl:apply-templates select="@*"/> |
45 |
| - <!-- BEGIN COOKBOOK OVERRIDE --> |
46 |
| - <!-- Recipes should have labels in format #.# --> |
47 |
| - <xsl:apply-templates select="$labeled-element" mode="label.markup"/> |
48 |
| - <xsl:value-of select="$recipe.number.and.title.separator"/> |
49 |
| - <xsl:apply-templates/> |
50 |
| - <!-- END COOKBOOK OVERRIDE --> |
51 |
| - </xsl:element> |
52 |
| - </xsl:template> |
53 | 21 |
|
54 | 22 | <!-- Logic for processing sect2 headings with labels (including section numbers) -->
|
55 | 23 | <xsl:template match="h:section[@data-type='sect2']/h:h2" mode="process-heading">
|
|
62 | 30 | <xsl:param name="output-element-name" select="local-name(.)"/>
|
63 | 31 | <xsl:element name="{$output-element-name}" namespace="http://www.w3.org/1999/xhtml">
|
64 | 32 | <xsl:apply-templates select="@*"/>
|
65 |
| - <!-- BEGIN COOKBOOK OVERRIDE --> |
66 |
| - <!-- Recipes should have labels in format #.# --> |
67 |
| - <xsl:apply-templates select="$labeled-element" mode="label.markup"/> |
68 |
| - <xsl:value-of select="$recipe.number.and.title.separator"/> |
69 |
| - <xsl:apply-templates/> |
70 |
| - <!-- END COOKBOOK OVERRIDE --> |
| 33 | + |
71 | 34 | </xsl:element>
|
72 | 35 | </xsl:template>
|
73 | 36 |
|
74 | 37 | <!-- Creating the sect1 labels (read: creating the X.X section numbering) -->
|
75 | 38 | <xsl:template match="h:section[@data-type='sect1']" mode="label.markup">
|
76 | 39 | <xsl:variable name="current-node" select="."/>
|
77 |
| - <!-- BEGIN COOKBOOK OVERRIDE --> |
78 |
| - <!-- Recipes should always be labeled with ancestor chapter --> |
79 |
| - <xsl:for-each select="ancestor::h:section[@data-type='chapter']"> |
80 |
| - <xsl:call-template name="get-label-from-data-type"> |
81 |
| - <xsl:with-param name="data-type" select="@data-type"/> |
82 |
| - </xsl:call-template> |
83 |
| - <xsl:apply-templates select="$current-node" mode="intralabel.punctuation"/> |
84 |
| - </xsl:for-each> |
85 |
| - |
86 |
| - <!-- Custom Recipe numbering logic: |
87 |
| - * Don't number Recipes with class=orm:non-recipe |
88 |
| - * Introduction sections at the beginning of chapters have labeling start at #.0 |
89 |
| - --> |
90 |
| - <xsl:variable name="is.numbered"> |
91 |
| - <xsl:choose> |
92 |
| - <xsl:when test="@class='orm:non-recipe'">1</xsl:when> |
93 |
| - <xsl:otherwise>0</xsl:otherwise> |
94 |
| - </xsl:choose> |
95 |
| - </xsl:variable> |
96 |
| - |
97 |
| - <xsl:variable name="chap.has.intro"> |
98 |
| - <xsl:choose> |
99 |
| - <xsl:when test="$is.numbered = 0"> |
100 |
| - <xsl:call-template name="check.chap.for.intro"> |
101 |
| - <xsl:with-param name="chapter" select="parent::*"/> |
102 |
| - </xsl:call-template> |
103 |
| - </xsl:when> |
104 |
| - <xsl:otherwise>1</xsl:otherwise> |
105 |
| - </xsl:choose> |
106 |
| - </xsl:variable> |
107 | 40 |
|
108 |
| - <xsl:variable name="recipe.level"> |
109 |
| - <xsl:value-of select="count(preceding-sibling::h:section[@data-type='sect1']) + (1 - $chap.has.intro - $is.numbered)"/> |
110 |
| - </xsl:variable> |
111 |
| - <xsl:number format="1" value="$recipe.level"/> |
112 |
| - |
113 |
| - <!-- END COOKBOOK OVERRIDE --> |
114 | 41 | </xsl:template>
|
115 | 42 |
|
116 | 43 | <!-- Creating the sect2 labels (read: creating the X.X.X section numbering) -->
|
117 | 44 | <xsl:template match="h:section[@data-type='sect2']" mode="label.markup">
|
118 | 45 | <!-- END OVERRIDE -->
|
119 | 46 | <xsl:variable name="current-node" select="."/>
|
120 |
| - <!-- BEGIN COOKBOOK OVERRIDE --> |
121 |
| - <!-- Recipes should always be labeled with ancestor chapter --> |
122 |
| - <xsl:for-each select="ancestor::h:section[@data-type='chapter']"> |
123 |
| - <xsl:call-template name="get-label-from-data-type"> |
124 |
| - <xsl:with-param name="data-type" select="@data-type"/> |
125 |
| - </xsl:call-template> |
126 |
| - <xsl:apply-templates select="$current-node" mode="intralabel.punctuation"/> |
127 |
| - </xsl:for-each> |
128 |
| - |
129 |
| - <!-- Custom Recipe numbering logic: |
130 |
| - * Don't number Recipes with class=orm:non-recipe |
131 |
| - * Introduction sections at the beginning of chapters have labeling start at #.0 |
132 |
| - --> |
133 |
| - <xsl:variable name="is.numbered"> |
134 |
| - <xsl:choose> |
135 |
| - <xsl:when test="parent::h:section/@class='orm:non-recipe'">1</xsl:when> |
136 |
| - <xsl:otherwise>0</xsl:otherwise> |
137 |
| - </xsl:choose> |
138 |
| - </xsl:variable> |
139 |
| - |
140 |
| - <xsl:variable name="chap.has.intro"> |
141 |
| - <xsl:choose> |
142 |
| - <xsl:when test="$is.numbered = 0"> |
143 |
| - <xsl:call-template name="check.chap.for.intro"> |
144 |
| - <xsl:with-param name="chapter" select="ancestor::h:section[data-type='chapter']"/> |
145 |
| - </xsl:call-template> |
146 |
| - </xsl:when> |
147 |
| - <xsl:otherwise>1</xsl:otherwise> |
148 |
| - </xsl:choose> |
149 |
| - </xsl:variable> |
150 | 47 |
|
151 |
| - <xsl:variable name="sect1.recipe.level"> |
152 |
| - <xsl:value-of select="count(../preceding-sibling::h:section[@data-type='sect1']) + (1 - $chap.has.intro - $is.numbered)"/> |
153 |
| - </xsl:variable> |
154 |
| - <xsl:number format="1" value="$sect1.recipe.level"/> |
155 |
| - <xsl:text>.</xsl:text> |
156 |
| - |
157 |
| - <xsl:variable name="is.sect1.numbered"> |
158 |
| - <xsl:choose> |
159 |
| - <xsl:when test="@class='orm:non-recipe'">1</xsl:when> |
160 |
| - <xsl:otherwise>0</xsl:otherwise> |
161 |
| - </xsl:choose> |
162 |
| - </xsl:variable> |
163 |
| - |
164 |
| - <xsl:variable name="sect1.has.intro"> |
165 |
| - <xsl:choose> |
166 |
| - <xsl:when test="$is.sect1.numbered = 0"> |
167 |
| - <xsl:call-template name="check.sect1.for.intro"> |
168 |
| - <xsl:with-param name="sect1" select="parent::*"/> |
169 |
| - </xsl:call-template> |
170 |
| - </xsl:when> |
171 |
| - <xsl:otherwise>1</xsl:otherwise> |
172 |
| - </xsl:choose> |
173 |
| - </xsl:variable> |
174 |
| - |
175 |
| - <xsl:variable name="recipe.level"> |
176 |
| - <xsl:value-of select="count(preceding-sibling::h:section[@data-type='sect2'][not(@class='orm:non-recipe')]) + (1 - $sect1.has.intro - $is.sect1.numbered)"/> |
177 |
| - </xsl:variable> |
178 |
| - <xsl:number format="1" value="$recipe.level"/> |
179 |
| - |
180 |
| - <!-- END COOKBOOK OVERRIDE --> |
181 | 48 | </xsl:template>
|
182 | 49 | <!-- Utility template -->
|
183 | 50 | <xsl:template name="check.chap.for.intro">
|
|
280 | 147 | <xsl:with-param name="object" select="."/>
|
281 | 148 | </xsl:call-template>
|
282 | 149 | </xsl:attribute>
|
283 |
| - <!-- BEGIN COOKBOOK OVERRIDE --> |
284 |
| - <xsl:if test="(self::h:section[@data-type='sect1'] and ancestor::h:section[@data-type='chapter'] or self::h:section[@data-type='sect2'] and ancestor::h:section[@data-type='sect1']) and not(ancestor-or-self::h:section[contains(@class, 'orm:non-recipe')])"> |
285 |
| - <xsl:variable name="toc-entry-label"> |
286 |
| - <xsl:apply-templates select="." mode="label.markup"/> |
287 |
| - </xsl:variable> |
288 |
| - <xsl:value-of select="normalize-space($toc-entry-label)"/> |
289 |
| - <xsl:value-of select="$recipe.number.and.title.separator"/> |
290 |
| - </xsl:if> |
291 |
| - <!-- END COOKBOOK OVERRIDE --> |
| 150 | + |
292 | 151 | <xsl:apply-templates select="." mode="title.markup"/>
|
293 | 152 | </a>
|
294 | 153 | <!-- Make sure there are descendants that conform to $toc.section.depth restrictions before generating nested TOC <ol> -->
|
|
0 commit comments