Add an optional id tag to sub/sections, so they can be referenced

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@280036 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl committed 2005-09-10 19:44:04 +00:00
1 parent a30cfc340e
commit 39eff73d60
3 files changed
+69 -11

No files matched your search

+27 -11
View File
@@ -453,7 +453,8 @@
<jsl:template match="section" trim="true">
<div class="section">
<x:set var="_sectionName" select="string(@name)"/>
<j:set var="_sectionId"><x:expr select="@id"/></j:set>
<!-- Key is more important than message... -->
<j:set var="_key">
<x:expr select="@key" />
@@ -473,11 +474,18 @@
</j:if>
</j:if>
<!-- named anchors can't contain whitespaces -->
<j:set var="_anchorName"><doc:escapeNameToken value="${_sectionName}"/></j:set>
<j:if test="${!empty(_sectionName)}">
<a name="${_anchorName}"/><h2>${_sectionName}</h2>
<!-- construct anchor from 'id' tag if it exists, from 'name' tag otherwise -->
<j:if test="${!empty(_sectionId)}">
<j:set var="_anchorName"><x:expr select="@id"/></j:set>
</j:if>
<j:if test="${empty(_sectionId)}">
<!-- named anchors can't contain whitespaces -->
<j:set var="_anchorName"><doc:escapeNameToken value="${_sectionName}"/></j:set>
</j:if>
<j:if test="${!empty(_anchorName)}">
<a name="${_anchorName}"/>
</j:if>
<h2>${_sectionName}</h2>
<jsl:applyTemplates />
</div>
</jsl:template>
@@ -485,7 +493,8 @@
<jsl:template match="subsection" trim="true">
<div class="subsection">
<x:set var="_sectionName" select="string(@name)"/>
<j:set var="_sectionId"><x:expr select="@id"/></j:set>
<!-- Key is more important than message... -->
<j:set var="_key">
<x:expr select="@key" />
@@ -504,12 +513,19 @@
</fmt:bundle>
</j:if>
</j:if>
<!-- named anchors can't contain whitespaces -->
<j:set var="_anchorName"><doc:escapeNameToken value="${_sectionName}"/></j:set>
<j:if test="${!empty(_sectionName)}">
<a name="${_anchorName}"/><h3>${_sectionName}</h3>
<!-- construct anchor from 'id' tag if it exists, from 'name' tag otherwise -->
<j:if test="${!empty(_sectionId)}">
<j:set var="_anchorName"><x:expr select="@id"/></j:set>
</j:if>
<j:if test="${empty(_sectionId)}">
<!-- named anchors can't contain whitespaces -->
<j:set var="_anchorName"><doc:escapeNameToken value="${_sectionName}"/></j:set>
</j:if>
<j:if test="${!empty(_anchorName)}">
<a name="${_anchorName}"/>
</j:if>
<h3>${_sectionName}</h3>
<jsl:applyTemplates />
</div>
</jsl:template>