Skip to content
Snippets Groups Projects
Commit c8cbefbb authored by Frank Steinberg's avatar Frank Steinberg
Browse files

Improved HTML output. Various minor fixes.

parent 178e9a3c
No related branches found
No related tags found
No related merge requests found
...@@ -15,5 +15,7 @@ build: ...@@ -15,5 +15,7 @@ build:
paths: paths:
- bjcp-2015-styleguide-orig.xml - bjcp-2015-styleguide-orig.xml
- bjcp-2015-styleguide-de.xml - bjcp-2015-styleguide-de.xml
- bjcp-2015-styleguide-orig.html
- bjcp-2015-styleguide-de.html
expire_in: 1 week expire_in: 1 week
...@@ -423,23 +423,26 @@ ...@@ -423,23 +423,26 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:if test="string-length($t) > 0">
<xsl:when test="w:rPr/w:b[not(@w:val='0')]"> <xsl:choose>
<xsl:element name="span"> <xsl:when test="w:rPr/w:b[not(@w:val='0')]">
<xsl:attribute name="class">bold</xsl:attribute> <xsl:element name="span">
<xsl:value-of select="$t"/> <xsl:attribute name="class">bold</xsl:attribute>
</xsl:element> <xsl:value-of select="$t"/>
</xsl:when> </xsl:element>
<xsl:when test="w:rPr/w:i"> </xsl:when>
<xsl:element name="span"> <!-- WTF, some ° chars are italic in the original document -->
<xsl:attribute name="class">italic</xsl:attribute> <xsl:when test="(w:rPr/w:i) and ($t != '°')">
<xsl:element name="span">
<xsl:attribute name="class">italic</xsl:attribute>
<xsl:value-of select="$t"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$t"/> <xsl:value-of select="$t"/>
</xsl:element> </xsl:otherwise>
</xsl:when> </xsl:choose>
<xsl:otherwise> </xsl:if>
<xsl:value-of select="$t"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
......
...@@ -17,26 +17,144 @@ ...@@ -17,26 +17,144 @@
<xsl:text>BJCP 2015 Styleguide</xsl:text> <xsl:text>BJCP 2015 Styleguide</xsl:text>
</xsl:element> </xsl:element>
<xsl:element name="style"> <xsl:element name="style">
styleguide chapter {
display: list-item; styleguide {
list-style-position: inside; font-family: Helvetica, Arial, Geneva, sans-serif;
} }
styleguide category {
styleguide chapter, styleguide category, styleguide subcategory {
font-size: 9pt;
margin-top:1em;
margin-bottom:1em;
margin-left:0em;
display: list-item; display: list-item;
list-style-position: inside; list-style-position: inside;
} }
styleguide category:before {
display: inline; styleguide p {
margin-top:1em;
}
styleguide span.bold {
font-weight: bold;
}
styleguide span.italic {
font-style: italic;
}
styleguide category:before, styleguide subcategory:before {
content: attr(id); content: attr(id);
} }
styleguide category name { styleguide name {
display: inline; display: inline-block;
margin-bottom:1em;
}
styleguide description {
font-size: 8pt;
margin-left:1em;
display: block;
}
styleguide description p {
margin-top: 0;
}
styleguide overall-impression:before {
content: "Overall Impression: ";
}
styleguide aroma:before {
content: "Aroma: ";
}
styleguide appearance:before {
content: "Appearance: ";
}
styleguide flavor:before {
content: "Flavor: ";
}
styleguide mouthfeel:before {
content: "Mouthfeel: ";
}
styleguide comments:before {
content: "Comments: ";
}
styleguide history:before {
content: "History: ";
} }
styleguide category * { styleguide characteristic-ingredients:before {
display: none; content: "Characteristic Ingredients: ";
} }
styleguide category subcategory { styleguide style-comparison:before {
display: none; content: "Style Comparison: ";
}
styleguide entry-instructions:before {
content: "Entry Instructions: ";
}
styleguide specs:before {
content: "Vital Statistics: ";
}
styleguide commercial-examples:before {
content: "Commercial Examples: ";
}
styleguide tags:before {
content: "Tags: ";
}
styleguide overall-impression,
styleguide aroma,
styleguide appearance,
styleguide flavor,
styleguide mouthfeel,
styleguide comments,
styleguide history,
styleguide characteristic-ingredients,
styleguide style-comparison,
styleguide specs,
styleguide entry-instructions,
styleguide commercial-examples,
styleguide tags {
position: relative;
margin-left: 1em;
display: block;
font-size: 8pt;
}
styleguide overall-impression:before,
styleguide aroma:before,
styleguide appearance:before,
styleguide flavor:before,
styleguide mouthfeel:before,
styleguide comments:before,
styleguide history:before,
styleguide characteristic-ingredients:before,
styleguide style-comparison:before,
styleguide specs:before,
styleguide entry-instructions:before,
styleguide commercial-examples:before,
styleguide tags:before {
font-weight: bold;
}
styleguide specs div.ibu:before {
content: "IBU: ";
}
styleguide specs div.srm:before {
content: "SRM: ";
}
styleguide specs div.og:before {
content: "OG: ";
}
styleguide specs div.fg:before {
content: "FG: ";
}
styleguide specs div.abv:before {
content: "ABV: ";
}
styleguide specs div {
display: inline-block;
}
styleguide specs div * {
border: 1px solid;
display: inline-block;
width: 9em;
} }
</xsl:element> </xsl:element>
...@@ -50,6 +168,45 @@ styleguide category subcategory { ...@@ -50,6 +168,45 @@ styleguide category subcategory {
<xsl:template match="specs" mode="copy">
<xsl:element name="specs">
<xsl:element name="div">
<xsl:element name="div">
<xsl:attribute name="class">ibu</xsl:attribute>
<xsl:value-of select="ibu/@min"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="ibu/@max"/>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="class">srm</xsl:attribute>
<xsl:value-of select="srm/@min"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="srm/@max"/>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="class">og</xsl:attribute>
<xsl:value-of select="og/@min"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="og/@max"/>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="class">fg</xsl:attribute>
<xsl:value-of select="fg/@min"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="fg/@max"/>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="class">abv</xsl:attribute>
<xsl:value-of select="abv/@min"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="abv/@max"/>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="*" mode="copy"> <xsl:template match="*" mode="copy">
<xsl:element name="{local-name(.)}"> <xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*" mode="copy"/> <xsl:apply-templates select="@*" mode="copy"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment