This repository was archived by the owner on Feb 11, 2020. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
2031 lines (1693 loc) · 55.9 KB
/
Copy pathindex.html
File metadata and controls
2031 lines (1693 loc) · 55.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>Slidify</title>
<meta charset="utf-8">
<meta name="description" content="Slidify">
<meta name="author" content="Goyo Ambrosio">
<meta name="generator" content="slidify" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="libraries/frameworks/io2012/css/default.css" media="all" >
<link rel="stylesheet" href="libraries/frameworks/io2012/css/phone.css"
media="only screen and (max-device-width: 480px)" >
<link rel="stylesheet" href="libraries/frameworks/io2012/css/slidify.css" >
<link rel="stylesheet" href="libraries/highlighters/highlight.js/css/zenburn.css" />
<base target="_blank"> <!-- This amazingness opens all links in a new tab. --> <link rel=stylesheet href="libraries/widgets/bootstrap/css/bootstrap.css"></link>
<link rel=stylesheet href="libraries/widgets/nvd3/css/nv.d3.css"></link>
<link rel=stylesheet href="libraries/widgets/nvd3/css/rNVD3.css"></link>
<link rel=stylesheet href="libraries/widgets/leaflet/external/leaflet.css"></link>
<link rel=stylesheet href="libraries/widgets/leaflet/external/leaflet-rCharts.css"></link>
<link rel=stylesheet href="libraries/widgets/leaflet/external/legend.css"></link>
<link rel=stylesheet href="./assets/css/app.css"></link>
<link rel=stylesheet href="./assets/css/ribbons.css"></link>
<!-- Grab CDN jQuery, fall back to local if offline -->
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
<script>window.jQuery || document.write('<script src="libraries/widgets/quiz/js/jquery.js"><\/script>')</script>
<script data-main="libraries/frameworks/io2012/js/slides"
src="libraries/frameworks/io2012/js/require-1.0.8.min.js">
</script>
<script src="libraries/widgets/nvd3/js/jquery-1.8.2.min.js"></script>
<script src="libraries/widgets/nvd3/js/d3.v3.min.js"></script>
<script src="libraries/widgets/nvd3/js/nv.d3.min-new.js"></script>
<script src="libraries/widgets/nvd3/js/fisheye.js"></script>
<script src="libraries/widgets/leaflet/external/leaflet.js"></script>
<script src="libraries/widgets/leaflet/external/leaflet-providers.js"></script>
<script src="libraries/widgets/leaflet/external/Control.FullScreen.js"></script>
</head>
<body style="opacity: 0">
<slides class="layout-widescreen">
<!-- LOGO SLIDE -->
<slide class="nobackground">
<article class="flexbox vcenter">
<span>
<img width='300px' src="assets/img/goyologo.png">
</span>
</article>
</slide>
<slide class="title-slide segue nobackground">
<aside class="gdbar">
<img src="assets/img/goyologo.png">
</aside>
<hgroup class="auto-fadein">
<h1>Slidify</h1>
<h2>A little bit more sysadmin oriented tutorial</h2>
<p>Goyo Ambrosio<br/>Jul. 18 2018</p>
</hgroup>
<a href="https://github.com/goyoambrosio/SlidifyTutorial/zipball/gh-pages" class="example">
Download
</a>
<article></article>
<footer class = 'license'>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/'>
<img width = '80px' src = 'http://mirrors.creativecommons.org/presskit/buttons/88x31/png/by-nc-sa.png'>
</a>
</footer>
</slide>
<!-- SLIDES -->
<slide class="" id="slide-1" style="background:;">
<article data-timings="">
<!--
If you want to enable automatic prompt generation use
{bash ,prompt=TRUE, eval=FALSE}
{r, prompt=TRUE, eval=FALSE}
-->
<h2>R presentations</h2>
<p>R presentations are presentations coded as Rmarkdown and then translated to HTML
using the R programming language framework.</p>
<p>Rmarkdown is a markdown based R syntax that helps make documents in many different formats.</p>
<p>There are many different ways to make <em>r presentations</em> in RStudio (<code>oslides</code>, <code>Slidy</code>, <code>Beamer</code>, ...)</p>
<p>Slidify exists as a package with a huge online community and popularity.</p>
<p>Slidify has the most options and flexibility but you mustn't to use it until you
are more comfortable with R packages and general syntax.</p>
</article>
<!-- Presenter Notes -->
<aside class="note" id="">
<section>
<p>R presentations are presentations coded as HTML created with the R programming language framework.</p>
<p>Rmarkdown is a markdown based R syntax that helps make documents in many different formats.</p>
<p>In RStudio, you simply create a new rmarkdown file, write your text/code, and
runs <code>knitr</code> and <code>pandoc</code> to turn your raw text into a complete HTML, named <em>r
presentations</em>, or PDF document.</p>
<p>There are many different ways to make <em>r presentations</em> in RStudio but three main
choices: <code>ioslides</code>, <code>Slidy</code>, and <code>Beamer</code>.</p>
<p>On the other hand, Slidify exists as a package with a huge online community and popularity.</p>
<p>Slidify has the most options and flexibility. This package is clearly aimed at
the intermediate to advanced R community and you mustn't to use slidify until
you are more comfortable with R packages and general syntax.</p>
<p>Slidify also uses <code>knitr</code> but renders HTML pages using <a href="Slidify%20uses%0A%5Bwhisker%5D(https://github.com/edwindj/whisker">Whisker</a></p>
<p>References:</p>
<p><a href="http://yintingchou.com/others/2017/05/26/ioslides-slidy.html">Comparisons between ioslides and Slidify in R Markdown Presentation</a></p>
<p>[Introduction to Presentations in Rmarkdown](<a href="http://data-analytics.net/cep/Schedule_files/presentations_demo.html**">http://data-analytics.net/cep/Schedule_files/presentations_demo.html**</a></p>
</section>
</aside>
</slide>
<slide class="" id="slide-2" style="background:;">
<hgroup>
<h2>What is Slidify</h2>
</hgroup>
<article data-timings="">
<p>Slidify is a tool that makes it easy to create, customize and publish,
reproducible HTML5 slide decks using R Markdown.</p>
<p>Slidify helps create, customize and share, elegant, dynamic and interactive
HTML5 documents using R Markdown.</p>
<p>It is is an almagamation of other technologies including knitr, Markdown, and
several javascript libaries</p>
<p>It allows embedded code chunks and mathematical formulas</p>
<p>You can view slidify presentations with any web browser and share them easily
on Github, Dropbox, or your own website</p>
</article>
<!-- Presenter Notes -->
<aside class="note" id="">
<section>
<p>Slidify uses <a href="https://github.com/edwindj/whisker">whisker</a> to render the final
html by passing the parsed data to the layout file.</p>
<p>Whisker is a <a href="http://mustache.github.io/"></a> implementation in R
confirming to the Mustache specification. </p>
<p>Mustache is a logicless templating language, meaning that no programming source
code can be used in your templates.</p>
</section>
</aside>
</slide>
<slide class="segue" id="slide-3" style="background:grey;">
<hgroup>
<h1>Set up your workspace</h1>
</hgroup>
<article data-timings="">
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-4" style="background:;">
<hgroup>
<h2>Things you need</h2>
</hgroup>
<article data-timings="">
<p>To work with slidify you need the right environment:</p>
<ul>
<li>A language and environment for statistical computing and graphics:
<a href="https://www.r-project.org/">R</a></li>
<li>An integrated development environment (IDE) for R:
<a href="https://www.rstudio.com/">RStudio</a></li>
<li>Optionally a powerful more-than-an-editor like
<a href="https://www.gnu.org/software/emacs/">Emacs</a> customized with
<a href="http://spacemacs.org/">Spacemacs</a>, <a href="https://ess.r-project.org/">ESS</a> and
<a href="https://github.com/vspinu/polymode">Polymode</a>.</li>
<li>A way to install R packages under development (i.e. slidify):
<a href="https://github.com/r-lib/devtools">devtools</a></li>
</ul>
<p>Preferably in Linux!</p>
</article>
<!-- Presenter Notes -->
<aside class="note" id="">
<section>
<p><a href="http://spacemacs.org/">Spacemacs</a> is an open source Emacs distribution, aimed
at providing a bridge between Emacs and Vim.</p>
<p><a href="https://ess.r-project.org/">ESS</a> (Emacs Speaks Statistics) is an add-on package
for Emacs. It is designed to support editing of scripts and interaction with
various statistical analysis programs such as R.</p>
<p><a href="https://github.com/vspinu/polymode">Polymode</a> is an emacs package that offers
generic support for multiple major modes inside a single emacs buffer. It is
necessary to allow the mix of modes present in Rmd files, specially <code>markdown</code>
and <code>R</code> modes but also other major modes.</p>
</section>
</aside>
</slide>
<slide class="smaller" id="slide-5" style="background:;">
<hgroup>
<h2>How to install R</h2>
</hgroup>
<article data-timings="">
<p>The Ubuntu archives on CRAN are signed with the key of “Michael Rutter". To add
the key to your system run:</p>
<pre><code class="sh">sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
</code></pre>
<p>edit the <code>source.list</code> file</p>
<pre><code class="sh">sudo vim /etc/apt/sources.list
</code></pre>
<p>and add the corresponding source to your operating system version [Ubuntu 16.04|17.10|18.04]</p>
<pre><code class="sh">deb https://cloud.r-project.org/bin/linux/ubuntu [xenial|artful|bionic]-cran35/
</code></pre>
<p>Finally, to install the complete R system, run:</p>
<pre><code class="sh">sudo apt update
sudo apt install r-base
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-6" style="background:;">
<hgroup>
<h2>How to install RStudio</h2>
</hgroup>
<article data-timings="">
<p><a href="https://www.rstudio.com/products/rstudio/download/">Download</a> RStudio.</p>
<p>Install it (<code>rstudio-xenial-1.1.453-amd64.deb</code> in this case) from command prompt </p>
<pre><code class="shell"># For Debian based
sudo dpkg -i rstudio-xenial-1.1.453-amd64.deb
# install dependencies
sudo apt install -f
</code></pre>
<p>Or click deb file through the file manager. Ubuntu will install it and its dependencies.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-7" style="background:;">
<hgroup>
<h2>How to install Emacs and Spacemacs</h2>
</hgroup>
<article data-timings="">
<p>As usual, run this command</p>
<pre><code class="bash">sudo apt install emacs
</code></pre>
<p>Download <a href="https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.tar.gz">SourceCode Pro
font</a>,
uncompress and install. (it takes some seconds ... don't suspect, it's working)</p>
<pre><code class="bash">sudo mv ~/Downloads/source-code-pro-2.030R-ro-1.050R-it/OTF /usr/share/fonts/opentype
sudo fc-cache -f
</code></pre>
<p>To install Spacemacs type</p>
<pre><code class="bash">git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
</code></pre>
<p>The first time you run Spacemacs you must to answer three initial configuratation questions.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="smaller" id="slide-8" style="background:;">
<hgroup>
<h2>How to install ESS and polymode major modes for Emacs</h2>
</hgroup>
<article data-timings="">
<p>Edit <code>.spacemacs</code>, usually under your home directory.</p>
<ol>
<li><p>Activate <code>ess</code> configuration layer </p>
<pre><code>dotspacemacs-configuration-layers
'(ess)
</code></pre></li>
<li><p>Add <code>polymode</code> package as additional package </p>
<pre><code>dotspacemacs-additional-packages '(polymode)
</code></pre></li>
<li><p>Add extension associations </p>
<pre><code>dotspacemacs/user-config ()
(add-to-list 'auto-mode-alist '("\\.Rmd$" . poly-markdown+r-mode))
</code></pre></li>
</ol>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-9" style="background:;">
<hgroup>
<h2>How to install devtools</h2>
</hgroup>
<article data-timings="">
<p>Previously you need to install some libraries in your system:</p>
<pre><code class="bash">$ sudo apt-get install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
</code></pre>
<p>Now run R as <code>sudo</code> and install the package</p>
<pre><code class="sh">$ sudo -i R
</code></pre>
<pre><code class="r">> install.packages('devtools')
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-10" style="background:;">
<hgroup>
<h2>How to install slidify</h2>
</hgroup>
<article data-timings="">
<p>Now you are ready to install Slidify</p>
<p>Slidify is not on CRAN and needs to be installed from github using the <code>devtools</code>
package. </p>
<pre><code class="r">pkgs <- c("slidify", "slidifyLibraries", "rCharts")
devtools::install_github(pkgs, "ramnathv")
</code></pre>
<p>If you are brave, <a href="http://slidify.github.io">http://slidify.github.io</a> recommends installation of the
package <code>dev</code> version but I don't recommend it.</p>
<pre><code class="r">devtools::install_github(pkgs, 'ramnathv', ref = 'dev')
</code></pre>
<p>Now you are ready to create your first slidify presentation.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-11" style="background:;">
<hgroup>
<h2>Create a new Deck</h2>
</hgroup>
<article data-timings="">
<p>Each presentation is called a 'deck'. To create a new deck open R, set
your working directory and use the <code>author</code> command.</p>
<pre><code class="r">setwd("/path/to/")
require(slidify)
author("myDeck")
</code></pre>
<p><code>/path/to/myDeck</code> is created.</p>
<p>Create a R Project from Existing Directory</p>
<pre><code>File -> New Project -> Existing Directory -> /path/to/myDeck -> Create Project
</code></pre>
<p>A file called <code>myDeck.Rproj</code> will be created under <code>/path/to/myDeck</code>.</p>
</article>
<!-- Presenter Notes -->
<aside class="note" id="">
<section>
<p>Then, automatically:</p>
<ul>
<li>A directory with the name of your project is created inside of your current directory.</li>
<li>Inside of this directory an assets directory and a file called “index.Rmd” is created.</li>
<li>The assets directory is populated with the following empty folders: css, img, js, and layouts.</li>
</ul>
</section>
</aside>
</slide>
<slide class="smaller" id="slide-12" style="background:;">
<hgroup>
<h2>Add version control with Git</h2>
</hgroup>
<article data-timings="">
<p>If git is installed, then the <code>author</code> command also initializes a git repository,
switchs to a <code>gh-pages</code> branch and commit all changes.</p>
<p>Before uploading your deck to your favourite Git cloud provider create
<code>.gitignore</code> to avoid version control for non essential files.</p>
<pre><code class="sh">cd /path/to/myDeck
touch .gitignore
vim .gitignore
</code></pre>
<p>Add your <a href=".gitignore">ignored extensions</a></p>
<pre><code class="sh"># RStudio files #
.Rproj.user
.Rhistory
.RData
.Ruserdata
# ...
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-13" style="background:;">
<hgroup>
<h2>Upload the new repository to BitBucket or GitHub</h2>
</hgroup>
<article data-timings="">
<p>Create an empty Repository, e.g. <code>myDeck</code> in BitBucket or GitHub. With an empty
repository a default branch called <code>master</code> won't be created. Then <code>push</code> the
local <code>myDeck</code> repository to the remote <code>myDeck</code> repo. Note that a new branch
called <code>gh-pages</code> has been created.</p>
<pre><code class="sh">cd /path/to/myDeck
git add .
git commit -am "Initial commit"
git remote add origin_github https://github.com/username/myDeck.git
git remote add origin_bitbucket https://username@bitbucket.org/username/myDeck.git
git push -u origin_[github|bitbucket] --all
git push -u origin_[github|bitbucket] --tags
</code></pre>
<p>Now you can work with your new repository as usual</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-14" style="background:;">
<hgroup>
<h2>Cloning your repo</h2>
</hgroup>
<article data-timings="">
<p>To clone the repo on your machine take in account that you'll need to clone <code>gh-pages</code> branch</p>
<pre><code class="sh">git clone -b gh-pages https://github.com/username/myDeck.git
</code></pre>
<p>or</p>
<pre><code class="sh">git clone -b gh-page https://username@bitbucket.org/username/myDeck.git
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-15" style="background:;">
<hgroup>
<h2>Editing with Emacs and RStudio</h2>
</hgroup>
<article data-timings="">
<p>index.Rmd is the only file you need to edit and for that you have two ways:</p>
<ul>
<li>Using RStudio opening the project file, e.g. <code>/path/to/myDeck/myDeck.Rproj</code></li>
<li>Using Emacs with ESS/Polymode major mode.</li>
</ul>
<p>To take advantage of their editing capabilities RStudio and Emacs can be used simultaneously.</p>
<p>You can enable Emacs keybindings within RStudio using the Code section of the
Global Options dialog.</p>
<p>Changes made to the edited files will be updated in real time both in Emacs and RStudio.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-16" style="background:;">
<hgroup>
<h2>Slidify it !</h2>
</hgroup>
<article data-timings="">
<pre><code class="r">slidify("index.Rmd")
browseURL("index.html")
</code></pre>
<p>and don't forget to update your git repository</p>
<pre><code class="shell">git status
git commit -am "Updating my repository"
git push
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="segue" id="slide-17" style="background:grey;">
<hgroup>
<h1>Edit slides</h1>
</hgroup>
<article data-timings="">
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-18" style="background:;">
<hgroup>
<h2>index.Rmd = YAML + R Markdown</h2>
</hgroup>
<article data-timings="">
<p>index.Rmd is the R Markdown document which you will use to compose the content of your presentation.</p>
<p>It's composed of a YAML section and a body section.</p>
<p><a href="https://github.com/ramnathv/slidify/wiki/Page-Properties">YAML metadata</a>
includes the <code>title</code>, <code>subtitle</code>, <code>author</code>, and <code>job</code> of the author. Also
includes what slide <code>framework</code> you wish to use, which code <code>highlighter</code> you
wish to use, and any <code>widgets</code> you want to include.</p>
<p>In addition it can include other fields like a <code>logo</code> to appear in your title
slide under logo, the path to your <code>assets</code> folder and the paths to any other
folders you may be using under url, and the specific theme for your code
highlighter of choice under <code>hitheme</code>.</p>
<p>Under YAML you can include your slides just using R Markdown to write them.</p>
<p><a href="https://rmarkdown.rstudio.com/">R Markdown</a> is a file format for making dynamic
documents with R. An R Markdown document is written in
<a href="https://en.wikipedia.org/wiki/Markdown">markdown</a> and contains chunks of
embedded R (and other languages** code.</p>
</article>
<!-- Presenter Notes -->
<aside class="note" id="">
<section>
<p>YAML is a superset of JSON.</p>
</section>
</aside>
</slide>
<slide class="smaller" id="slide-19" style="background:;">
<hgroup>
<h2>How YAML looks</h2>
</hgroup>
<article data-timings="">
<pre><code>---
title : Slidify
subtitle : A little bit more sysadmin oriented Tutorial
author : Gregorio Ambrosio
job : Apr. 17 2018
framework : io2012 # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : zenburn # {zenburn, tomorrow, solarized-dark, ...}
widgets : bootstrap # {mathjax, quiz, bootstrap}
mode : selfcontained # {standalone, draft}
knit : slidify::knit2slides
logo : goyologo.png # Graphic files will be in ~/myDeck/assets/img
biglogo : goyologo.png
license : by-nc-sa
github:
user: goyoambrosio
repo: SlidifyTutorial
branch: "gh-pages"
assets : {assets: ../../assets} # Add an assets directory
libraries : {libraries: ../../libraries} # Add a libraries directory
ext_widgets : {rCharts: [libraries/nvd3, libraries/leaflet, libraries/dygraphs]}
---
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-20" style="background:;">
<hgroup>
<h2>Slides</h2>
</hgroup>
<article data-timings="">
<p>Your first slide begins under YAML and looks like this:</p>
<pre><code class="markdown">--- .myClass #myId &myLayout
or
---{class: myClass, id: myId, tpl: myLayout}
## Slide Title
- Whatever you put after `##` will be the title of the slide.
- Each slide needs to be preceeded by an empty line followed by `---`
this denotes the beginning of a new slide and the end of the previous slide.
- `.class #id` are `CSS` attributes you can use to customize the slide.
- Whatever you put between `##` and `---` is up to you! As long as it is
valid R Markdown or `HTML`.
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-21" style="background:;">
<hgroup>
<h2>Blocks</h2>
</hgroup>
<article data-timings="">
<p>Blocks are slides nested within a slide, identified by three stars. Just like a
slide, they can contain properties, title and content.</p>
<p>There are two types of blocks - named and unnamed. A block can be named by
specifying the property <code>{name: block1}</code> (or using the symbolic shortcut
<code>{=block1}</code>).</p>
<p>A block with the name <code>block1</code> can be accessed in a slide layout as
<code>slide.block1</code>. The title and content of this block can be accessed as
<code>slide.block1.title</code> and <code>slide.block1.content**. Unnamed blocks are aggregated
into the namespace</code>slide.blocks**.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-22" style="background:;">
<article data-timings="">
<p><img style='margin-top: -40px' class="center" src='assets/img/slide_properties.svg' width=960px height=250px></img> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="segue dark" id="slide-23" style="background:;">
<hgroup>
<h1>Slide Customization</h1>
</hgroup>
<article data-timings="">
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-24" style="background:;">
<hgroup>
<h2>Slide customization</h2>
</hgroup>
<article data-timings="">
<ul>
<li><strong>Properties</strong>. They are implemented as <em>css</em>. You can find them in
<code>libraries/frameworks/io2012/css</code> or write your own css files under
<code>assets/css</code>. Your css files will be loaded when open you slidify
presentation.</li>
<li><strong>Layouts</strong>. They are implemented as <em>html</em> files conforming mustache
specifications under <code>libraries/frameworks/io2012/layouts</code>. Also you can write
your own layouts and locate them under <code>assets/layouts</code>.</li>
<li><strong>Widgets</strong>. A widget is a collection of stylesheets, javascripts and layouts
that add additional functionality to a slide deck.</li>
</ul>
<p>With io2012 framework you have two layouts: <code>twocol.html</code> and <code>vcenter.html</code>
besides the default <code>slides.html</code>. Be careful with the examples because they
often use their own layouts.</p>
<p>This presentation also uses its own files as <code>assets/css/app.css</code> and
<code>assets/layouts/carousel.html</code>.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="segue dark" id="slide-25" style="background:;">
<hgroup>
<h1>Properties</h1>
</hgroup>
<article data-timings="">
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-26" style="background:;">
<hgroup>
<h2>Slide properties</h2>
</hgroup>
<article data-timings="">
<p>Slide properties, i.e. attributes, are key-value pairs that are passed to the
layout.They are valid YAML and are written after <code>---</code> as follows</p>
<pre><code>.class_name_1 .class_name_2 #id_value
class:[class_name_1, class_name_2] id:id_value
{class: [class_name_1, class_name_2], id: id_value}
</code></pre>
<p>The three lines are equivalent. The first one follows symbolic css style
prefixes where a dot indicates class, a hash refers to id and an ampersand
identifies a layout.</p>
<p>e.g.</p>
<pre><code>.segue #myId bg:blue
class:segue id:myId bg:blue
{class: segue, id: myId, bg: blue}
</code></pre>
<p>For clarity we will use the third option</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-27" style="background:;">
<hgroup>
<h2>Slide properties table</h2>
</hgroup>
<article data-timings="">
<table><thead>
<tr>
<th>VARIABLE</th>
<th>DESCRIPTION</th>
</tr>
</thead><tbody>
<tr>
<td>slide.title</td>
<td>The title of the slide with no markup</td>
</tr>
<tr>
<td>slide.header</td>
<td>The title of the slide with markup</td>
</tr>
<tr>
<td>slide.level</td>
<td>The title header level (h1 - h6)</td>
</tr>
<tr>
<td>slide.content</td>
<td>The contents of the slide sans header</td>
</tr>
<tr>
<td>slide.html</td>
<td>The contents of the slide with header</td>
</tr>
<tr>
<td>slide.num</td>
<td>The number of the slide</td>
</tr>
<tr>
<td>slide.id</td>
<td>The id assigned to the slide</td>
</tr>
<tr>
<td>slide.class</td>
<td>The class assigned to the slide</td>
</tr>
<tr>
<td>slide.bg</td>
<td>The background assigned to the slide</td>
</tr>
<tr>
<td>slide.myblock</td>
<td>The slide block named myblock</td>
</tr>
<tr>
<td>slide.blocks</td>
<td>The slide blocks which are not named</td>
</tr>
<tr>
<td>slide.rendered</td>
<td>he rendered slide</td>
</tr>
</tbody></table>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-28" style="background:;">
<hgroup>
<h2>Slide to parse</h2>
</hgroup>
<article data-timings="">
<pre><code>--- {class: class_name, id: id_value, bg: color_name}
## Slide Title
Slide Contents
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="smaller" id="slide-29" style="background:;">
<hgroup>
<h2>Parsed slide</h2>
</hgroup>
<article data-timings="">
<pre><code>$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] "class_name"
$bg
[1] "color_name"
$id
[1] "id_value"
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="segue dark" id="slide-30" style="background:;">
<hgroup>
<h1>Layouts</h1>
</hgroup>
<article data-timings="">
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-31" style="background:;">
<hgroup>
<h2>About layouts</h2>
</hgroup>
<article data-timings="">
<p>Slidify uses <a href="https://github.com/edwindj/whisker">whisker</a> to render the final
html by passing the parsed data to the layout file.</p>
<p>Whisker is a <a href="http://mustache.github.io/">mustache</a> implementation in R
confirming to the mustache specification. </p>
<p>A layout is a <em>mustache template</em> that specifies
the markup to render a slide.</p>
<p>To identify a layout you can use an ampersand (&) or <code>tpl</code> as key. e.g.
<code>---&layout_name</code> or <code>---tpl:layout_name</code></p>
<p>Slidify combines the parsed slide plus the layout to render the HTML.</p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-32" style="background:;">
<hgroup>
<h2>Creating a layout</h2>
</hgroup>
<article data-timings="">
<p>To create a new layout you must to make a new <code>.html</code> file conforming the mustache
specification under your <code>assets/layouts</code> directory.</p>
<p>Insert your code and reference it as a slide property, i.e.</p>
<pre><code class="sh">cd /path/to/myDeck/assets/layouts
touch myLayout.html
vim myLayout.html
</code></pre>
<p>and then use it in your slide as follows</p>
<pre><code>---&myLayout
</code></pre>
<p>or</p>
<pre><code>---{tpl: myLayout}
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="RAW smaller" id="slide-33" style="background:;">
<hgroup>
<h2>Carousel layout</h2>
</hgroup>
<article data-timings="">
<pre><code> ---
layout: test
---
{{{ 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">&lsaquo;</a>
<a class="right carousel-control" href="#{{slide.id}}-carousel" data-slide="next">&rsaquo;</a>
</div>
</code></pre>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="span12" id="slide-34" style="background:;">
<hgroup>
<h2>Carousel</h2>
</hgroup>
<article data-timings="">
<div id="slide-34-carousel" class="carousel slide span12">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#slide-34-carousel" data-slide-to="1" class="active"></li>
<li data-target="#slide-34-carousel" data-slide-to="2" class=""></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="assets/img/apply.svg" alt="">
<div class="carousel-caption"><p>Image 1</p>
</div>
</div>
<div class="item ">
<img src="assets/img/split.svg" alt="">
<div class="carousel-caption"><p>Image 2</p>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#slide-34-carousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#slide-34-carousel" data-slide="next">›</a>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-35" style="background:;">
<hgroup>
<h2>Vcenter layout</h2>
</hgroup>
<article data-timings="">
<p>vcenter layout presents content in the slide center.</p>
<p>Use vcenter layout as follows</p>
<pre><code>---&vcenter
</code></pre>
<p>or</p>