Home

Awesome

Samatha v0.4.0

Copyright David Springate 2013 (CC BY 3.0)

@datajujitsu

Samatha is an R package for quickly building Github-ready static sites in R. It contains a simple, functional-style DSL for rendering HTML, an engine for compilation of static websites as you build them and a development web-server for viewing your sites of line before you deploy.

This project is still in active development. Feel free to contact me with any issues/bugs/suggestions

The Static site engine uses the Samatha DSL to build layout templates which it then combines with content to generate individual pages. templates are written as a nested R expression, with no need for extenal templating systems. There are two ways to build pages:

  1. Pages are written entirely in the Samatha DSL and compiled with a layout file. This is ideal for introductiory pages and index pages.
  2. Blog posts are written in .Rmd format, which is then converted to md using knitr and then to html using markdown. Posts are then rendered within the layout for that post.

The Samatha engine samatha() now functions as expected. It compiles your site and then updates in real time according to the following rules:

Extra features:

Sites are created with the following structure:

Examples

My personal blog was built using Samatha, twitter bootstrap and Github pages. I used the Readable theme. See here for the file structure of a Samatha site.

This gist Gives code to quickly setting up an example site.

Install

You should be able to install the current version of Samatha with devtools:

# check install_github()
require(devtools)
install_github("samatha", "DASpringate")

Simple Startup

library(samatha)
site <- "/dir1/dir2/dirSite"
skeleton(site)
setup_example_site(site)

samatha(site, rss = FALSE, initial = TRUE)
samatha(site, rss = FALSE, initial = TRUE)

run.server(site)  # open browser to localhost:8000 to see the site

Documentation

I'm still working on it!

Glaring ommisions (To be fixed very soon):