Ron’s Beer Report Plugin – handling new words

In the last posts, I talked about wanting to avoid using the HTML editor and 5 parts of the report that cause me pain. I’ve taken care of 2 of those 5. Let’s get another one checked off the list.

Here’s a snippet of the last Beer Pairing Dinner report I wrote (now taking advantage of TWO of the improvements that I’ve created):

[course name="First Course" grade="B"]

and

[pairing]/[pairgrade]

First Course:  B 
Beer: B Food: A-/B+

Harp Lager



Seared Scallop with Peach Jam


This course paired Harp with seafood – Scallop. The scallop was perfectly seared and served on top of lightly toasted Brioche. The sauce lining the plate was a Peach & Lemon Jam with some Mizuna. This course, being the first, was viewed tentatively – was it going to be the best of the night or portend a much better evening. The scallop was perfect, but the brioche was a little boring (maybe it was supposed to be?) and the mizuna was like spinach without much flavor. It was a fine tasting meal, but the crispness of the Harp tended to overpower all of the flavors other than the peach jam (which was delightful). One last thought – it was like a combination of breakfast (jam on toast) with a nice dinner appetizer. A little odd but the scallop was absolutely perfect.

There are 4 painful things in just that snippet that caused me to use the HTML editor:

  1. The Part Grade Header – Done in plugin v0.1 ([course])
  2. The Beer/Food picture combo – Done in plugin v0.2 ([pairing]/[pairgrade])
  3. The indented paragraphs
  4. The undefined word (with link to definition)

(One other area, the final grade table, is also painful but it’s not in that snippet.)

As noted, the section grade and the Beer/Food picture combo are done. Next up are the undefined words.

What’s up with undefined words? Our little group considers ourselves both fairly well traveled and reasonably well read. When we get these menus, there’s always some food-related word that we don’t know. Sometimes these are new kinds of vegetables, spices, or variety of thing. I like to call them out, with links to some definition of them – the default place for looking for definitions is Wiktionary.

I’m kinda on a roll with the shortcodes, so let’s use another one!

I like the idea of having two parameters – the word and a link to a definition – but I also like the idea of having only one parameter – the link – and have the word/words inbetween a start/end pair. I could even do both, but that’s more work, so let’s pick one – the two parameter version. The code is simpler, so I’m sure I can make that work.

In the snippet above, there is a link to a new word Mizuna. Here’s how I think it should be represented with the shortcode

[foodword word="Mizuna" link="http://en.wikipedia.org/wiki/Mizuna"]

This is a pretty straightforward representation. The text associated with the word parameter will be presented in the output, with a link to the place given by the link parameter.

Another option is to make the link part optional – I think that’s going to come in handy, because most of the time I find these words by going to Wiktionary – so I’m just going to make it the default place to go if no link parameter is given.

Looking at the output, it’s a link but it’s italicized, so I’ll have to make sure that happens. I’ve added this code and now it works, so it’s available in Ron’s Beer Report Plugin v0.3, along with the code that handles the Final Grade section – which happens to be the topic of the next post in this series.

Leave a Reply