Skip to content

Commit

Permalink
use @Class="compact" instead of @compact="yes" for HTML outputs
Browse files Browse the repository at this point in the history
Signed-off-by: chrispy <[email protected]>
  • Loading branch information
chrispy-snps committed Dec 18, 2023
1 parent 01baaf2 commit e31e610
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 47 deletions.
6 changes: 1 addition & 5 deletions src/main/plugins/org.dita.html5/sass/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ ul.simple {
margin-top: 1em;
}

*[compact="yes"] > li {
.compact > li {
margin-top: 0;
}

*[compact="no"] > li {
margin-top: 0.53em;
}

.liexpand {
margin-bottom: 1em;
margin-top: 1em;
Expand Down
35 changes: 16 additions & 19 deletions src/main/plugins/org.dita.html5/xsl/topic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,9 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="setaname"/>
<ul>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class" select="'compact'[current()/@compact = 'yes']"/>
</xsl:call-template>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
</ul>
Expand All @@ -652,9 +653,12 @@ See the accompanying LICENSE file for applicable license.
<xsl:call-template name="setaname"/>
<ul>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class" select="'simple'"/>
<xsl:with-param name="default-output-class">
<xsl:value-of select="'simple',
'compact'[current()/@compact = 'yes']"
separator=" "/>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
</ul>
Expand All @@ -668,8 +672,9 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="setaname"/>
<ol>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class" select="'compact'[current()/@compact = 'yes']"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$olcount mod 3 = 1"/>
<xsl:when test="$olcount mod 3 = 2"><xsl:attribute name="type">a</xsl:attribute></xsl:when>
Expand Down Expand Up @@ -753,12 +758,11 @@ See the accompanying LICENSE file for applicable license.
<xsl:call-template name="setaname"/>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<dl>
<!-- handle DL compacting - default=yes -->
<xsl:if test="@compact = 'no'">
<xsl:attribute name="class">dlexpand</xsl:attribute>
</xsl:if>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class">
<xsl:value-of select="'compact'[current()/@compact = 'yes']"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
</dl>
Expand Down Expand Up @@ -1960,13 +1964,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:attribute name="dir" select="."/>
</xsl:template>

<!-- if the element has a compact=yes attribute, assert it in XHTML form -->
<xsl:template match="@compact">
<xsl:if test=". = 'yes'">
<xsl:attribute name="compact">compact</xsl:attribute><!-- assumes that no compaction is default -->
</xsl:if>
</xsl:template>

<xsl:template name="setscale">
<xsl:if test="@scale">
<!-- <xsl:attribute name="style">font-size: <xsl:value-of select="@scale"/>%;</xsl:attribute> -->
Expand Down
5 changes: 1 addition & 4 deletions src/main/plugins/org.dita.xhtml/resource/commonltr.css
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,9 @@ ul.simple {
font-weight: bold;
margin-top: 1em;
}
*[compact="yes"] > li {
.compact > li {
margin-top: 0;
}
*[compact="no"] > li {
margin-top: .53em;
}
.liexpand {
margin-top: 1em;
margin-bottom: 1em;
Expand Down
5 changes: 1 addition & 4 deletions src/main/plugins/org.dita.xhtml/resource/commonrtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,9 @@ ul.simple {
font-weight: bold;
margin-top: 1em;
}
*[compact="yes"] > li {
.compact > li {
margin-top: 0;
}
*[compact="no"] > li {
margin-top: .53em;
}
.liexpand {
margin-top: 1em;
margin-bottom: 1em;
Expand Down
31 changes: 16 additions & 15 deletions src/main/plugins/org.dita.xhtml/xsl/xslhtml/dita2htmlImpl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,9 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="setaname"/>
<ul>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class" select="'compact'[current()/@compact = 'yes']"/>
</xsl:call-template>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
</ul>
Expand All @@ -797,9 +798,12 @@ See the accompanying LICENSE file for applicable license.
<xsl:call-template name="setaname"/>
<ul>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class" select="'simple'"/>
<xsl:with-param name="default-output-class">
<xsl:value-of select="'simple',
'compact'[current()/@compact = 'yes']"
separator=" "/>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
</ul>
Expand All @@ -814,8 +818,9 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="setaname"/>
<ol>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class" select="'compact'[current()/@compact = 'yes']"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$olcount mod 3 = 1"/>
<xsl:when test="$olcount mod 3 = 2"><xsl:attribute name="type">a</xsl:attribute></xsl:when>
Expand Down Expand Up @@ -909,8 +914,11 @@ See the accompanying LICENSE file for applicable license.
<xsl:if test="@compact = 'no'">
<xsl:attribute name="class">dlexpand</xsl:attribute>
</xsl:if>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="@compact"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class">
<xsl:value-of select="'compact'[current()/@compact = 'yes']"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="setid"/>
<xsl:apply-templates/>
</dl>
Expand Down Expand Up @@ -2056,13 +2064,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:attribute name="dir" select="."/>
</xsl:template>

<!-- if the element has a compact=yes attribute, assert it in XHTML form -->
<xsl:template match="@compact">
<xsl:if test=". = 'yes'">
<xsl:attribute name="compact">compact</xsl:attribute><!-- assumes that no compaction is default -->
</xsl:if>
</xsl:template>

<xsl:template name="setscale">
<xsl:if test="@scale">
<!-- <xsl:attribute name="style">font-size: <xsl:value-of select="@scale"/>%;</xsl:attribute> -->
Expand Down

0 comments on commit e31e610

Please sign in to comment.