Refactor MarkdownPostProvider by using metaprogramming instead of conditional logic