I used to love R markdown, but it was never easy/pleasant to use with Wordpress (in my experience at least in this decade). Here's the workflow I use in 2024 to author in RStudio and easily publish data viz articles like this in Statamic.
For one thing, Posit's successor to rmarkdown, Quarto is great and lets you use Python too.
Here's my basic authoring/publishing flow
- Author a new Quarto document in RStudio
- Change the
format
to gfm
(github flavored markdown) at the top of the document
- Save and render
- Upload images from output to Statamic 'Assets'
- Copy/paste the rendered gfm output into a new article (my CMS setup lets me use markdown for article content now)
- Update the image url references in the article markdown
Since Quarto supports rendering to gfm and commonmark markdown, it's easy to store the output in Statamic's built-in markdown fieldtype (with an output type that might seems a little pointless to people at first glance).
I could probably automate some of the steps with an R package and a Statamic addon, but for now I am happy.
R has had good SSG tooling for a while now (including, well, Quarto), and I hope sharing my flow here helps show it's possible with a custom CMS setup as well.
If you're trying to set up something like this for your website (R and Python article authoring) regardless of your CMS or framework, make sure you set up something like highlight.js or for syntax highlighting!
Join the conversation and feel free to ask any questions you may have! Please note that submitted comments may be subject to approval before appearing on the site.