Learn R Programming

slidex

This package is a work-in-progress, but is aimed at making the process of converting Microsoft PowerPoint slides to beautiful HTML xaringan slides as seamless as possible, maintaining tables, figures, links, and bulleted lists.

Installation

The package is not yet on CRAN. Install the development version with

devtools::install_github("datalorax/slidex")

Basic usage

At present, the package exports a single function, convert_pptx, which takes two required arguments: the path to the PPTX file (passed as a string), and the author (also passed as a string). For example:

library(slidex)
pptx <- system.file("examples", "slidedemo.pptx", package = "slidex")

convert_pptx(path = pptx, author = "Daniel Anderson")

You can optionally pass additional arguments, such as theme (see a list of themes here) or a new title.

Suggested packages

Although not a dependency, the package functionally requires the xaringan package, and works best if the knitr, kableExtra, and tibble packages are installed. Without the latter three, tables will not be produced, although the code to create a dataframe from the tables will still be embedded. Install suggested packages from CRAN with

install.packages(c("xaringan", "knitr", "kableExtra", "tibble"))

Things the package should be able to do

  • Maintain bulleting levels
  • Maintain bolding and italicizing (no support for underlining yet)
  • Maintain pictures
  • Maintain links (slightly imperfect currently)
  • Extract notes from the slides. By default the notes are embedded in the slides and a separate .txt file is written out.

Things the package does not yet do, but hopefully will

  • Pull data and potentially reproduce plots (some support for this already, look in “assets/data” if you have a chart and want the data from it)
  • Convert emf file types to pngs. This is a Microsoft proprietary format and will require users have LibreOffice installed.
  • Maintain two-panel layouts
  • Support both .ppt and .pptx file types. Currently only the latter is supported. Will require LibreOffice.

Other ideas?

I’d love to hear from you if you’ve used the package and had success or you’ve struggled. Either way, feedback, particularly at this early stage, would be greatly appreciated.

Copy Link

Version

Version

0.0.0.9001

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Anderson

Last Published

October 30th, 2020

Functions in slidex (0.0.0.9001)

extract_body

Extract the body of the slide
import_rel_xml

Import XML rel Code from PowerPoint
create_yaml

Create the xaringan YAML Front Matter
write_rmd

level_indents

Fixes the bulleting levels in the case of non-standard nesting
import_slide_xml

Import XML for PowerPoint Slides
stylize_text

bold or italicize text
tribble_code

Wrap a DF in tibble::tribble code
extract_notes

Extract Notes from Slides
slidex-package

slidex: convert Microsoft PowerPoint slides to R Markdown
extract_footnote

Extract Footnotes from Slides
extract_subtitle

Extract Subtitle from Title Slide
extract_xml

Extract XML from PowerPoint
import_notes_xml

Import Slide Notes
write_theme

Write the YAML Code for CSS Theme
check_lang

Check the Language of PPTX
extract_title

Extract Slide Titles
extract_table

Extract tables from slides
extract_author

Extract Author from PowerPoint
body_text

Text to paste
extract_link

Extract Links from the corresponding slide
extract_indents

Check bullets before text
convert_pptx

Extract xml from pptx
write_notes

Write Slide Notes
extract_class

Extract Slide Element Classes