Revealjs with Pandoc

Azizcodes

May 6, 2019

Conversion from Markdown

No need to download the resources locally, just use

pandoc -t revealjs -s -o myslides.html myslides.md -V revealjs-url=https://revealjs.com

Conversion from Markdown

Set the file name in bash

p1="p1"

Then

a="pandoc -t revealjs -s -o myslides.html myslides.md -V revealjs-url=https://revealjs.com"
echo ${a//myslides/$p1} # to view the output   
${a//myslides/$p1}      # to execute the output

Images

Background image

<section data-background-image="http://example.com/image.png">
    <h2>Image</h2>
</section>

+repeat

<section data-background-image="http://example.com/image.png" data-background-size="100px" data-background-repeat="repeat">
    <h2>This background image will be sized to 100px and repeated</h2>
</section>

Equations

Question:

What happens when we add $$e^{i\pi}+1=0$$ to the markdown source file?

Equations

Answer:

It gets converted to an equation using MathJax..


eiπ + 1 = 0

Tables

Open a python interpretor and paste the following

from pandas import DataFrame

x=[1,2,3]
x2=[2*j for j in x]
x3=[3*j for j in x]
df=DataFrame({'x':x,'2x':x2,'3x':x3},columns=['x','2x','3x'])
print(df.to_html(index=False))

Copy the output and paste it where the table should go.

Tables

x 2x 3x
1 2 3
2 4 6
3 6 9

Color

Prepare to get your eyes hurt..

<section data-background-color="#ff0000">
  <h2>Color</h2>
</section>

اللون الأحمر

This is a custom slide, written in HTML.

The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. - Bertrand Russell