Building Presentations with Reveal.js, Markdown and Github Pages


TL;DR

  • How to build presentation with Markdown, Reveal.js And Github Pages.
  • We can export it as html presentation, ppt, Google Slides, pdf and other formats.
  • Write Once, Share Anywhere.

Demo

Why Build Presentation With Markdown, Reveal.js And Github Pages

Why Markdown

  • Focus on the content, easy to store/edit the content locally
  • Great editor: Atom
  • Easy to export to pdf, html, ppt(powerpoint or Google Slides), and other formats using one source markdown file.

Why Reveal.js

  • Works well with markdown, pandoc

Why Github Pages

  • We can’t directly put the html slide generated Reveal.js into blogger: it shows nothing.
  • We have to first publish the html slide online, then use iframe to refer it.
  • Github Pages is Free.

How

Use Pandoc To Generate Html Slides

  • We can use pandoc -t revealjs -s "${md}" -V revealjs-url=https://revealjs.com to generate html slides.
  • Usually we also want to change Reveal.js configuration: such as add custom css or use font-awesome, we can create one template html with __reveal_slides__ that can be replaced with the new slide content
replace_reveal_slides.bash

Publish it to Github Pages

Share the Slide to blogger

  • Use iframe to refer the html slides
  • we can also generate html from the original markdown and append it in the post.

Reveal.js Features

Plugins

  • slideout menu
    • { src: ‘https://denehyg.github.io/reveal.js-menu/plugin/reveal.js-menu/menu.js’ }
  • toolbar

Reveal.js Shortcuts

KEYACTION
N , SPACENext slide
PPrevious slide
← , HNavigate left
→ , LNavigate right
↑ , KNavigate up
↓ , JNavigate down
Home , Shift ←First slide
bblack the screen
End , Shift →Last slide
B , .Pause
FFullscreen
ESC, OSlide overview
SSpeaker notes view

Work together with Chrome Vimum

PatternsKeys
"https?://jefferyyuan.github.io/*"f,F,?,O,o,b,B

Customize reveal.js

  • Customize Reveal.initialize to add plugins, controls.
  • Customize the css.

Markdown Slides Different Syntax

Pandoc Slides Syntax

  • We can test it locally, no need to run web server or deploy it first
    • pandoc -t revealjs -s “${md}” -V revealjs-url=https://revealjs.com
  • Pandoc Syntax
  • Heading identifiers
    • Use it to specify slide attributes
    • {data-background-color=“#ff0000” data-transition=“slide-in fade-out”}
  • Inserting pauses: a paragraph containing . . .
  • change theme: -V theme:Warsaw
  • global level: parallaxBackgroundImage: /path/to/my/background_image.png
  • slide level: {data-background-image=“/path/to/special_image.jpg”}
How to have content in the top slide in 2D reveal.js slideshows

Slide show formats behavior change: content under headers less than slide level is no longer ignored, but included in the title slide (for HTML slide shows) or in a slide after the title slide (for beamer). This change makes possible 2D reveal.js slideshows with content in the top slide on each stack (#4317, #5237).

  • Must also run pandoc with --slide-level=2
Incremental lists and Speaker notes
::: incremental
:::
> -

<!-- Speaker notes -->
::: notes
:::

# Title {data-transition="fade" data-background="#A0C66B"}
[Hello, world!](http://example.com/){target="blank"}

Traps

  • The title/author must be at the title meta data block.
    • No content(including comment) before it
  • There should no content at h1 title.

Reveal.js External Markdown Syntax

[Cons of Reveal.js External Markdown Approach]
  • The problem with this approach is the extra separator “—” or “—-”
    • More type and more error-prone
    • It pollutes the output of raw html or pdf

Labels

adsense (5) Algorithm (69) Algorithm Series (35) Android (7) ANT (6) bat (8) Big Data (7) Blogger (14) Bugs (6) Cache (5) Chrome (19) Code Example (29) Code Quality (7) Coding Skills (5) Database (7) Debug (16) Design (5) Dev Tips (63) Eclipse (32) Git (5) Google (33) Guava (7) How to (9) Http Client (8) IDE (7) Interview (88) J2EE (13) J2SE (49) Java (186) JavaScript (27) JSON (7) Learning code (9) Lesson Learned (6) Linux (26) Lucene-Solr (112) Mac (10) Maven (8) Network (9) Nutch2 (18) Performance (9) PowerShell (11) Problem Solving (11) Programmer Skills (6) regex (5) Scala (6) Security (9) Soft Skills (38) Spring (22) System Design (11) Testing (7) Text Mining (14) Tips (17) Tools (24) Troubleshooting (29) UIMA (9) Web Development (19) Windows (21) xml (5)