Importing WordPress Codex as a dictionary into the Dictionary app
Apple shows you how to create and add Custom Dictionaries to it's Dictionary Applications in the Dictionary Services Programming Guide

It includes examples and a guide on the dictionary XHTML markup.