If you do want a general pattern,I'd again suggest the document extension framework, which was intended for exactly this use case, and is already being used for similar in the Atom results.