My Quarto and Statamic Authoring Workflow for R and Python in 2024

Published in R on May 19, 2024

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

  1. Author a new Quarto document in RStudio
  2. Change the format to gfm (github flavored markdown) at the top of the document
  3. Save and render
  4. Upload images from output to Statamic 'Assets'
  5. Copy/paste the rendered gfm output into a new article (my CMS setup lets me use markdown for article content now)
  6. 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!

Comments

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.