1 # reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js)
3 A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/).
5 reveal.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 modern browser but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere.
9 - [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer.
10 - [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
11 - [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
12 - [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
13 - [Plugins](https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware): A list of plugins that can be used to extend reveal.js.
17 Presentations 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://slides.com](http://slides.com).
24 Markup hierarchy needs to be ``<div class="reveal"> <div class="slides"> <section>`` where the ``<section>`` represents one slide and can be repeated indefinitely. If you place multiple ``<section>``'s inside of another ``<section>`` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and it will be included in the horizontal sequence. For example:
29 <section>Single Horizontal Slide</section>
31 <section>Vertical Slide 1</section>
32 <section>Vertical Slide 2</section>
40 It's possible to write your slides using Markdown. To enable Markdown, add the ```data-markdown``` attribute to your ```<section>``` elements and wrap the contents in a ```<script type="text/template">``` like the example below.
42 This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Irish](https://github.com/paulirish) modified to use [marked](https://github.com/chjj/marked) to support [Github Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown). Sensitive to indentation (avoid mixing tabs and spaces) and line breaks (avoid consecutive breaks).
45 <section data-markdown>
46 <script type="text/template">
49 A paragraph with some text and a [link](http://hakim.se).
54 #### External Markdown
56 You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file.
58 When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
61 <section data-markdown="example.md"
62 data-separator="^\n\n\n"
63 data-separator-vertical="^\n\n"
64 data-separator-notes="^Note:"
65 data-charset="iso-8859-15">
69 #### Element Attributes
71 Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
74 <section data-markdown>
75 <script type="text/template">
76 - Item 1 <!-- .element: class="fragment" data-fragment-index="2" -->
77 - Item 2 <!-- .element: class="fragment" data-fragment-index="1" -->
84 Special syntax (in html comment) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
87 <section data-markdown>
88 <script type="text/template">
89 <!-- .slide: data-background="#ff0000" -->
98 At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below.
103 // Display controls in the bottom right corner
106 // Display a presentation progress bar
109 // Display the page number of the current slide
112 // Push each slide change to the browser history
115 // Enable keyboard shortcuts for navigation
118 // Enable the slide overview mode
121 // Vertical centering of slides
124 // Enables touch navigation on devices with touch input
127 // Loop the presentation
130 // Change the presentation direction to be RTL
133 // Turns fragments on and off globally
136 // Flags if the presentation is running in an embedded mode,
137 // i.e. contained within a limited portion of the screen
140 // Flags if we should show a help overlay when the questionmark
144 // Flags if speaker notes should be visible to all viewers
147 // Number of milliseconds between automatically proceeding to the
148 // next slide, disabled when set to 0, this value can be overwritten
149 // by using a data-autoslide attribute on your slides
152 // Stop auto-sliding after user input
153 autoSlideStoppable: true,
155 // Enable slide navigation via mouse wheel
158 // Hides the address bar on mobile devices
159 hideAddressBar: true,
161 // Opens links in an iframe preview overlay
165 transition: 'default', // none/fade/slide/convex/concave/zoom
168 transitionSpeed: 'default', // default/fast/slow
170 // Transition style for full page slide backgrounds
171 backgroundTransition: 'default', // none/fade/slide/convex/concave/zoom
173 // Number of slides away from the current that are visible
176 // Parallax background image
177 parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
179 // Parallax background size
180 parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px"
182 // Amount to move parallax background (horizontal and vertical) on slide change
184 parallaxBackgroundHorizontal: '',
185 parallaxBackgroundVertical: ''
191 The configuration can be updated after initialization using the ```configure``` method:
194 // Turn autoSlide off
195 Reveal.configure({ autoSlide: 0 });
197 // Start auto-sliding every 5s
198 Reveal.configure({ autoSlide: 5000 });
204 Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example:
209 // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/
210 { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
212 // Interpret Markdown in <section> elements
213 { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
214 { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
216 // Syntax highlight for <code> elements
217 { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
219 // Zoom in and out with Alt+click
220 { src: 'plugin/zoom-js/zoom.js', async: true },
223 { src: 'plugin/notes/notes.js', async: true },
225 // Remote control your reveal.js presentation using a touch device
226 { src: 'plugin/remotes/remotes.js', async: true },
229 { src: 'plugin/math/math.js', async: true }
234 You can add your own extensions using the same syntax. The following properties are available for each dependency object:
235 - **src**: Path to the script to load
236 - **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false
237 - **callback**: [optional] Function to execute when the script has loaded
238 - **condition**: [optional] Function which must return true for the script to be loaded
243 A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`.
246 Reveal.addEventListener( 'ready', function( event ) {
247 // event.currentSlide, event.indexh, event.indexv
252 ### Presentation Size
254 All 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.
256 See below for a list of configuration options related to sizing, including default values:
263 // The "normal" size of the presentation, aspect ratio will be preserved
264 // when the presentation is scaled to fit different resolutions. Can be
265 // specified using percentage units.
269 // Factor of the display size that should remain empty around the content
272 // Bounds for smallest/largest possible scale to apply to content
282 Presentations can be configured to progress through slides automatically, without any user input. To enable this you will need to tell the framework how many milliseconds it should wait between slides:
285 // Slide every five seconds
290 When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Alternatively, sliding can be paused or resumed by pressing »a« on the keyboard. Sliding is paused automatically as soon as the user starts navigating. You can disable these controls by specifying ```autoSlideStoppable: false``` in your reveal.js config.
292 You can also override the slide duration for individual slides and fragments by using the ```data-autoslide``` attribute:
295 <section data-autoslide="2000">
296 <p>After 2 seconds the first fragment will be shown.</p>
297 <p class="fragment" data-autoslide="10000">After 10 seconds the next fragment will be shown.</p>
298 <p class="fragment">Now, the fragment is displayed for 2 seconds before the next slide is shown.</p>
302 Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired.
305 ### Keyboard Bindings
307 If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
312 13: 'next', // go to the next slide when the ENTER key is pressed
313 27: function() {}, // do something custom when ESC is pressed
314 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding)
321 You can swipe to navigate through a presentation on any touch-enabled device. Horizontal swipes change between horizontal slides, vertical swipes change between vertical slides. If you wish to disable this you can set the `touch` config option to false when initializing reveal.js.
323 If there's some part of your content that needs to remain accessible to touch events you'll need to highlight this by adding a `data-prevent-swipe` attribute to the element. One common example where this is useful is elements that need to be scrolled.
328 When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option.
330 To enable lazy loading all you need to do is change your "src" attributes to "data-src" as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible.
334 <img data-src="image.png">
335 <iframe data-src="http://hakim.se"></iframe>
337 <source data-src="video.webm" type="video/webm" />
338 <source data-src="video.mp4" type="video/mp4" />
346 The ``Reveal`` object exposes a JavaScript API for controlling navigation and reading state:
350 Reveal.slide( indexh, indexv, indexf );
357 Reveal.prevFragment();
358 Reveal.nextFragment();
360 // Toggle presentation states, optionally pass true/false to force on/off
361 Reveal.toggleOverview();
362 Reveal.togglePause();
363 Reveal.toggleAutoSlide();
365 // Change a config value at runtime
366 Reveal.configure({ controls: true });
368 // Returns the present configuration options
371 // Fetch the current scale of the presentation
374 // Retrieves the previous and current slide elements
375 Reveal.getPreviousSlide();
376 Reveal.getCurrentSlide();
378 Reveal.getIndices(); // { h: 0, v: 0 } }
379 Reveal.getProgress(); // 0-1
380 Reveal.getTotalSlides();
382 // Returns the speaker notes for the current slide
383 Reveal.getSlideNotes();
386 Reveal.isFirstSlide();
387 Reveal.isLastSlide();
390 Reveal.isAutoSliding();
393 ### Slide Changed Event
395 A '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.
397 Some 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.
400 Reveal.addEventListener( 'slidechanged', function( event ) {
401 // event.previousSlide, event.currentSlide, event.indexh, event.indexv
405 ### Presentation State
407 The presentation's current state can be fetched by using the `getState` method. A state object contains all of the information required to put the presentation back as it was when `getState` was first called. Sort of like a snapshot. It's a simple object that can easily be stringified and persisted or sent over the wire.
413 var state = Reveal.getState();
418 Reveal.setState( state );
419 // we're back on slide 1
424 If you set ``data-state="somestate"`` on a slide ``<section>``, "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.
426 Furthermore you can also listen to these changes in state via JavaScript:
429 Reveal.addEventListener( 'somestate', function() {
430 // TODO: Sprinkle magic
434 ### Slide Backgrounds
436 Slides 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 backgrounds outside of the slide area by adding a ```data-background``` attribute to your ```<section>``` elements. Four different types of backgrounds are supported: color, image, video and iframe. Below are a few examples.
439 <section data-background="#ff0000">
440 <h2>All CSS color formats are supported, like rgba() or hsl().</h2>
442 <section data-background="http://example.com/image.png">
443 <h2>This slide will have a full-size background image.</h2>
445 <section data-background="http://example.com/image.png" data-background-size="100px" data-background-repeat="repeat">
446 <h2>This background image will be sized to 100px and repeated.</h2>
448 <section data-background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm" data-background-video-loop>
449 <h2>Video. Multiple sources can be defined using a comma separated list. Video will loop when the data-background-video-loop attribute is provided.</h2>
451 <section data-background-iframe="https://slides.com">
452 <h2>Embeds a web page as a background. Note that the page won't be interactive.</h2>
456 Backgrounds 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.
459 ### Parallax Background
461 If you want to use a parallax scrolling background, set the first two config properties below when initializing reveal.js (the other two are optional).
466 // Parallax background image
467 parallaxBackgroundImage: '', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg"
469 // Parallax background size
470 parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto)
472 // Amount of pixels to move the parallax background per slide step,
473 // a value of 0 disables movement along the given axis
474 // These are optional, if they aren't specified they'll be calculated automatically
475 parallaxBackgroundHorizontal: 200,
476 parallaxBackgroundVertical: 50
481 Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://lab.hakim.se/reveal-js/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px).
485 ### Slide Transitions
486 The 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:
489 <section data-transition="zoom">
490 <h2>This slide will override the presentation transition and zoom!</h2>
493 <section data-transition-speed="fast">
494 <h2>Choose from three transition speeds: default, fast or slow!</h2>
498 You can also use different in and out transitions for the same slide:
501 <section data-transition="slide">
502 The train goes on …
504 <section data-transition="slide">
507 <section data-transition="slide-in fade-out">
510 <section data-transition="fade-in slide-out">
511 (Passengers entering and leaving)
513 <section data-transition="slide">
519 Note that this does not work with the page and cube transitions.
524 It'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 (```<section id="some-slide">```):
527 <a href="#/2/2">Link</a>
528 <a href="#/some-slide">Link</a>
531 You 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.
534 <a href="#" class="navigate-left">
535 <a href="#" class="navigate-right">
536 <a href="#" class="navigate-up">
537 <a href="#" class="navigate-down">
538 <a href="#" class="navigate-prev"> <!-- Previous vertical or horizontal slide -->
539 <a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
544 Fragments 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/#/fragments
546 The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment:
550 <p class="fragment grow">grow</p>
551 <p class="fragment shrink">shrink</p>
552 <p class="fragment fade-out">fade-out</p>
553 <p class="fragment current-visible">visible only once</p>
554 <p class="fragment highlight-current-blue">blue only once</p>
555 <p class="fragment highlight-red">highlight-red</p>
556 <p class="fragment highlight-green">highlight-green</p>
557 <p class="fragment highlight-blue">highlight-blue</p>
561 Multiple 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.
565 <span class="fragment fade-in">
566 <span class="fragment fade-out">I'll fade in, then out</span>
571 The display order of fragments can be controlled using the ```data-fragment-index``` attribute.
575 <p class="fragment" data-fragment-index="3">Appears last</p>
576 <p class="fragment" data-fragment-index="1">Appears first</p>
577 <p class="fragment" data-fragment-index="2">Appears second</p>
583 When a slide fragment is either shown or hidden reveal.js will dispatch an event.
585 Some libraries, like MathJax (see #505), get confused by the initially hidden fragment elements. Often times this can be fixed by calling their update or render function from this callback.
588 Reveal.addEventListener( 'fragmentshown', function( event ) {
589 // event.fragment = the fragment DOM element
591 Reveal.addEventListener( 'fragmenthidden', function( event ) {
592 // event.fragment = the fragment DOM element
596 ### Code syntax highlighting
598 By 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.
602 <pre><code data-trim>
607 (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
613 If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value.
616 // Shows the slide number using default formatting
617 Reveal.configure({ slideNumber: true });
619 // Slide number formatting can be configured using these variables:
620 // h: current slide's horizontal index
621 // v: current slide's vertical index
622 // c: current slide index (flattened)
623 // t: total number of slides (flattened)
624 Reveal.configure({ slideNumber: 'c / t' });
631 Press "Esc" or "o" keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
632 as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
635 Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } );
636 Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
638 // Toggle the overview mode programmatically
639 Reveal.toggleOverview();
643 Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
647 Embedded HTML5 `<video>`/`<audio>` and YouTube iframes are automatically paused when you navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
649 Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
652 <video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
655 Additionally the framework automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to all iframes, ```slide:start``` when the slide containing the iframe is made visible and ```slide:stop``` when it is hidden.
658 ### Stretching elements
659 Sometimes it's desirable to have an element, like an image or video, stretch to consume as much space as possible within a given slide. This can be done by adding the ```.stretch``` class to an element as seen below:
663 <h2>This video will use up the remaining space on the slide</h2>
664 <video class="stretch" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
669 - Only direct descendants of a slide section can be stretched
670 - Only one descendant per slide section can be stretched
674 The framework has a built-in postMessage API that can be used when communicating with a presentation inside of another window. Here's an example showing how you'd make a reveal.js instance in the given window proceed to slide 2:
677 <window>.postMessage( JSON.stringify({ method: 'slide', args: [ 2 ] }), '*' );
680 When reveal.js runs inside of an iframe it can optionally bubble all of its events to the parent. Bubbled events are stringified JSON with three fields: namespace, eventName and state. Here's how you subscribe to them from the parent window:
683 window.addEventListener( 'message', function( event ) {
684 var data = JSON.parse( event.data );
685 if( data.namespace === 'reveal' && data.eventName ='slidechanged' ) {
686 // Slide changed, see data.state for slide number
691 This cross-window messaging can be toggled on or off using configuration flags.
697 // Exposes the reveal.js API through window.postMessage
700 // Dispatches all reveal.js events to the parent window through postMessage
701 postMessageEvents: false
708 Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome) or [Chromium](https://www.chromium.org/Home).
709 Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.
711 1. Open your presentation with `print-pdf` included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet ([css/print/pdf.css](https://github.com/hakimel/reveal.js/blob/master/css/print/pdf.css)). You can test this with [lab.hakim.se/reveal-js?print-pdf](http://lab.hakim.se/reveal-js?print-pdf).
712 2. Open the in-browser print dialog (CMD+P).
713 3. Change the **Destination** setting to **Save as PDF**.
714 4. Change the **Layout** to **Landscape**.
715 5. Change the **Margins** to **None**.
718 ![Chrome Print Settings](https://s3.amazonaws.com/hakim-static/reveal-js/pdf-print-settings.png)
720 Alternatively you can use the [decktape](https://github.com/astefanutti/decktape) project.
724 The framework comes with a few different themes included:
726 - black: Black background, white text, blue links (default theme)
727 - white: White background, black text, blue links
728 - league: Gray background, white text, blue links (default theme for reveal.js < 3.0.0)
729 - beige: Beige background, dark text, brown links
730 - sky: Blue background, thin dark text, blue links
731 - night: Black background, thick white text, orange links
732 - serif: Cappuccino background, gray text, brown links
733 - simple: White background, black text, blue links
734 - solarized: Cream-colored background, dark green text, blue links
736 Each theme is available as a separate stylesheet. To change theme you will need to replace **black** below with your desired theme name in index.html:
739 <link rel="stylesheet" href="css/theme/black.css" id="theme">
742 If you want to add a theme of your own see the instructions here: [/css/theme/README.md](https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md).
747 reveal.js comes with a speaker notes plugin which can be used to present per-slide notes in a separate browser window. The notes window also gives you a preview of the next upcoming slide so it may be helpful even if you haven't written any notes. Press the 's' key on your keyboard to open the notes window.
749 Notes are defined by appending an ```<aside>``` element to a slide as seen below. You can add the ```data-markdown``` attribute to the aside element if you prefer writing notes using Markdown.
751 Alternatively you can add your notes in a `data-notes` attribute on the slide. Like `<section data-notes="Something important"></section>`.
753 When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
759 <aside class="notes">
760 Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
765 Notes are only visible to you in the speaker view. If you wish to share your notes with the audience initialize reveal.js with the `showNotes` config value set to `true`.
767 If you're using the external Markdown plugin, you can add notes with the help of a special delimiter:
770 <section data-markdown="example.md" data-separator="^\n\n\n" data-separator-vertical="^\n\n" data-separator-notes="^Note:"></section>
775 Here is some content...
778 This will only display in the notes window.
781 ## Server Side Speaker Notes
783 In some cases it can be desirable to run notes on a separate device from the one you're presenting on. The Node.js-based notes plugin lets you do this using the same note definitions as its client side counterpart. Include the required scripts by adding the following dependencies:
790 { src: 'socket.io/socket.io.js', async: true },
791 { src: 'plugin/notes-server/client.js', async: true }
798 1. Install [Node.js](http://nodejs.org/)
799 2. Run ```npm install```
800 3. Run ```node plugin/notes-server```
805 The multiplex plugin allows your audience to view the slides of the presentation you are controlling on their own phone, tablet or laptop. As the master presentation navigates the slides, all client presentations will update in real time. See a demo at [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/).
807 The multiplex plugin needs the following 3 things to operate:
809 1. Master presentation that has control
810 2. Client presentations that follow the master
811 3. Socket.io server to broadcast events from the master to the clients
815 #### Master presentation
816 Served from a static file server accessible (preferably) only to the presenter. This need only be on your (the presenter's) computer. (It's safer to run the master presentation from your own computer, so if the venue's Internet goes down it doesn't stop the show.) An example would be to execute the following commands in the directory of your master presentation:
818 1. ```npm install node-static```
821 If you want to use the speaker notes plugin with your master presentation then make sure you have the speaker notes plugin configured correctly along with the configuration shown below, then execute ```node plugin/notes-server``` in the directory of your master presentation. The configuration below will cause it to connect to the socket.io server as a master, as well as launch your speaker-notes/static-file server.
823 You can then access your master presentation at ```http://localhost:1947```
825 Example configuration:
831 // Example values. To generate your own, see the socket.io server instructions.
832 secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
833 id: '1ea875674b17ca76', // Obtained from socket.io server
834 url: 'revealjs-51546.onmodulus.net:80' // Location of socket.io server
837 // Don't forget to add the dependencies
839 { src: '//cdn.socket.io/socket.io-1.3.5.js', async: true },
840 { src: 'plugin/multiplex/master.js', async: true },
842 // and if you want speaker notes
843 { src: 'plugin/notes-server/client.js', async: true }
845 // other dependencies...
850 #### Client presentation
851 Served from a publicly accessible static file server. Examples include: GitHub Pages, Amazon S3, Dreamhost, Akamai, etc. The more reliable, the better. Your audience can then access the client presentation via ```http://example.com/path/to/presentation/client/index.html```, with the configuration below causing them to connect to the socket.io server as clients.
853 Example configuration:
859 // Example values. To generate your own, see the socket.io server instructions.
860 secret: null, // null so the clients do not have control of the master presentation
861 id: '1ea875674b17ca76', // id, obtained from socket.io server
862 url: 'revealjs-51546.onmodulus.net:80' // Location of socket.io server
865 // Don't forget to add the dependencies
867 { src: '//cdn.socket.io/socket.io-1.3.5.js', async: true },
868 { src: 'plugin/multiplex/client.js', async: true }
870 // other dependencies...
875 #### Socket.io server
876 Server that receives the slideChanged events from the master presentation and broadcasts them out to the connected client presentations. This needs to be publicly accessible. You can run your own socket.io server with the commands:
879 2. ```node plugin/multiplex```
881 Or you use the socket.io server at [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/).
883 You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/), visit [http://revealjs-51546.onmodulus.net/token](http://revealjs-51546.onmodulus.net/token).
885 You are very welcome to point your presentations at the Socket.io server running at [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/), but availability and stability are not guaranteed. For anything mission critical I recommend you run your own server. It is simple to deploy to nodejitsu, heroku, your own environment, etc.
887 ##### socket.io server as file static server
889 The socket.io server can play the role of static file server for your client presentation, as in the example at [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/). (Open [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/) in two browsers. Navigate through the slides on one, and the other will update to match.)
891 Example configuration:
897 // Example values. To generate your own, see the socket.io server instructions.
898 secret: null, // null so the clients do not have control of the master presentation
899 id: '1ea875674b17ca76', // id, obtained from socket.io server
900 url: 'example.com:80' // Location of your socket.io server
903 // Don't forget to add the dependencies
905 { src: '//cdn.socket.io/socket.io-1.3.5.js', async: true },
906 { src: 'plugin/multiplex/client.js', async: true }
908 // other dependencies...
912 It can also play the role of static file server for your master presentation and client presentations at the same time (as long as you don't want to use speaker notes). (Open [http://revealjs-51546.onmodulus.net/](http://revealjs-51546.onmodulus.net/) in two browsers. Navigate through the slides on one, and the other will update to match. Navigate through the slides on the second, and the first will update to match.) This is probably not desirable, because you don't want your audience to mess with your slides while you're presenting. ;)
914 Example configuration:
920 // Example values. To generate your own, see the socket.io server instructions.
921 secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
922 id: '1ea875674b17ca76', // Obtained from socket.io server
923 url: 'example.com:80' // Location of your socket.io server
926 // Don't forget to add the dependencies
928 { src: '//cdn.socket.io/socket.io-1.3.5.js', async: true },
929 { src: 'plugin/multiplex/master.js', async: true },
930 { src: 'plugin/multiplex/client.js', async: true }
932 // other dependencies...
939 If you want to display math equations in your presentation you can easily do so by including this plugin. The plugin is a very thin wrapper around the [MathJax](http://www.mathjax.org/) library. To use it you'll need to include it as a reveal.js dependency, [find our more about dependencies here](#dependencies).
941 The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the ```math``` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the ```mathjax``` configuration value.
943 Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the ```math``` config object at all.
951 mathjax: 'https://cdn.mathjax.org/mathjax/latest/MathJax.js',
952 config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html
956 { src: 'plugin/math/math.js', async: true }
962 Read MathJax's documentation if you need [HTTPS delivery](http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) or serving of [specific versions](http://docs.mathjax.org/en/latest/configuration.html#loading-mathjax-from-the-cdn) for stability.
967 The **basic setup** is for authoring presentations only. The **full setup** gives you access to all reveal.js features and plugins such as speaker notes as well as the development tasks needed to make changes to the source.
971 The core of reveal.js is very easy to install. You'll simply need to download a copy of this repository and open the index.html file directly in your browser.
973 1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
975 2. Unzip and replace the example contents in index.html with your own
977 3. Open index.html in a browser to view it
982 Some reveal.js features, like external Markdown and speaker notes, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code.
984 1. Install [Node.js](http://nodejs.org/)
986 2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
988 4. Clone the reveal.js repository
990 $ git clone https://github.com/hakimel/reveal.js.git
993 5. Navigate to the reveal.js folder
998 6. Install dependencies
1003 7. Serve the presentation and monitor source files for changes
1008 8. Open <http://localhost:8000> to view your presentation
1010 You can change the port by using `grunt serve --port 8001`.
1013 ### Folder Structure
1014 - **css/** Core styles without which the project does not function
1015 - **js/** Like above but for JavaScript
1016 - **plugin/** Components that have been developed as extensions to reveal.js
1017 - **lib/** All other third party assets (JavaScript, CSS, fonts)
1024 Copyright (C) 2015 Hakim El Hattab, http://hakim.se