It's easy to add code and Markdown as you intended in edit mode (as shown above in the Code snippet and Markdown web parts (left to right respectively), and then all renders beautifully as intended when you publish the SharePoint page.
{}