Skip to content

Commit

Permalink
Merge pull request qt4cg#811 from ndw/updated-functions
Browse files Browse the repository at this point in the history
Highlight changed functions in the ToCs and headings
  • Loading branch information
ndw authored Nov 1, 2023
2 parents 32ffe1a + c76d70c commit 3f755c1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions specifications/css/xpath-functions-40.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,20 @@ div.new-function h4::before {
span.content.new-function::after {
content: " 🆕";
}

div.changed-function h2,
div.changed-function h3,
div.changed-function h4 {
text-indent: -1.5rem;
}

div.changed-function h2::before,
div.changed-function h3::before,
div.changed-function h4::before {
content: "🆙 ";
width: 1.5rem;
}

span.content.changed-function::after {
content: " 🆙";
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<xsl:key name="id" match="*" use="@id"/>
<xsl:variable name="new-functions"
select="key('id', 'new-functions')//code/string()"/>
<xsl:variable name="changed-functions"
select="key('id', 'changes-to-existing-functions')//code/string()"/>

<xsl:template match="/">
<xsl:for-each select="1 to 20">
Expand Down Expand Up @@ -78,6 +80,11 @@
<xsl:attribute name="role" select="'new-function'"/>
</xsl:if>

<xsl:if test="$fqfn = $changed-functions
or $fspec//ednote[contains(., 'Changed in 4.0')]">
<xsl:attribute name="role" select="'changed-function'"/>
</xsl:if>

<head>
<xsl:value-of select="$lexname"/>
</head>
Expand Down
10 changes: 10 additions & 0 deletions specifications/xpath-functions-40/style/xpath-functions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
<xsl:variable name="new-functions"
select="key('id', 'new-functions')//code/string()"/>

<xsl:variable name="changed-functions"
select="key('id', 'changes-to-existing-functions')//code/string()"/>

<xsl:for-each select="$prefixes">
<xsl:variable name="prefix" select="."/>
<select id="select-{$prefix}"
Expand All @@ -79,6 +82,10 @@
select="$fqfn = $new-functions
or .//ednote[contains(., 'New in 4.0')]"/>

<xsl:variable name="changed-function"
select="$fqfn = $changed-functions
or .//ednote[contains(., 'Changed in 4.0')]"/>

<option value="{$target}">
<xsl:if test="empty(key('id', $target, $spec))">
<xsl:attribute name="disabled" select="'disabled'"/>
Expand All @@ -95,6 +102,9 @@
<xsl:if test="$new-function">
<xsl:text> 🆕</xsl:text>
</xsl:if>
<xsl:if test="$changed-function">
<xsl:text> 🆙</xsl:text>
</xsl:if>
</option>

<xsl:if test="empty(key('id', $target, $spec))">
Expand Down

0 comments on commit 3f755c1

Please sign in to comment.