Cleanup readme to make it easier to read/edit.

- Use `single backticks` consistently for inline code snippets.
- Add double linefeeds before level 2 headings.
- Add a single linefeed after each heading.
- Minor docs edits.
This commit is contained in:
Benjamin Tan 2018-02-14 18:36:18 +08:00
parent 7991693bde
commit 1427f7a1ae
1 changed files with 95 additions and 77 deletions

172
README.md
View File

@ -4,7 +4,9 @@ A framework for easily creating beautiful presentations using HTML. [Check out t
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). There's also a fully featured visual editor and platform for sharing reveal.js presentations at [slides.com](https://slides.com?ref=github).
## Table of contents
- [Online Editor](#online-editor)
- [Instructions](#instructions)
- [Markup](#markup)
@ -53,11 +55,13 @@ reveal.js comes with a broad range of features including [nested slides](https:/
- [License](#license)
#### More reading
- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
- [Plugins](https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware): A list of plugins that can be used to extend reveal.js.
## Online Editor
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 [https://slides.com](https://slides.com?ref=github).
@ -121,7 +125,7 @@ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Iri
#### External Markdown
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-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `note:`). The `data-charset` attribute is optional and specifies which charset to use when loading the external file.
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-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `notes?:`). The `data-charset` attribute is optional and specifies which charset to use when loading the external file.
When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). The following example customises all available options:
@ -140,7 +144,7 @@ When used locally, this feature requires that reveal.js [runs from a local web s
#### Element Attributes
Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
Special syntax (through HTML comments) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
```html
<section data-markdown>
@ -153,7 +157,7 @@ Special syntax (in html comment) is available for adding attributes to Markdown
#### Slide Attributes
Special syntax (in html comment) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
Special syntax (through HTML comments) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
```html
<section data-markdown>
@ -180,7 +184,7 @@ Reveal.initialize({
### Configuration
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.
At the end of your page you need to initialize reveal by running the following code. Note that all configuration values are optional and will default to the values specified below.
```javascript
Reveal.initialize({
@ -304,8 +308,7 @@ Reveal.initialize({
});
```
The configuration can be updated after initialization using the ```configure``` method:
The configuration can be updated after initialization using the `configure` method:
```javascript
// Turn autoSlide off
@ -315,17 +318,16 @@ Reveal.configure({ autoSlide: 0 });
Reveal.configure({ autoSlide: 5000 });
```
### Presentation Size
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.
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.
See below for a list of configuration options related to sizing, including default values:
```javascript
Reveal.initialize({
...
// ...
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
@ -348,7 +350,7 @@ If you wish to disable this behavior and do your own scaling (e.g. using media q
```javascript
Reveal.initialize({
...
// ...
width: "100%",
height: "100%",
@ -397,7 +399,7 @@ To load these dependencies, reveal.js requires [head.js](http://headjs.com/) *(a
### Ready Event
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()`.
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()`.
```javascript
Reveal.addEventListener( 'ready', function( event ) {
@ -417,9 +419,10 @@ Reveal.configure({
autoSlide: 5000
});
```
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.
You can also override the slide duration for individual slides and fragments by using the ```data-autoslide``` attribute:
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.
You can also override the slide duration for individual slides and fragments by using the `data-autoslide` attribute:
```html
<section data-autoslide="2000">
@ -429,14 +432,13 @@ You can also override the slide duration for individual slides and fragments by
</section>
```
To override the method used for navigation when auto-sliding, you can specify the ```autoSlideMethod``` setting. To only navigate along the top layer and ignore vertical slides, set this to ```Reveal.navigateRight```.
Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired.
To override the method used for navigation when auto-sliding, you can specify the `autoSlideMethod` setting. To only navigate along the top layer and ignore vertical slides, set this to `Reveal.navigateRight`.
Whenever the auto-slide mode is resumed or paused the `autoslideresumed` and `autoslidepaused` events are fired.
### Keyboard Bindings
If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
If you're unhappy with any of the default keyboard bindings you can override them using the `keyboard` config option:
```javascript
Reveal.configure({
@ -454,12 +456,11 @@ You can swipe to navigate through a presentation on any touch-enabled device. Ho
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.
### Lazy Loading
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.
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.
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.
```html
<section>
@ -472,10 +473,9 @@ To enable lazy loading all you need to do is change your "src" attributes to "da
</section>
```
### API
The ``Reveal`` object exposes a JavaScript API for controlling navigation and reading state:
The `Reveal` object exposes a JavaScript API for controlling navigation and reading state:
```javascript
// Navigation
@ -514,11 +514,11 @@ Reveal.getScale();
Reveal.getPreviousSlide();
Reveal.getCurrentSlide();
Reveal.getIndices(); // { h: 0, v: 0 } }
Reveal.getPastSlideCount();
Reveal.getIndices(); // { h: 0, v: 0, f: 0 }
Reveal.getSlidePastCount();
Reveal.getProgress(); // (0 == first slide, 1 == last slide)
Reveal.getSlides(); // Array of all slides
Reveal.getTotalSlides(); // total number of slides
Reveal.getTotalSlides(); // Total number of slides
// Returns the speaker notes for the current slide
Reveal.getSlideNotes();
@ -533,7 +533,7 @@ Reveal.isAutoSliding();
### Slide Changed Event
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.
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.
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.
@ -562,7 +562,7 @@ Reveal.setState( state );
### Slide States
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.
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.
Furthermore you can also listen to these changes in state via JavaScript:
@ -574,10 +574,12 @@ Reveal.addEventListener( 'somestate', function() {
### Slide Backgrounds
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.
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.
#### Color Backgrounds
All CSS color formats are supported, like rgba() or hsl().
All CSS color formats are supported, including hex values, keywords, `rgba()` or `hsl()`.
```html
<section data-background-color="#ff0000">
<h2>Color</h2>
@ -585,6 +587,7 @@ All CSS color formats are supported, like rgba() or hsl().
```
#### Image Backgrounds
By default, background images are resized to cover the full page. Available options:
| Attribute | Default | Description |
@ -593,6 +596,7 @@ By default, background images are resized to cover the full page. Available opti
| data-background-size | cover | See [background-size](https://developer.mozilla.org/docs/Web/CSS/background-size) on MDN. |
| data-background-position | center | See [background-position](https://developer.mozilla.org/docs/Web/CSS/background-position) on MDN. |
| data-background-repeat | no-repeat | See [background-repeat](https://developer.mozilla.org/docs/Web/CSS/background-repeat) on MDN. |
```html
<section data-background-image="http://example.com/image.png">
<h2>Image</h2>
@ -603,6 +607,7 @@ By default, background images are resized to cover the full page. Available opti
```
#### Video Backgrounds
Automatically plays a full size video behind the slide.
| Attribute | Default | Description |
@ -619,7 +624,9 @@ Automatically plays a full size video behind the slide.
```
#### Iframe Backgrounds
Embeds a web page as a slide background that covers 100% of the reveal.js width and height. The iframe is in the background layer, behind your slides, and as such it's not possible to interact with it by default. To make your background interactive, you can add the `data-background-interactive` attribute.
```html
<section data-background-iframe="https://slides.com" data-background-interactive>
<h2>Iframe</h2>
@ -627,12 +634,13 @@ Embeds a web page as a slide background that covers 100% of the reveal.js width
```
#### Background Transitions
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.
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.
### Parallax Background
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).
If you want to use a parallax scrolling background, set the first two properties below when initializing reveal.js (the other two are optional).
```javascript
Reveal.initialize({
@ -654,10 +662,9 @@ Reveal.initialize({
Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://revealjs.com/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg&parallaxBackgroundSize=2100px%20900px).
### Slide Transitions
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:
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:
```html
<section data-transition="zoom">
@ -689,17 +696,16 @@ You can also use different in and out transitions for the same slide:
</section>
```
### Internal links
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">```):
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">`):
```html
<a href="#/2/2">Link</a>
<a href="#/some-slide">Link</a>
```
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.
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.
```html
<a href="#" class="navigate-left">
@ -710,9 +716,9 @@ You can also add relative navigation links, similar to the built in reveal.js co
<a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
```
### Fragments
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://revealjs.com/#/fragments
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://revealjs.com/#/fragments
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:
@ -740,7 +746,7 @@ Multiple fragments can be applied to the same element sequentially by wrapping i
</section>
```
The display order of fragments can be controlled using the ```data-fragment-index``` attribute.
The display order of fragments can be controlled using the `data-fragment-index` attribute.
```html
<section>
@ -769,6 +775,15 @@ Reveal.addEventListener( 'fragmenthidden', function( event ) {
By default, Reveal is configured with [highlight.js](https://highlightjs.org/) for code syntax highlighting. To enable syntax highlighting, you'll have to load the highlight plugin ([plugin/highlight/highlight.js](plugin/highlight/highlight.js)) and a highlight.js CSS theme (Reveal comes packaged with the zenburn theme: [lib/css/zenburn.css](lib/css/zenburn.css)).
```javascript
Reveal.initialize({
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
]
});
```
Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present, surrounding whitespace is automatically removed. HTML will be escaped by default. To avoid this, for example if you are using `<mark>` to call out a line of code, add the `data-noescape` attribute to the `<code>` element.
```html
@ -784,7 +799,8 @@ Below is an example with clojure code that will be syntax highlighted. When the
```
### Slide number
If you would like to display the page number of the current slide you can do so using the ```slideNumber``` and ```showSlideNumber``` configuration values.
If you would like to display the page number of the current slide you can do so using the `slideNumber` and `showSlideNumber` configuration values.
```javascript
// Shows the slide number using default formatting
@ -802,13 +818,11 @@ Reveal.configure({ slideNumber: 'c/t' });
// "speaker": only show slide numbers on speaker notes view
// "print": only show slide numbers when printing to PDF
Reveal.configure({ showSlideNumber: 'speaker' });
```
### Overview mode
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,
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,
as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
```javascript
@ -819,12 +833,12 @@ Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
Reveal.toggleOverview();
```
### Fullscreen mode
Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
### Embedded media
Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
```html
@ -835,14 +849,13 @@ If you want to enable or disable autoplay globally, for all embedded media, you
Note that embedded HTML5 `<video>`/`<audio>` and YouTube/Vimeo iframes are automatically paused when you navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
### Embedded iframes
reveal.js automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to embedded iframes. ```slide:start``` when the slide containing the iframe is made visible and ```slide:stop``` when it is hidden.
reveal.js automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to embedded iframes. `slide:start` when the slide containing the iframe is made visible and `slide:stop` when it is hidden.
### Stretching elements
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:
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:
```html
<section>
@ -855,8 +868,8 @@ Limitations:
- Only direct descendants of a slide section can be stretched
- Only one descendant per slide section can be stretched
### postMessage API
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:
```javascript
@ -878,7 +891,7 @@ This cross-window messaging can be toggled on or off using configuration flags.
```javascript
Reveal.initialize({
...,
// ...
// Exposes the reveal.js API through window.postMessage
postMessage: true,
@ -895,9 +908,11 @@ Presentations can be exported to PDF via a special print stylesheet. This featur
Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.
### Page size
Export dimensions are inferred from the configured [presentation size](#presentation-size). Slides that are too tall to fit within a single page will expand onto multiple pages. You can limit how many pages a slide may expand onto using the `pdfMaxPagesPerSlide` config option, for example `Reveal.configure({ pdfMaxPagesPerSlide: 1 })` ensures that no slide ever grows to more than one printed page.
### Print stylesheet
To enable the PDF print capability in your presentation, the special print stylesheet at [/css/print/pdf.css](https://github.com/hakimel/reveal.js/blob/master/css/print/pdf.css) must be loaded. The default index.html file handles this for you when `print-pdf` is included in the query string. If you're using a different HTML template, you can add this to your HEAD:
```html
@ -911,6 +926,7 @@ To enable the PDF print capability in your presentation, the special print style
```
### Instructions
1. Open your presentation with `print-pdf` included in the query string i.e. http://localhost:8000/?print-pdf. You can test this with [revealjs.com?print-pdf](http://revealjs.com?print-pdf).
* If you want to include [speaker notes](#speaker-notes) in your export, you can append `showNotes=true` to the query string: http://localhost:8000/?print-pdf&showNotes=true
1. Open the in-browser print dialog (CTRL/CMD+P).
@ -924,6 +940,7 @@ To enable the PDF print capability in your presentation, the special print style
Alternatively you can use the [decktape](https://github.com/astefanutti/decktape) project.
## Theming
The framework comes with a few different themes included:
@ -949,11 +966,11 @@ If you want to add a theme of your own see the instructions here: [/css/theme/RE
## Speaker Notes
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.
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.
A speaker timer starts as soon as the speaker view is opened. You can reset it to 00:00:00 at any time by simply clicking/tapping on it.
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.
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.
Alternatively you can add your notes in a `data-notes` attribute on the slide. Like `<section data-notes="Something important"></section>`.
@ -964,7 +981,7 @@ When used locally, this feature requires that reveal.js [runs from a local web s
<h2>Some Slide</h2>
<aside class="notes">
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).
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).
</aside>
</section>
```
@ -985,7 +1002,7 @@ This will only display in the notes window.
#### Share and Print Speaker Notes
Notes are only visible to the speaker inside of the speaker view. If you wish to share your notes with others you can initialize reveal.js with the `showNotes` config value set to `true`. Notes will appear along the bottom of the presentations.
Notes are only visible to the speaker inside of the speaker view. If you wish to share your notes with others you can initialize reveal.js with the `showNotes` configuration value set to `true`. Notes will appear along the bottom of the presentations.
When `showNotes` is enabled notes are also included when you [export to PDF](https://github.com/hakimel/reveal.js#pdf-export). By default, notes are printed in a semi-transparent box on top of the slide. If you'd rather print them on a separate page after the slide, set `showNotes: "separate-page"`.
@ -1006,7 +1023,7 @@ In some cases it can be desirable to run notes on a separate device from the one
```javascript
Reveal.initialize({
...
// ...
dependencies: [
{ src: 'socket.io/socket.io.js', async: true },
@ -1018,8 +1035,8 @@ Reveal.initialize({
Then:
1. Install [Node.js](http://nodejs.org/) (4.0.0 or later)
2. Run ```npm install```
3. Run ```node plugin/notes-server```
2. Run `npm install`
3. Run `node plugin/notes-server`
## Multiplexing
@ -1032,19 +1049,19 @@ The multiplex plugin needs the following 3 things to operate:
2. Client presentations that follow the master
3. Socket.io server to broadcast events from the master to the clients
More details:
#### Master presentation
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:
1. ```npm install node-static```
2. ```static```
1. `npm install node-static`
2. `static`
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.
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.
You can then access your master presentation at ```http://localhost:1947```
You can then access your master presentation at `http://localhost:1947`
Example configuration:
```javascript
Reveal.initialize({
// other options...
@ -1070,9 +1087,11 @@ Reveal.initialize({
```
#### Client presentation
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.
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.
Example configuration:
```javascript
Reveal.initialize({
// other options...
@ -1095,14 +1114,15 @@ Reveal.initialize({
```
#### Socket.io server
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:
1. ```npm install```
2. ```node plugin/multiplex```
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:
1. `npm install`
2. `node plugin/multiplex`
Or you can use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/).
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 [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token).
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 [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token).
You are very welcome to point your presentations at the Socket.io server running at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), but availability and stability are not guaranteed.
@ -1113,6 +1133,7 @@ For anything mission critical I recommend you run your own server. The easiest w
The socket.io server can play the role of static file server for your client presentation, as in the example at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/). (Open [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/) in two browsers. Navigate through the slides on one, and the other will update to match.)
Example configuration:
```javascript
Reveal.initialize({
// other options...
@ -1136,6 +1157,7 @@ Reveal.initialize({
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 [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/) 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. ;)
Example configuration:
```javascript
Reveal.initialize({
// other options...
@ -1158,17 +1180,17 @@ Reveal.initialize({
});
```
## MathJax
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).
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.
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.
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.
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.
```js
Reveal.initialize({
// other options ...
math: {
@ -1179,7 +1201,6 @@ Reveal.initialize({
dependencies: [
{ src: 'plugin/math/math.js', async: true }
]
});
```
@ -1195,12 +1216,9 @@ The **basic setup** is for authoring presentations only. The **full setup** give
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.
1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
2. Unzip and replace the example contents in index.html with your own
3. Open index.html in a browser to view it
### Full setup
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.
@ -1231,8 +1249,8 @@ Some reveal.js features, like external Markdown and speaker notes, require that
You can change the port by using `npm start -- --port=8001`.
### Folder Structure
- **css/** Core styles without which the project does not function
- **js/** Like above but for JavaScript
- **plugin/** Components that have been developed as extensions to reveal.js