Using RMarkdown and knitr to produce reproducible examples for blog posts, but it is tedious trying to get them formatted for e.g. Squarespace.
Here is a great tip (courtesy of Kyle Wurtz) that enables straight-forward generation of 'standalone' HTML directly from a markdown (.Rmd) document, which can then be opened in a text editor, and pasted directly into e.g. Squarespace's Markdown block. Bingo.
library(knitr)
library(markdown)
knit("myMarkdownDoc.Rmd")
markdownToHTML("myMarkdownDoc.md","myMarkdownDoc.html", fragment.only=TRUE)