Customized cookbooks

Pay for professional recipes, or do it the XML geek way.

The New York Times article A Cookbook of One’s Own From the Internet (registration required) describes how Kamran Mohsenin, the founder of a photography web site, took an interesting step beyond personalized calendars: personalized cookbooks using recipes from epicurious.com, a web site has 25,000 recipes from Gourmet and Bon Appetit magazines. (I grew up with both of these magazines around the house, because my parents were big fans.) This reminds me of a quote I just read near the end of Stephen Colbert’s hilarious book I am America, and So Can You: “There’s a lot of repurposing of content yet to be done, believe me!”

Thanksgiving menus

Mohsenin’s TasteBook.com web site lets you pick 100 recipes, some cover images, and your own title, and then they’ll put it in a ring binder with a color hard cover for $34.95. It looks great, but someone who enjoys playing with free XML tools could do something similar without spending a dime. There’d be a few hours of work involved, but you’d have the bonus of something to add to your résumé.

In two two-part articles I did in XML.com (“Getting Started with XQuery” part 1, part 2; “Scaling up with XQuery” part 1, part 2), for sample data I used recipes from the Squirrel RecipeML archive, which has 10,000 public domain recipes marked up in XML. XQuery makes it easy to retrieve all the recipes meeting certain conditions, such as those that mention a certain ingredient, so dynamic generation of customized cookbooks would be simple. Acting as an HTTP server, XQuery applications typically retrieve XML, convert it to HTML, and deliver it to a browser, but they don’t have to. You could retrieve the XML and convert it to XSL-FO (maybe with a little XSLT along the way) and create a PDF book. From there, you could use lulu to create the bound version, but you’d have to spend a few dollars there. An .epub eBook is another option; I recently learned how easy these are to make.

If you really want to turn this into something for your résumé, a DITA angle would be nice. When people believe too much of the hype around DITA and think that it will automate all of their XML-related publishing, I tell them that DITA is designed around topic-oriented content, and that it may or may not be a good fit for their content. My favorite example of content that is a good fit is cookbooks: of the three basic topic types in the DITA architecture, “task” has a structure that fits around the {title, description, ingredient list, assembly step list, conclusion} structure of a typical recipe with just a few renames. Once you automate the conversion of RecipeML files into DITA-compliant recipes, the DITA Open Toolkit can turn them into HTML, PDF, RTF, troff, and several other formats.

To be honest, as I noted in one of the articles mentioned above, some RecipeML recipes will require a bit of manual cleanup before you can feed them to your application, because volunteer XML data entry isn’t always as well-formed as you’d like. I did it for 291 of these recipes for part 1 of the “Scaling Up” article, so I know that it’s not too much work. Perhaps splitting up the cleanup and the coding would be a nice project for an XML-related class. On the last day of class, everyone could cook a recipe from the collection. (Can you tell that I’m an American bearing down on the fourth Thursday of November?)

1 Comments

By Jayne on November 20, 2007 8:03 PM

I for one am a big cookbook fan! This sounds really good, I’ll have to look into it for sure… My new favorite is Rocco DiSpirito’s new book Real Life Recipes. It is full of usefull everyday quick and easy foods that are actually a joy to make.. Along with his usual helpfull tips and suggestions… Rocco is on a roll right now with easy cooking ideas, he’s also doing these great video blogs for Bertolli’s Mediterranean style frozen dinners. You can check them out at http://www.whatsyourmedstyle.com/medstyle/demo.aspx?cat=b
They are really light, and quick in prepare time.. 10 mins and dinner is on the table… I work with them so I got the inside info, but I gotta pass it along, these are too good to not talk about!!