Generate simple HTML slides using deck.js and markdown

August 29, 2012

(This article was first published on Category: R | Huidong Tian's Blog, and kindly contributed to R-bloggers)

RStudio and knitr are an excellent conbination for generating dynamic reports. But in this blog, I will show you how to generate HTML-style presentaion using R only.

OK, I confess that we still need something else: deck.js and markdown and R.utils.

  • deck.js is an JavaScrip together with some css and html files which define the slide section, structures, fonts, colors, etc.
  • markdown is a R-package which can convert markdown format to html format.
  • R.utils is a R-package. we will use its copyDirectory function for copying all context under a folder.

The idea is simple:

  1. Create an empty folder, such like “C:/demo”;
  2. Copy the deck.js folder to the above directory. “C:/demo/deck.js”
  3. Create an empty ASCII format file, ending with .md, which is the main file containing the contexts which will be presented.
  4. Convert the markdown file to html format using the function markdownToHTML in R-package markdown.
  5. Insert the above html file into the template for deck.js presentaion.

htmlSlide Demo
htmlSlide(file = “demo”)</p>


This is an simple example. The source file can be downloaded here.

To leave a comment for the author, please follow the link and comment on their blog: Category: R | Huidong Tian's Blog. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)