hooks: add markdown and flatten methods to request / template.