Beer Brewing Software

Recipe Database and Formatting Tools

All the recipe pages, from the two listings, down to the PDF versions of the recipes themselves are produced from a single XML file containing all the recipes. I wrote my own Document Type Definition (DTD) to meet my own needs, and XSLT transforms the XML file into the documents you see here.

XSL-FO is designed to transform XML to PDF format, but I've been unsatisfied with the results and the spotty support for the standards, so I use XSLT to transform the XML to TeX, which is run through pdftex to produce PDF. TeX is Donald Knuth's typesetting macro language, and despite being written in 1978, still produces the best output of any typesetting program available (although Adobe InDesign may now be it's equal -- only 27 years later!). A few simple modifications of the TeX document (like converting common decimals to fractions) are performed before the TeX document is run through pdftex.

Why do it this way? Well, once you understand the DTD and how to properly format a recipe, all of the web pages that use recipes are automatically updated with the new information as soon as you change an existing recipe or add a new one. And if the transformation files are written correctly, I get standards-compliant output that should work with any browser or PDF viewer. Finally, the data is in a simple plain text format, and it's easy to extract the data and display it in new and different ways simply by writing a new transformation file.

Note that PHP is the glue that ties all of this together. Many web browsers can display XML directly, even translated into HTML with an XSLT file, but many can't, so the web server itself is doing the translation from XML to HTML using the XSLT parser in PHP.

You can download all these files from the following list. I maintain the Copyright on all these files, and in as much as these are software programs, they are licenced under the terms of the GNU General Public License, version 2. Your web browser may try to interpret these files internally, so if you want to see what the files really look like, you will need to 'right-click' the links, choose the 'Save to a file' option and view the files in a text editor.

  • beer_recipes.xml -- the database.
  • beer_recipes.dtd -- Document Type Definition for my recipe data.
  • listing.xsl -- The XSLT translation for the full listing.
  • narrow_listing.xsl -- The XSLT translation for the narrow listing.
  • full.xsl -- The XSLT translation that outputs a single recipe.
  • full-tex.xsl -- The XSLT translation that outputs a single recipe as a TeX file -- run the file through the 'tweak-tex.py' script below and then use 'pdftex' to produce a PDF file.
  • tweak_tex.py -- A simple Python shell script that fixes a few issues with the XSLT produced TeX file and adds a few TeX enhancements that aren't available in HTML.
  • full.xsl -- The XSL-FO translation that used to produce the PDF versions of a single recipe (now I use the full-tex.xsl and tweak-tex.py files above).

Little Brewing Calculators

Equations and Tables

I do almost all of my brewery calculations by hand using formulas and tables I've accumulated from books and on-line. I believe that all of these forumlas and tables are of common enough origin that there are no copyright issues in publishing my own unattributed versions of these. If I am not correct, please let me know and I will add an attribution or remove the content in question.

I've collected all of this into a single document that's available as a PDF from this site. Feel free to copy and distribute copies of this document, as long as my Copyright is attached.