/pandoc_revealjs_template

pandoc generated revealjs template

Primary LanguageHTML

Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 5 column 1
---
title: "Your Title"
author: Your Name

title-slide-attributes:
	data-background-image: ./assets/hearthstone.jpg
    data-background-size: cover
	data-background-opacity: 0.3

include-before: <div class="floatTR"><img src="assets/pandoc.png" height="32"/><img src="assets/revealjs.png" height="32"/></div>

numbersections: true
history: true
slideNumber: true
transition: slide
backgroundTransition: none
---


Quick guide

  • Space: next page,
  • Arrow: navigation,
  • F: fullscreen,
  • Esc or O: overview,
  • Alt + mouse left:magnify,
  • S:notes

What is it

::: incremental

  • It converts Markdown...
  • into a Presentation!

:::

. . .

The presentation is just a web page: README.html

How it works

it uses pandoc to convert markdown to presentation as html+reveal.js.

  • pandoc(markdown) -> html
  • pandoc: a markdown(, etc.) document converter
  • reveal.js: a HTML presentation framework.

Features

Titles with 1 slide

Usually use title to separate slides

Titles with 2 slides

For topic including several slides, you can use --- to separate slides.

To be continued...


Former title is Continued in this new slide by ---

Text Formats

  • emphasized
  • strong emphasis
  • deleted text
  • H2O is a liquid. 2^10^ is 1024
  • Pa\ cat
  • Verbatim
  • *escape*

Text Custom Styles

  • [Custom style: smallest]{.smallest}
  • [Custom style: dim]{.dim}
  • [Custom style: invert]{.invert}

[see or edit ./custom.scss for your own custom style]{.smallest}

General Custom Styles

<style>
.smaller { font-size: 80% }
.smallest { font-size: 50% }
</style>
and make content smaller by:
[make single line smaller]{.smaller}

<div class="smaller">
whole block inside a page section
</div>

[or smallest by: ]{.smallest}

[make single line smallest]{.smallest}

<div class="smallest">
whole block inside a page section
</div>

[see or edit ./custom.scss for your own custom style]{.smallest}

Notes

press S to show the page note.

::: notes

this amazing comment on this page may help you a lot!

:::

Image

{width=40%}

Background Image {background-image="./assets/hearthstone.jpg"}

add background image by

Background Image {background-image="./assets/hearthstone.jpg"}

Custom style Background {background-image="./assets/hearthstone.jpg" data-state="bgdimmer"}

custom style by adding data-state="bgdimmer"

Custom style Background {background-image="./assets/hearthstone.jpg" data-state="bgdimmer"}

[see or edit ./custom.scss for your own custom style]{.smallest}

Local Video

using <video>

Local Video

using <iframe>, for better layout

<iframe width="560" height="315" src="assets/video.mp4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Youtube Video {#YoutubePageId}

<iframe width="560" height="315" src="https://www.youtube.com/embed/vPguoeYTvMI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Note: not all youtube video can be embeded, it depends on the uploader's setting.

Background Video {data-background-video="./assets/video.mp4"}

add background vide by

Background Video {data-background-video="./assets/video.mp4"}

Custom style Background Video {data-background-video="./assets/video.mp4" data-state="bgdimmer"}

add background vide by

Background Video {data-background-video="./assets/video.mp4" data-state="bgdimmer"}

Embed

Embed anohter page, e.g., a complex interactive page by

<iframe src=assets/plot.html width="800" height="450"></iframe>
<iframe src=assets/plot.html width="800" height="450"></iframe>
  • touch the embeded frame to interact with it,
  • touch anywhere else to get focus back to revealjs.

see also pyecharts for how to generate this plot page

Internal links

See the Next topic.

Ending a list {#EndingAlistId}

  1. one
  2. two
  3. three
  1. uno
  2. dos
  3. tres

Numbered example lists

(@) Hello. (@good) This is a good example.

As (@good) illustrates, ...

Inserting pauses

content before the pause

. . .

content after the pause

Incremental lists

::: nonincremental

  • Eat spaghetti
  • Drink wine

:::

or

::: incremental

  • Eat spaghetti
  • Drink wine

:::

Incremental lists 2

  • Item 1
  • Item 2
  • Item 3

Auto Animate {data-auto-animate="1"}

enable auto slide by {data-auto-animate="1"}

Animated lists:

  • A
  • C
  • E

Animated div:

Auto Animate {data-auto-animate="1"}

enable auto slide by {data-auto-animate="1"}

Animated lists:

  • A
  • B
  • C
  • D
  • E

Animated div:

Columns

::: {.columns} ::: {.column width="40%"}

Column One

  • hello
  • world

::: ::: {.column width="60%"}

Column Two

{ width=50% }

::: :::

Table

Table A B C
1 a1 b1 c1
2 a2 b2 c2
3 a3 b3 c3

Task

  • an unchecked task list item
  • checked item

MathJax

Codes

#include <iostream>
int main(int argc, char** argv) {
	std::cout << "I'm c++!";
	return 0;
}
print("I'm Python!")

Header or Footer logo

Notice the pandoc and revealjs logo in the corner? Add it in the YAML metadata block (the start of this markdown)

---
include-before: <div class="floatTR"><img src="assets/pandoc.png" height="32"/><img src="assets/revealjs.png" height="32"/></div>
---

See the Custom Build Settings page for more detail.

How to build

Install

install pandoc first.

# mac
brew install pandoc
:: windows
choco install pandoc

Build

  • run ./build_presentation script,
  • or execute in commandline:
pandoc README.md -t revealjs -s --css=custom.css --mathjax --template=pandoc-templates/default.revealjs -V revealjs-url=reveal.js --slide-level 3 -o README.html

Custom build settings {#CustomBuildSettingsId}

adjust custom build settings in YAML metadata block (the start of this markdown)

---
numbersections: true
history: true
slideNumber: true
transition: slide
backgroundTransition: none
---

or in the command line script:

pandoc README.md ... -V revealjs-url=reveal.js ... -o README.html

Custom style

this template uses custom.css for custom style.

If you want to edit and rebuild custom.scss into custom .css, sass is required.

  • install scss first
# mac
brew install sass/sass/sass
:: windows
choco install sass
  • build custom.scss into custom.css
sass ./custom.scss ./custom.css

run ./build script to build both css and presentation.

Export to PDF

PDF by RevealJS ?print-pdf

  1. In your browser
  2. add ?print-pdf to the url: file:///...README.html?print-pdf
  3. Use your web browser to "print" the presentation web page to PDF.

PDF by Pandoc

Pandoc uses LaTeX to convert your markdown to PDF,

  • install LaTeX here,
  • in the head of this markdown file, make sure the metadata exists,
  • make sure metadata's font name existed in your computer, otherwise, change it,
  • run the build_pdf script

Thanks

References

  1. Pandoc’s Markdown
  2. Revealjs Home