Convert Figma logo to code with AI

yihui logoxaringan

Presentation Ninja 幻灯忍者 · 写轮眼

1,494
281
1,494
44

Top Related Projects

67,545

The HTML Presentation Framework

12,681

A simple, in-browser, markdown-driven slideshow tool.

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file

It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.

7,595

The entrance repository of Markdown presentation ecosystem

Quick Overview

xaringan is an R package that creates HTML5 presentations using R Markdown and the JavaScript library remark.js. It offers a simple yet powerful way to create beautiful, interactive slides with the flexibility of R Markdown and the features of remark.js.

Pros

  • Easy integration with R code and output, including plots and tables
  • Highly customizable with CSS and JavaScript
  • Supports incremental slides and presenter notes
  • Offers a wide range of themes and extensions

Cons

  • Steeper learning curve compared to traditional presentation software
  • Requires knowledge of R Markdown and some HTML/CSS for advanced customization
  • Limited built-in support for animations and transitions
  • May require additional setup for offline presentations

Code Examples

  1. Basic slide creation:
---
title: "My Presentation"
output: xaringan::moon_reader
---

# Slide 1

Content for slide 1

---

# Slide 2

Content for slide 2
  1. Adding R code and output:
---
title: "R Code Example"
output: xaringan::moon_reader
---

# R Plot

```{r}
plot(cars)

3. Using incremental slides:

```r
---
title: "Incremental Slides"
output: xaringan::moon_reader
---

# Bullet Points

--

- First point

--

- Second point

--

- Third point

Getting Started

To get started with xaringan, follow these steps:

  1. Install the package:
install.packages("xaringan")
  1. Create a new R Markdown document in RStudio, selecting "Ninja Presentation" as the output format.

  2. Write your presentation content using R Markdown syntax.

  3. Knit the document to create your HTML5 presentation.

For more advanced usage, refer to the package documentation and examples on the GitHub repository.

Competitor Comparisons

67,545

The HTML Presentation Framework

Pros of reveal.js

  • More widely adopted and mature project with a larger community
  • Supports a broader range of features out-of-the-box
  • Can be used independently of R and RStudio

Cons of reveal.js

  • Steeper learning curve for non-web developers
  • Requires more manual setup and configuration
  • Less integrated with R Markdown and the R ecosystem

Code Comparison

reveal.js:

<div class="reveal">
  <div class="slides">
    <section>Slide 1</section>
    <section>Slide 2</section>
  </div>
</div>

xaringan:

---
title: "Presentation"
output: xaringan::moon_reader
---

# Slide 1

---

# Slide 2

Summary

reveal.js is a versatile, feature-rich presentation framework suitable for web developers and those comfortable with HTML/CSS. It offers extensive customization options and a large ecosystem of plugins.

xaringan, built on top of remark.js, is tailored for R users and integrates seamlessly with R Markdown. It simplifies the process of creating presentations for those familiar with R and Markdown syntax, making it particularly appealing to data scientists and researchers in the R community.

12,681

A simple, in-browser, markdown-driven slideshow tool.

Pros of remark

  • Pure JavaScript implementation, making it more lightweight and portable
  • Easier to integrate with other web technologies and frameworks
  • More flexible for advanced users who prefer direct control over presentation logic

Cons of remark

  • Requires more manual setup and configuration
  • Less user-friendly for R users and those unfamiliar with JavaScript
  • Fewer built-in features and themes compared to xaringan

Code Comparison

remark:

var slideshow = remark.create({
  sourceUrl: 'presentation.md'
});

xaringan:

library(xaringan)
xaringan::moon_reader(
  css = c("default", "rladies", "rladies-fonts")
)

Summary

remark is a JavaScript-based slideshow tool that offers more flexibility and integration with web technologies. It's lightweight and portable but requires more manual setup. xaringan, built on top of remark, provides a more user-friendly experience for R users with additional features and themes. xaringan simplifies the process of creating presentations within the R ecosystem, while remark offers more control for those comfortable with JavaScript and web development.

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file

Pros of reveal-md

  • Supports Markdown out of the box, making it easier for users familiar with Markdown syntax
  • Built-in live reload server for real-time preview of changes
  • Offers a wider range of built-in themes and transitions

Cons of reveal-md

  • Less integration with R and RStudio ecosystem
  • Fewer customization options for advanced users
  • Limited support for complex layouts and animations compared to xaringan

Code Comparison

reveal-md:

# Slide 1
## Subtitle

- Point 1
- Point 2

---

# Slide 2

Content for slide 2

xaringan:

---
title: "Presentation"
output: xaringan::moon_reader
---

# Slide 1
## Subtitle

- Point 1
- Point 2

---

# Slide 2

Content for slide 2

Both repositories offer tools for creating presentations, but they cater to different user bases. reveal-md is more accessible for those familiar with Markdown and provides a simpler setup process. xaringan, on the other hand, is deeply integrated with the R ecosystem and offers more advanced customization options for users comfortable with R and CSS.

It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.

Pros of impress.js

  • More flexible and customizable for creating non-linear presentations
  • Supports 3D transformations and transitions
  • Can be used with any HTML content, not limited to slides

Cons of impress.js

  • Steeper learning curve, requires more JavaScript and CSS knowledge
  • Less integration with R and RMarkdown ecosystem
  • May require more manual setup for basic presentations

Code Comparison

impress.js:

<div id="impress">
    <div class="step" data-x="0" data-y="0">Slide 1</div>
    <div class="step" data-x="1000" data-y="500" data-scale="2">Slide 2</div>
</div>
<script>impress().init();</script>

xaringan:

---
title: "My Presentation"
output: xaringan::moon_reader
---

# Slide 1

---

# Slide 2

Key Differences

  • impress.js uses HTML and JavaScript for creating presentations, while xaringan uses R Markdown
  • impress.js offers more control over slide positioning and transitions, whereas xaringan focuses on simplicity and integration with R
  • xaringan provides built-in themes and easier setup for academic presentations, while impress.js is more suited for creative, non-linear presentations
7,595

The entrance repository of Markdown presentation ecosystem

Pros of Marp

  • Supports multiple output formats (HTML, PDF, PPTX)
  • Easy-to-use CLI tool for quick conversions
  • Customizable themes with CSS

Cons of Marp

  • Limited interactivity compared to Xaringan
  • Fewer built-in presentation features
  • Less integration with R and statistical workflows

Code Comparison

Marp:

---
marp: true
theme: default
---

# Slide 1
Content for slide 1

---

# Slide 2
Content for slide 2

Xaringan:

---
title: "Presentation"
output: xaringan::moon_reader
---

# Slide 1
Content for slide 1

---

# Slide 2
Content for slide 2

Key Differences

  • Marp uses Markdown with YAML front matter for configuration
  • Xaringan leverages R Markdown and integrates with R ecosystem
  • Marp focuses on simplicity and multiple output formats
  • Xaringan offers more advanced features for technical presentations

Use Cases

  • Marp: Quick, simple presentations with various output needs
  • Xaringan: Technical presentations, especially those involving R and data analysis

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

xaringan

Sharingan

[ʃaː.'riŋ.ɡan]

R-CMD-check CRAN release Codecov test coverage

An R package for creating slideshows with remark.js through R Markdown. The package name xaringan comes from Sharingan, a dōjutsu in Naruto with two abilities: the "Eye of Insight" and the "Eye of Hypnotism". A presentation ninja should have these basic abilities, and I think remark.js may help you acquire these abilities, even if you are not a member of the Uchiha clan.

Please see the full documentation as a presentation here (中文版在此). The remark.js website provides a quick introduction to the underlying syntax upon which xaringan builds. If you prefer reading a book, xaringan is also documented in the R Markdown book (Chapter 7). You can use remotes to install the package:

remotes::install_github('yihui/xaringan')

If you use RStudio, it is easy to get started from the menu File -> New File -> R Markdown -> From Template -> Ninja Presentation, and you will see an R Markdown example. Press the Knit button to compile it, or use the RStudio Addin Infinite Moon Reader to live preview the slides (every time you update and save the Rmd document, the slides will be automatically reloaded; make sure the Rmd document is on focus when you click the addin). Please see the issue #2 if you do not see the template or addin in RStudio.

The main R Markdown output format in this package is moon_reader(). See the R help page ?xaringan::moon_reader for all possible configurations.

Slide formatting

The remark.js Wiki contains detailed documentation about how to format slides and use the presentation (keyboard shortcuts). The xaringan package has simplified several things compared to the official remark.js guide, e.g. you don't need a boilerplate HTML file, you can set the autoplay mode via an option of moon_reader(), and LaTeX math basically just works (TM). Please note that remark.js does not support Pandoc's Markdown, so you will not be able to use any fancy Pandoc features, but that is probably fine for presentations. BTW, you can use raw HTML when you feel there is something you desperately want but cannot get from the basic Markdown syntax (e.g. knitr::kable(head(iris), 'html')).

As the package title indicates, this package is designed for ninja. If you are a beginner of HTML/CSS, you may have to stick with the default CSS (which is not bad). The more you know about CSS, the more you can achieve with this package. The sky is your limit.

We have a wiki that might help you to use CSS to alter the appearance of your presentation. Make sure to check it out before opening an issue. You might also consider posting simple usage questions on stackoverflow using the #xaringantag. We will read all questions with the #xaringan tag so please be patient if we don't answer within a day :smile:

Do not forget to try the option yolo: true under xaringan::moon_reader in the YAML metadata of your R Markdown document. Big thanks to Karl Broman!