|
52 | 52 | </xsl:template>
|
53 | 53 |
|
54 | 54 | <!-- Logic for processing sect2 headings with labels (including section numbers) -->
|
55 |
| - <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:section[@data-type='sect2' and not(contains(@class, 'orm:non-recipe'))]/h:h2" mode="process-heading"> |
| 55 | + <xsl:template match="h:section[@data-type='sect2']/h:h2" mode="process-heading"> |
56 | 56 | <xsl:param name="autogenerate.labels" select="$autogenerate.labels"/>
|
57 | 57 | <!-- Labeled element is typically the parent element of the heading (e.g., <section> or <figure>) -->
|
58 | 58 | <xsl:param name="labeled-element" select="(parent::h:header/parent::*|parent::*[not(self::h:header)])[1]"/>
|
|
72 | 72 | </xsl:template>
|
73 | 73 |
|
74 | 74 | <!-- Creating the sect1 labels (read: creating the X.X section numbering) -->
|
75 |
| - <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'))]" mode="label.markup"> |
| 75 | + <xsl:template match="h:section[@data-type='sect1']" mode="label.markup"> |
76 | 76 | <xsl:variable name="current-node" select="."/>
|
77 | 77 | <!-- BEGIN COOKBOOK OVERRIDE -->
|
78 | 78 | <!-- Recipes should always be labeled with ancestor chapter -->
|
|
106 | 106 | </xsl:variable>
|
107 | 107 |
|
108 | 108 | <xsl:variable name="recipe.level">
|
109 |
| - <xsl:value-of select="count(preceding-sibling::h:section[@data-type='sect1'][not(@class='orm:non-recipe')]) + (1 - $chap.has.intro - $is.numbered)"/> |
| 109 | + <xsl:value-of select="count(preceding-sibling::h:section[@data-type='sect1']) + (1 - $chap.has.intro - $is.numbered)"/> |
110 | 110 | </xsl:variable>
|
111 | 111 | <xsl:number format="1" value="$recipe.level"/>
|
112 | 112 |
|
113 | 113 | <!-- END COOKBOOK OVERRIDE -->
|
114 | 114 | </xsl:template>
|
115 | 115 |
|
116 | 116 | <!-- Creating the sect2 labels (read: creating the X.X.X section numbering) -->
|
117 |
| - <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:section[@data-type='sect2' and not(contains(@class, 'orm:non-recipe'))]" mode="label.markup"> |
| 117 | + <xsl:template match="h:section[@data-type='sect2']" mode="label.markup"> |
118 | 118 | <!-- END OVERRIDE -->
|
119 | 119 | <xsl:variable name="current-node" select="."/>
|
120 | 120 | <!-- BEGIN COOKBOOK OVERRIDE -->
|
|
149 | 149 | </xsl:variable>
|
150 | 150 |
|
151 | 151 | <xsl:variable name="sect1.recipe.level">
|
152 |
| - <xsl:value-of select="count(../preceding-sibling::h:section[@data-type='sect1'][not(@class='orm:non-recipe')]) + (1 - $chap.has.intro - $is.numbered)"/> |
| 152 | + <xsl:value-of select="count(../preceding-sibling::h:section[@data-type='sect1']) + (1 - $chap.has.intro - $is.numbered)"/> |
153 | 153 | </xsl:variable>
|
154 | 154 | <xsl:number format="1" value="$sect1.recipe.level"/>
|
155 | 155 | <xsl:text>.</xsl:text>
|
|
196 | 196 | </xsl:choose>
|
197 | 197 | </xsl:template>
|
198 | 198 |
|
199 |
| - <!-- Custom xref handling --> |
| 199 | + <!-- ***************** Custom xref handling ************ --> |
200 | 200 | <!-- Overrides xrefgen.xsl -->
|
201 | 201 |
|
202 | 202 | <!-- Testing selector to make custom xrefs to sections -->
|
203 |
| - <xsl:template match="h:section[@data-type='sect1']" mode="xref-to"> |
204 |
| - <!-- Otherwise, throw warning, and print out ??? --> |
205 |
| - <xsl:call-template name="log-message"> |
206 |
| - <xsl:with-param name="type" select="'WARNING'"/> |
207 |
| - <xsl:with-param name="message"> |
208 |
| - <xsl:text>Cannot output gentext for XREF to refentry (id:</xsl:text> |
209 |
| - <xsl:value-of select="@id"/> |
210 |
| - <xsl:text>) that does not contain an element with class of refname</xsl:text> |
211 |
| - </xsl:with-param> |
212 |
| - </xsl:call-template> |
213 |
| - <xsl:text>???</xsl:text> |
214 |
| - </xsl:template> |
| 203 | + <xsl:template match="h:section[@data-type='sect1']" mode="xref-to"> |
| 204 | + <xsl:param name="referrer"/> |
| 205 | + <xsl:param name="xrefstyle"/> |
| 206 | + <xsl:param name="verbose" select="1"/> |
| 207 | + <xsl:choose> |
| 208 | + <xsl:when test="h:h1"> |
| 209 | + <xsl:apply-templates select="." mode="object.xref.markup"> |
| 210 | + <xsl:with-param name="purpose" select="'xref'"/> |
| 211 | + <!-- BEGIN OVERRIDE --> |
| 212 | + <xsl:with-param name="xrefstyle" select="'template: %n%t'"/> |
| 213 | + <!-- END OVERRIDE --> |
| 214 | + <xsl:with-param name="referrer" select="$referrer"/> |
| 215 | + <xsl:with-param name="verbose" select="$verbose"/> |
| 216 | + </xsl:apply-templates> |
| 217 | + </xsl:when> |
| 218 | + <xsl:otherwise> |
| 219 | + <!-- Otherwise, throw warning, and print out ??? --> |
| 220 | + <xsl:call-template name="log-message"> |
| 221 | + <xsl:with-param name="type" select="'WARNING'"/> |
| 222 | + <xsl:with-param name="message"> |
| 223 | + <xsl:text>Cannot output gentext for XREF to section (id:</xsl:text> |
| 224 | + <xsl:value-of select="@id"/> |
| 225 | + </xsl:with-param> |
| 226 | + </xsl:call-template> |
| 227 | + <xsl:text>???</xsl:text> |
| 228 | + </xsl:otherwise> |
| 229 | + </xsl:choose> |
| 230 | + </xsl:template> |
215 | 231 |
|
216 | 232 | <!-- ***************** TOC HANDLING ***************** -->
|
217 | 233 | <!-- ************* Overrides tocgen.xsl ************* -->
|
|
0 commit comments