customizing slide layouts in slidify

2019-03-11 09:50发布

I am interested in using different layouts for different slides within my index.Rmd file. after copying the template provided here and below, I created a .html file in my assets/layouts folder.

<slide class="{{ class }}" id="{{ id }}">
  <hgroup>
    {{{ header }}}
  </hgroup>
  <article>
    <hr noshade size=4 color='red'>  
    {{{ content }}}  
    <div class='left' style='float:left;width:48%'>
     {{{ left }}}
    </div>    
    <div class='right' style='float:right;width:48%'>
     {{{ right }}}
    </div>
  </article>
</slide>

having got this far, it remains unclear:

1) why the slides in my deck are blank and not displaying any of the below:

---
#testing
hello

*** left

- point a
- point b
- point c

*** right

- point a
- point b
- point c

2) how to "call" the custom layout from my assets folder for an individual slide and not the whole deck

标签: slidify
1条回答
三岁会撩人
2楼-- · 2019-03-11 10:25

You can specify a layout for a slide as metadata. For example, if you saved the layout you describe in the question as twocol.html in assets/layouts, then you can specify the layout in the slide level metadata. A & specifies a layout, while a . specifies a class and a # specifies an id. You are also free to define your own custom metadata as key:value pairs.

--- &twocol

## Two Columns

*** left

- point a
- point b
- point c

*** right

- point a
- point b
- point c
查看更多
登录 后发表回答