{"name":"reveal.js","tagline":"The HTML Presentation Framework","body":"# reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.png?branch=master)](https://travis-ci.org/hakimel/reveal.js)\r\n\r\nA framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/).\r\n\r\nreveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a browser with support for CSS 3D transforms but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere.\r\n\r\n\r\n#### More reading:\r\n- [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer.\r\n- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.\r\n- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!\r\n- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.\r\n\r\n## Slides\r\n\r\nPresentations are written using HTML or markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slid.es](http://slid.es).\r\n\r\n\r\n## Instructions\r\n\r\n### Markup\r\n\r\nMarkup hierarchy needs to be ``
elements\r\n\t\t{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },\r\n\r\n\t\t// Zoom in and out with Alt+click\r\n\t\t{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },\r\n\r\n\t\t// Speaker notes\r\n\t\t{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },\r\n\r\n\t\t// Remote control your reveal.js presentation using a touch device\r\n\t\t{ src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }\r\n\t]\r\n});\r\n```\r\n\r\nYou can add your own extensions using the same syntax. The following properties are available for each dependency object:\r\n- **src**: Path to the script to load\r\n- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false\r\n- **callback**: [optional] Function to execute when the script has loaded\r\n- **condition**: [optional] Function which must return true for the script to be loaded\r\n\r\n\r\n### Presentation Size\r\n\r\nAll presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport.\r\n\r\nSee below for a list of configuration options related to sizing, including default values:\r\n\r\n```javascript\r\nReveal.initialize({\r\n\r\n\t...\r\n\r\n\t// The \"normal\" size of the presentation, aspect ratio will be preserved\r\n\t// when the presentation is scaled to fit different resolutions. Can be\r\n\t// specified using percentage units.\r\n\twidth: 960,\r\n\theight: 700,\r\n\r\n\t// Factor of the display size that should remain empty around the content\r\n\tmargin: 0.1,\r\n\r\n\t// Bounds for smallest/largest possible scale to apply to content\r\n\tminScale: 0.2,\r\n\tmaxScale: 1.0\r\n\r\n});\r\n```\r\n\r\n### Keyboard Bindings\r\n\r\nIf you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:\r\n\r\n```javascript\r\nReveal.configure({\r\n keyboard: {\r\n 13: 'next', // go to the next slide when the ENTER key is pressed\r\n 27: function() {}, // do something custom when ESC is pressed\r\n 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding)\r\n }\r\n});\r\n```\r\n\r\n\r\n### API\r\n\r\nThe ``Reveal`` class provides a JavaScript API for controlling navigation and reading state:\r\n\r\n```javascript\r\n// Navigation\r\nReveal.slide( indexh, indexv, indexf );\r\nReveal.left();\r\nReveal.right();\r\nReveal.up();\r\nReveal.down();\r\nReveal.prev();\r\nReveal.next();\r\nReveal.prevFragment();\r\nReveal.nextFragment();\r\nReveal.toggleOverview();\r\nReveal.togglePause();\r\n\r\n// Retrieves the previous and current slide elements\r\nReveal.getPreviousSlide();\r\nReveal.getCurrentSlide();\r\n\r\nReveal.getIndices(); // { h: 0, v: 0 } }\r\n\r\n// State checks\r\nReveal.isFirstSlide();\r\nReveal.isLastSlide();\r\nReveal.isOverview();\r\nReveal.isPaused();\r\n```\r\n\r\n### Ready Event\r\n\r\nThe 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.\r\n\r\n```javascript\r\nReveal.addEventListener( 'ready', function( event ) {\r\n\t// event.currentSlide, event.indexh, event.indexv\r\n} );\r\n```\r\n\r\n### Slide Changed Event\r\n\r\nAn 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.\r\n\r\nSome libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback.\r\n\r\n```javascript\r\nReveal.addEventListener( 'slidechanged', function( event ) {\r\n\t// event.previousSlide, event.currentSlide, event.indexh, event.indexv\r\n} );\r\n```\r\n\r\n\r\n### States\r\n\r\nIf you set ``data-state=\"somestate\"`` on a slide ````, \"somestate\" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.\r\n\r\nFurthermore you can also listen to these changes in state via JavaScript:\r\n\r\n```javascript\r\nReveal.addEventListener( 'somestate', function() {\r\n\t// TODO: Sprinkle magic\r\n}, false );\r\n```\r\n\r\n### Slide Backgrounds\r\n\r\nSlides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page background colors or images by applying a ```data-background``` attribute to your `````` elements. Below are a few examples.\r\n\r\n```html\r\n\r\n\tAll CSS color formats are supported, like rgba() or hsl().
\r\n \r\n\r\n\tThis slide will have a full-size background image.
\r\n \r\n\r\n\tThis background image will be sized to 100px and repeated.
\r\n \r\n```\r\n\r\nBackgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition.\r\n\r\n\r\n### Slide Transitions\r\nThe global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute:\r\n\r\n```html\r\n\r\n\tThis slide will override the presentation transition and zoom!
\r\n \r\n\r\n\r\n\tChoose from three transition speeds: default, fast or slow!
\r\n \r\n```\r\n\r\nNote that this does not work with the page and cube transitions.\r\n\r\n\r\n### Internal links\r\n\r\nIt's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (``````):\r\n\r\n```html\r\nLink\r\nLink\r\n```\r\n\r\nYou can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an ```enabled``` class when it's a valid navigation route based on the current slide.\r\n\r\n```html\r\n\r\n\r\n\r\n\r\n \r\n \r\n```\r\n\r\n\r\n### Fragments\r\nFragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/16\r\n\r\nThe default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment:\r\n\r\n```html\r\n\r\n\tgrow
\r\n\tshrink
\r\n\troll-in
\r\n\tfade-out
\r\n\thighlight-red
\r\n\thighlight-green
\r\n\thighlight-blue
\r\n \r\n```\r\n\r\nMultiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second.\r\n\r\n```html\r\n\r\n\t\r\n\t\tI'll fade in, then out\r\n\t\r\n \r\n```\r\n\r\nThe display order of fragments can be controlled using the ```data-fragment-index``` attribute.\r\n\r\n```html\r\n\r\n\tAppears last
\r\n\tAppears first
\r\n\tAppears second
\r\n \r\n```\r\n\r\n### Fragment events\r\n\r\nWhen a slide fragment is either shown or hidden reveal.js will dispatch an event.\r\n\r\n```javascript\r\nReveal.addEventListener( 'fragmentshown', function( event ) {\r\n\t// event.fragment = the fragment DOM element\r\n} );\r\nReveal.addEventListener( 'fragmenthidden', function( event ) {\r\n\t// event.fragment = the fragment DOM element\r\n} );\r\n```\r\n\r\n### Code syntax highlighting\r\n\r\nBy default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed.\r\n\r\n```html\r\n\r\n\t\r\n(def lazy-fib\r\n (concat\r\n [0 1]\r\n ((fn rfib [a b]\r\n (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))\r\n\t
\r\n \r\n```\r\n\r\n\r\n### Overview mode\r\n\r\nPress \"Esc\" key to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,\r\nas if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:\r\n\r\n```javascript\r\nReveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } );\r\nReveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );\r\n\r\n// Toggle the overview mode programmatically\r\nReveal.toggleOverview();\r\n```\r\n\r\n### Fullscreen mode\r\nJust press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.\r\n\r\n\r\n### Embedded media\r\nEmbedded HTML5 `