Ramnath Vaidyanathan
A layout is a mustache template that specifies the markup to render a slide
--- {class: class1, bg: yellow, id: id1}
## Slide Title
Slide Contents
--- {class: class1, bg: yellow, id: id1}
## Slide Title
Slide Contents
--- {class: class1, bg: yellow, id: id1}
## Slide Title
Slide Contents
--- {class: class1, bg: yellow, id: id1}
## Slide Title
Slide Contents
$html
[1] "<h2>Slide Title</h2>\n\n<p>Slide Contents</p>\n"
$header
[1] "<h2>Slide Title</h2>"
$level
[1] "2"
$title
[1] "Slide Title"
$content
[1] "<p>Slide Contents</p>\n"
$class
[1] "class1"
$bg
[1] "yellow"
$id
[1] "id1"
<slide class="{{ slide.class }}" id="{{ slide.id }}"
style="background:{{{ slide.bg }}};">
<hgroup>
{{{ slide.header}}}
</hgroup>
<article>
{{{ slide.content }}}
</article>
</slide>
<slide class="class1" id="id1" style="background:yellow;">
<hgroup>
<h2>Slide Title</h2>
</hgroup>
<article>
<p>Slide Contents</p>
</article>
</slide>
Slide Contents
<slide class="{{ slide.class }}">
<hgroup>
{{{ slide.header }}}
</hgroup>
<article>
{{{ slide.content }}}
</article>
</slide>
<slide class="{{ slide.class }}">
<hgroup>
{{{ slide.header }}}
</hgroup>
<article>
{{{ slide.content }}}
<footer class = 'logo'>
<img src = 'path/to/logo'></img>
</footer>
</article>
</slide>
---
layout: slide
---
{{{ slide.content }}}
<footer class = 'logo'>
<img src = 'path/to/logo'></img>
</footer>
</article>
</slide>
demo/layouts/index.Rmd
.logo
property to point to a logo of your choice.slidify("index.Rmd")
.index.html
.Modify the default slide layout at demo/layouts/assets/layouts/slide.html
such that
--- {tpl: carousel, class: span12}
## Carousel
*** {class: active, img: "../01/assets/img/split.svg"}
Image 1
*** {img: "../01/assets/img/apply.svg"}
Image 2
--- {tpl: carousel, class: span12}
## Carousel
*** {class: active, img: "../01/assets/img/split.svg"}
Image 1
*** {img: "../01/assets/img/apply.svg"}
Image 2
--- {tpl: carousel, class: span12}
## Carousel
*** {class: active, img: "../01/assets/img/split.svg"}
Image 1
*** {img: "../01/assets/img/apply.svg"}
Image 2
--- {tpl: carousel, class: span12}
## Carousel
*** {class: active, img: "../01/assets/img/split.svg"}
Image 1
*** {img: "../01/assets/img/apply.svg"}
Image 2
---
layout: slide
---
{{{ slide.content }}}
<div id="{{slide.id}}-carousel" class="carousel slide {{slide.class}}">
<!-- Indicators -->
<ol class="carousel-indicators">
{{# slide.blocks }}
<li data-target="#{{slide.id}}-carousel" data-slide-to="{{num}}" class="{{class}}"></li>
{{/ slide.blocks }}
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
{{# slide.blocks }}
<div class="item {{class}}">
<img src="{{img}}" alt="{{alt}}">
<div class="carousel-caption">{{{ content }}}</div>
</div>
{{/ slide.blocks }}
</div>
<!-- Controls -->
<a class="left carousel-control" href="#{{slide.id}}-carousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#{{slide.id}}-carousel" data-slide="next">›</a>
</div>
demo/layouts/carousel/index.Rmd
.slidify("index.Rmd")
.index.html
.Slide properties are key-value pairs that are passed to the layout. You can specify class, id and bg and style the slide, either by using built in classes, or specifying additional css.
--- {class: [class1, class2], id: id}
You can also use symbolic css style prefixes for frequently used properties. For instance, a dot indicates class, a hash refers to id and an ampersand identifies a layout.
--- .class1 .class2 #id
Variable | Description |
---|---|
slide.title |
The title of the slide with no markup |
slide.header |
The title of the slide with markup |
slide.level |
The title header level (h1 - h6) |
slide.content |
The contents of the slide sans header |
slide.html |
The contents of the slide with header |
slide.num |
The number of the slide |
slide.id |
The id assigned to the slide |
slide.class |
The class assigned to the slide |
slide.bg |
The background assigned to the slide |
slide.myblock |
The slide block named myblock |
slide.blocks |
The slide blocks which are not named |
slide.rendered |
The rendered slide |
Blocks are slides nested within a slide, identified by three stars. Just like a slide, they can contain properties, title and content.
There are two types of blocks - named and unnamed. A block can be named by specifying the property {name: block1}
(or using the symbolic shortcut {=block1}
).
A block with the name block1
can be accessed in a slide layout as slide.block1
. The title and content of this block can be accessed as slide.block1.title
and slide.block1.content
. Unnamed blocks are aggregated into the namespace slide.blocks
.