All Projects → hadley → rsmith

hadley / rsmith

Licence: other
A static site generator for R inspired by metalsmith.io

Programming Languages

r
7636 projects
C++
36643 projects - #6 most used programming language

rsmith

Build Status

rsmith is inspired by metalsmith, which is a static site generator for node with a very simple API, based almost entirely on plugins. rsmith has a functional API, which when combined with magrittr, provides a pretty nice declarative specification:

rsmith("src", "dest") %>%
  use(markdown()) %>%
  use(whisker()) %>%
  build()

Possibly the coolest feature is that it uses Shiny's reactivity to cache interim results. This means that if you use watch() instead of build(), rsmith will watch for changes on disk and will do the minimal amount of work to update the site:

rsmith("src", "dest") %>%
  use(markdown()) %>%
  use(whisker()) %>%
  watch()

Plugins

  • markdown(): render .md to .html with the markdown package.

  • rmarkdown(): render .Rmd to .html, .pdf or .doc with rmarkdown.

  • use brew() or whisker() templates

  • ignore_draft(), ignore_files(): ignore files based on either metadata or path

Main differences

Rsmith adheres to the spirit of metalsmith, but is written in idiomatic R. This means that it:

  • Has a more functional flavour so you can use it with the pipe operation from magrittr.

  • Stores the file path in the metadata rather than as the object name. This makes it easier to use lapply() rather than for loops.

  • More plugins are built-in to the package because R packages are usually heavier than npm packages.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].