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

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Makefile 0 → 100644
default: bjcp-2015-styleguide-orig.xml orig
cache/2015_Guidelines_Beer.docx:
if [ ! -d cache ] ; then mkdir cache ; fi
curl https://www.bjcp.org/docs/2015_Guidelines_Beer.docx -o cache/2015_Guidelines_Beer.docx
cache/bjcp-2015-styleguide-word.xml: cache/2015_Guidelines_Beer.docx
unzip -p cache/2015_Guidelines_Beer.docx word/document.xml | xmllint --format - > cache/bjcp-2015-styleguide-word.xml
bjcp-2015-styleguide-orig.xml: cache/bjcp-2015-styleguide-word.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl
xsltproc xsl/bjcp-2015-styleguide-doc-to-xml.xsl cache/bjcp-2015-styleguide-word.xml | xmllint --format - > bjcp-2015-styleguide-orig.xml
orig: bjcp-2015-styleguide-orig.xml xsl/bjcp-2015-styleguide-split.xsl
if [ ! -d orig ] ; then mkdir orig ; fi
xsltproc xsl/bjcp-2015-styleguide-split.xsl bjcp-2015-styleguide-orig.xml
clean:
rm -rf cache orig
rm -f bjcp-2015-styleguide-orig.xml
# bjcp-2015-styleguide
## Another BJCP styleguide translation project
This is a new approach to achieve two goals:
- tranlating BJCP documents (primarily the beer styleguide 2015) to the German language,
- establishing an XML form of the styleguide in order to support a flexible transformation architecture for a variety of destination formats.
## Concept & Roadmap
- Create a consistent XML representation from the original BJCP styleguide docx document.
- Double-check its consitency, which is not implcit, because of potential typos and inconsistencies in the manually crafted original Word document.
- Continuously add and update translated content in the German "de" folder.
- Develop a XSL tranformation to rebuild a (partially) translated XML styleguide.
- Develop XSL / XSL-FO (maybe LaTeX) backends to create PDF, HTML and potentially other destination documents.
## Procedure
- MacOS systems should have the required tools. On Linux you should install some packages, e.g. on Ubuntu:
```apt install make curl libxml2-utils xsltproc```
(Sorry, I have no clue what to do on Windows systems.)
- Download and unarchive this project and enter its directory.
- Simply run
```make```
- You will now find:
- The original complete styleguide in XML representation: `bjcp-2015-styleguide-orig.xml`
- The broken-down original content as category, subcategory, and "subsubcategory" snippet in directory: `orig`
- Now, you can gradually add and update translated content in directory: `de`. The structure should match that in `orig`. XML elements not present in the translated files will be copied from the `orig` data, when the translated styleguide will be generated. Never change XML element names and the XML structure, never change `id` attributes, never add `tags` or `vital statistics`to the translated files, they will be used from the original data.
- To see the results of your translation work, you can re-run `make` at any time and look at `bjcp-2015-styleguide-de.xml`
- (nicely formated output documents will follow.)
## Contact
This stuff has been initiated by the German homebrewer community at https://hobbybrauer.de and its HBCon organization team.
Contact:
- Nils Vogel <nils.vogel@gmx.net>
- Frank Steinberg <frank@familie-steinberg.org>
## TODO
Pay special attention to:
- specs: Saison (standard, pale, dark, ...)
- specs: Lambic (varies w/ fruit)
- specs: Tropical Stout (missing some numbers)
- specs: Specialty IPA (Strength classification)
<?xml version="1.0"?>
<styleguide>
<category id="1">
<name>Standard American Beer</name>
<description>This category describes everyday American beers that have a wide public appeal. Containing both ales and lagers, the beers of this category are not typically complex, and have smooth, accessible flavors. The ales tend to have lager-like qualities, or are designed to appeal to mass-market lager drinkers as crossover beers. Mass-market beers with a more international appeal or origin are described in the International Lager category.</description>
</category>
</styleguide>
<?xml version="1.0"?>
<styleguide>
<category id="1">
<subcategory id="1A">
<name>American Light Lager</name>
<overall-impression>Highly carbonated, very light-bodied, nearly flavorless lager designed to be consumed very cold. Very refreshing and thirst quenching.</overall-impression>
<aroma>Low to no malt aroma, although it can be perceived as grainy, sweet, or corn-like if present. Hop aroma is light to none, with a spicy or floral hop character if present. While a clean fermentation character is desirable, a light amount of yeast character (particularly a light apple fruitiness) is not a fault. Light DMS is not a fault.</aroma>
<appearance>Very pale straw to pale yellow color. White, frothy head seldom persists. Very clear.</appearance>
<flavor>Relatively neutral palate with a crisp and dry finish and a low to very low grainy or corn-like flavor that might be perceived as sweetness due to the low bitterness. Hop flavor ranges from none to low levels, and can have a floral, spicy, or herbal quality (although rarely strong enough to detect). Low to very low hop bitterness. Balance may vary from slightly malty to slightly bitter, but is relatively close to even. High levels of carbonation may accentuate the crispness of the dry finish. Clean lager fermentation character.</flavor>
<mouthfeel>Very light (sometimes watery) body. Very highly carbonated with slight carbonic bite on the tongue.</mouthfeel>
<comments>Designed to appeal to as broad a range of the general public as possible. Strong flavors are a fault.</comments>
<history>Coors briefly made a light lager in the early 1940s. Modern versions were first produced by Rheingold in 1967 to appeal to diet-conscious drinkers, but only became popular starting in 1973 after Miller Brewing acquired the recipe and marketed the beer heavily to sports fans with the &#x201C;tastes great, less filling&#x201D; campaign. Beers of this genre became the largest sellers in the United States in the 1990s.</history>
<characteristic-ingredients>Two- or six-row barley with high percentage (up to 40%) of rice or corn as adjuncts. Additional enzymes can further lighten the body and lower carbohydrates.</characteristic-ingredients>
<style-comparison>A lighter-bodied, lower-alcohol, lower calorie version of an American Lager. Less hop character and bitterness than a Leichtbier.</style-comparison>
<commercial-examples>Bud Light, Coors Light, Keystone Light, Michelob Light, Miller Lite, Old Milwaukee Light</commercial-examples>
</subcategory>
</category>
</styleguide>
This diff is collapsed.
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:str="http://exslt.org/strings"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:dyn="http://exslt.org/dynamic"
extension-element-prefixes="exsl str dyn date">
<xsl:template match="/styleguide">
<!--<xsl:apply-templates select="chapter"/>-->
<xsl:apply-templates select="category"/>
<xsl:apply-templates select="category/subcategory"/>
<xsl:apply-templates select="category/subcategory/subcategory"/>
</xsl:template>
<xsl:template match="/styleguide/category">
<xsl:variable name="filename">
<xsl:text>orig/</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>.xml</xsl:text>
</xsl:variable>
<exsl:document href="{$filename}" method="xml" version="1.0" encoding="UTF-8" indent="yes">
<xsl:element name="styleguide">
<xsl:element name="category">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*[not(local-name()='subcategory')]"/>
</xsl:element>
</xsl:element>
</exsl:document>
</xsl:template>
<xsl:template match="/styleguide/category/subcategory">
<xsl:variable name="filename">
<xsl:text>orig/</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>.xml</xsl:text>
</xsl:variable>
<exsl:document href="{$filename}" method="xml" version="1.0" encoding="UTF-8" indent="yes">
<xsl:element name="styleguide">
<xsl:element name="category">
<xsl:apply-templates select="../@*"/>
<xsl:element name="subcategory">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*[not(local-name()='subcategory')]"/>
</xsl:element>
</xsl:element>
</xsl:element>
</exsl:document>
</xsl:template>
<xsl:template match="/styleguide/category/subcategory/subcategory">
<xsl:variable name="filename">
<xsl:text>orig/</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>.xml</xsl:text>
</xsl:variable>
<exsl:document href="{$filename}" method="xml" version="1.0" encoding="UTF-8" indent="yes">
<xsl:element name="styleguide">
<xsl:element name="category">
<xsl:apply-templates select="../../@*"/>
<xsl:element name="subcategory">
<xsl:apply-templates select="../@*"/>
<xsl:element name="subcategory">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*[not(local-name()='subcategory')]"/>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</exsl:document>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="@* | text()">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
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