Using Radix/Distill for Scientific Publishing or a Website
Update: RStudio has decided since this post to refer to the radix package as distill.
I first came across Radix on the Distill journal website, and if you’ve ever read any of those articles, you’ve likely appreciated the layout and feel of them. Now the RStudio group has brought it to R markdown. It’s already proven a great format for scientific publishing, but you also have the ability to create a static website or blog with it as well. Previously I was using Dean Attali’s Beautiful Jekyll for my website. It’s a great approach and easy to use in general, at least just to get a decent looking website going without much effort. However, I found it somewhat difficult to keep the changes and updates in sync with my custom css. Radix appears to have a little less overhead, can create starter posts with a single function, works within the standard R Markdown approach, and has other built-in niceties (e.g. Creative commons support, easy citations, see below). And as a fan of Tufte’s books, I love asides (margin notes). Another nice thing is that one doesn’t have to work within the Jekyll framework. Not that I had to do anything with it directly, but I’d rather use the same approach I do with bookdown and other R markdown formats, and that’s pretty much how Radix works. I assume this would make it more portable also, or at least generalizable beyond the GitHub pages approach.
Once you install the radix package, you then have the option for creating an RStudio project with Radix templates for a standard website or blog. They aren’t really different, but if you want to blog you might as well go with that option. I actually went with the standard website first and added the blog elements after. For blog posts, you’ll need to knit the files to html before they will be processed when you build your site. There is some information specific to using GitHub pages, Netlify and others if you want to use those. You may find it easier to put files (e.g. images) in the folder specific to that post, but relative paths work also if you have a general site image folder.
Some caveats. Radix for the R-verse is brand new, so there isn’t much documentation, or bells and whistles for that matter, though the latter isn’t necessarily a bad thing. I had issues trying to do a custom footer, because all that’s available is evidently to use raw html (really?), and what worked on the site pages didn’t work on the blog posts. One thing that tripped me up is that you have to knit the posts before it will be processed for the actual site, which one might forget to update the html even if the .Rmd file has been. Note that the preview of the site in the RStudio viewer may be off a bit at times, but it should look how you want when you actually publish.
In the end though, I was basically able to update my site to the Radix version without much effort, with less customization required, and now I can use my usual R markdown approach for documents and building the site.
Learn more about using Radix at https://rstudio.github.io/distill.