Giter Site home page Giter Site logo

revealdown's Introduction

RevealDown

Summary

Consistent conversion of Markdown to Reveal.js slides (via your favourite markdown to html tool, e.g. Pandoc or Marked)

Use Examples

pandoc -t html5 -s TalkNotes.md | revealdown -t > TalkSlides.html
cat TalkNotes.md | marked | revealdown -t template.html -l 2 > TalkSlides.html

Put the resultant html file (and any associated images) somewhere with a folder named reveal.js, containing the reveal.js files.

Download Binaries

Samples

Cat Code Presentation Sample
Markdown http://jordanmorris.github.io/RevealDown/regularcats/regularcats.md
Plain HTML http://jordanmorris.github.io/RevealDown/regularcats/plain.html
Slides Output http://jordanmorris.github.io/RevealDown/regularcats/

***RevealDown Command Used: ***
type regularcats.md | marked | revealdown -l 3 -t template.html > index.html

This Reademe Sample
Markdown https://raw.github.com/jordanmorris/RevealDown/master/README.md
Plain HTML You're looking at it.
Slides Output http://jordanmorris.github.io/RevealDown/rdreadme/

***RevealDown Command Used: ***
pandoc -t html5 -s README.md | revealdown -t -l 2 > index.html

Usage

Note, RevealDown only outputs the <div> containing the slides themselves (no html/body tags), unless you specify the -t switch.

revealdown [-t ["path/template.html"]] [-l <slide level>] [-h] (stdin)

Pipe in input, get stdout. Extra section breaks (within a slide) are
defined by adding <!----> on a line. If there are body tags in the 
input, only what is inside the body tags will be processed/output.
______________________________   

-l <slide level> E.g. -l 2 (default 1) = specify the deepest heading 
level which will result in a slide break. The next level in will 
create section breaks within a slide.

-t ["path/template.html"] = encapsulate slides output with an html 
template. By default uses a built-in barebones reveal.js html 
template, otherwise uses the template you specify in the optional 
path argument. In this case the slides will be inserted immediately 
after the opening body tag (which must be on its own line).

-h = horizontal rules (---- in markdown) also to be replaced by 
section breaks.

Mono compatible.

Templates

Templates are nothing special. Just create an html file with your desired reveal.js setup. Specify the filename with the -t tag and RevealDown will output the html with the slides div inserted immediately below the opening body tag. You will of course need to bring the required includes with you (.css, .js files, etc.).

There is one pre-made template in the source. It includes highlight.js and turns it on with marked syntax class name support.

Philosophy

Although RevealDown is intended for markdown users, it actually parses html. I was having a lot of trouble getting consistent results from other parsers which attempt to create reveal.js slides directly from markdown. I then realised there is a lot more predictability in html generated from markdown than there is in markdown itself. RevealDown capitalises on that fact.

The linux-like approach of piping with other parsers has other happy consequences, like how your choice of markdown to html parser is not restricted to those which directly support reveal.js slide output (or any slide output).

Other important decisions involved how to manage slide divisions. In this I have tried to support a purist markdown approach, or the use of dividers which are at least silent in html output.

Improvements I would make, given the time:

  • Rewrite it in a functional language. It turns out the task is more suited to that.
  • Write real tests.
  • Parse based on actual XML elements instead of line-by-line.
  • Better application of SOLID principles.

revealdown's People

Contributors

jordanmorris avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.