Skip to content

Commit

Permalink
make file fix for xsl
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 22, 2024
1 parent 304e1d5 commit b778d7d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ SHELL = bash
YAMLS = $(wildcard tests/*.yml)
FBS = $(subst tests/,target/fb/,${YAMLS:.yml=.fb})
HTMLS = $(subst fb/,html/,${FBS:.fb=.html})
XSLS = $(subst xsl/,target/xsl/,$(wildcard xsl/*.xsl))
JUDGES = judges
DIRS = target target/html target/fb target/xsl target/css
CSS = target/css/main.css

export

all: target/css/main.css target/xsl/index.xsl test
all: $(CSS) $(XSLS) test

test: $(HTMLS)

target/xsl/index.xsl: target/xsl
target/xsl/%.xsl: xsl/%.xsl
cp xsl/*.xsl target/xsl

target/html/%.html: target/fb/%.fb xsl/*.xsl entry.sh Makefile target/css/main.css | target/html
Expand All @@ -55,7 +57,7 @@ target/html/%.html: target/fb/%.fb xsl/*.xsl entry.sh Makefile target/css/main.c
target/fb/%.fb: tests/%.yml Makefile | target/fb
$(JUDGES) import $< $@

target/css/main.css: sass/*.scss | target
$(CSS): sass/*.scss | target
sass --no-source-map --style=compressed --no-quiet --stop-on-error $< $@

clean:
Expand Down
24 changes: 13 additions & 11 deletions xsl/awards.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ SOFTWARE.
</xsl:if>
<xsl:value-of select="$a"/>
</xsl:function>
<xsl:template match="/[fb[not(f)]]" mode="awards">
<xsl:template match="/" mode="awards">
<xsl:apply-templates select="/fb" mode="awards"/>
</xsl:template>
<xsl:template match="/fb[not(f)]" mode="awards">
<p>
<xsl:text>No awards as of yet.</xsl:text>
</p>
</xsl:template>
<xsl:template match="/[fb/f]" mode="awards">
<xsl:template match="/fb[f]" mode="awards">
<table id="awards" border="1">
<colgroup>
<col style="width: 2em;"/>
Expand Down Expand Up @@ -64,18 +67,17 @@ SOFTWARE.
</th>
</tr>
</thead>
<xsl:apply-templates select="/fb" mode="awards"/>
<tbody>
<xsl:for-each-group select="f[payee and award]" group-by="payee">
<xsl:sort select="sum(award)" data-type="number" order="descending"/>
<xsl:call-template name="programmer">
<xsl:with-param name="name" select="payee/text()"/>
</xsl:call-template>
</xsl:for-each-group>
</tbody>
</table>
</xsl:template>
<xsl:template match="fb" mode="awards">
<tbody>
<xsl:for-each-group select="f[payee and award]" group-by="payee">
<xsl:sort select="sum(award)" data-type="number" order="descending"/>
<xsl:call-template name="programmer">
<xsl:with-param name="name" select="payee/text()"/>
</xsl:call-template>
</xsl:for-each-group>
</tbody>
</xsl:template>
<xsl:template name="programmer">
<xsl:param name="name"/>
Expand Down

0 comments on commit b778d7d

Please sign in to comment.