aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md134
1 files changed, 111 insertions, 23 deletions
diff --git a/README.md b/README.md
index 6d78ae9..05c31fc 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ reveal.js comes with a broad range of features including [nested slides](https:/
- [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.
-## Slides
+## 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 [http://slid.es](http://slid.es).
@@ -54,10 +54,44 @@ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Iri
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.
+When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
+
+```html
+<section data-markdown="example.md"
+ data-separator="^\n\n\n"
+ data-vertical="^\n\n"
+ data-notes="^Note:"
+ data-charset="iso-8859-15">
+</section>
+```
+
+#### Element Attributes
+
+Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
+
```html
-<section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n" data-notes="^Note:" data-charset="iso-8859-15"></section>
+<section data-markdown>
+ <script type="text/template">
+ - Item 1 <!-- .element: class="fragment" data-fragment-index="2" -->
+ - Item 2 <!-- .element: class="fragment" data-fragment-index="1" -->
+ </script>
+</section>
```
+#### Slide Attributes
+
+Special syntax (in html comment) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
+
+```html
+<section data-markdown>
+ <script type="text/template">
+ <!-- .slide: data-background="#ff0000" -->
+ Mardown content
+ </script>
+</section>
+```
+
+
### 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.
@@ -71,52 +105,71 @@ Reveal.initialize({
// Display a presentation progress bar
progress: true,
+ // Display the page number of the current slide
+ slideNumber: false,
+
// Push each slide change to the browser history
history: false,
// Enable keyboard shortcuts for navigation
keyboard: true,
- // Enable touch events for navigation
- touch: true,
-
// Enable the slide overview mode
overview: true,
// Vertical centering of slides
center: true,
+ // Enables touch navigation on devices with touch input
+ touch: true,
+
// Loop the presentation
loop: false,
// Change the presentation direction to be RTL
rtl: false,
+ // Turns fragments on and off globally
+ fragments: true,
+
+ // Flags if the presentation is running in an embedded mode,
+ // i.e. contained within a limited portion of the screen
+ embedded: false,
+
// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
autoSlide: 0,
+ // Stop auto-sliding after user input
+ autoSlideStoppable: true,
+
// Enable slide navigation via mouse wheel
mouseWheel: false,
+ // Hides the address bar on mobile devices
+ hideAddressBar: true,
+
+ // Opens links in an iframe preview overlay
+ previewLinks: false,
+
// Transition style
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
// Transition speed
transitionSpeed: 'default', // default/fast/slow
- // Transition style for full page backgrounds
- backgroundTransition: 'default' // default/linear/none
+ // Transition style for full page slide backgrounds
+ backgroundTransition: 'default', // default/none/slide/concave/convex/zoom
+
+ // Number of slides away from the current that are visible
+ viewDistance: 3,
// Parallax background image
parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
// Parallax background size
- parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px"
-
- // Number of slides away from the current that are visible
- viewDistance: 3,
+ parallaxBackgroundSize: '' // CSS syntax, e.g. "2100px 900px"
});
@@ -202,6 +255,27 @@ Reveal.initialize({
});
```
+
+### Auto-sliding
+
+Presentations can be configure 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:
+
+```javascript
+// Slide every five seconds
+Reveal.configure({
+ autoSlide: 5000
+});
+```
+
+When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Sliding is also 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 by using the ```data-autoslide``` attribute on individual sections:
+
+```html
+<section data-autoslide="10000">This will remain on screen for 10 seconds</section>
+```
+
+
### Keyboard Bindings
If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
@@ -301,6 +375,7 @@ Slides are contained within a limited portion of the screen by default to allow
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 two following config properties when initializing reveal.js (the third one is optional).
@@ -320,7 +395,7 @@ Reveal.initialize({
});
```
-Make sure that the background size is much bigger than screen size to allow for some scrolling.
+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&parallaxBackgroundSize=2100px%20900px).
@@ -362,7 +437,7 @@ You can also add relative navigation links, similar to the built in reveal.js co
### 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://lab.hakim.se/reveal-js/#/16
+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
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:
@@ -372,6 +447,8 @@ The default fragment style is to start out invisible and fade in. This style can
<p class="fragment shrink">shrink</p>
<p class="fragment roll-in">roll-in</p>
<p class="fragment fade-out">fade-out</p>
+ <p class="fragment current-visible">visible only once</p>
+ <p class="fragment highlight-current-blue">blue only once</p>
<p class="fragment highlight-red">highlight-red</p>
<p class="fragment highlight-green">highlight-green</p>
<p class="fragment highlight-blue">highlight-blue</p>
@@ -429,6 +506,13 @@ By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/
</section>
```
+### Slide number
+If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value.
+
+```javascript
+Reveal.configure({ slideNumber: true });
+```
+
### Overview mode
@@ -456,6 +540,8 @@ Add `data-autoplay` to your media element if you want it to automatically start
<video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
```
+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.
+
### 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:
@@ -496,6 +582,7 @@ The framework comes with a few different themes included:
- night: Black background, thick white text, orange links
- serif: Cappuccino background, gray text, brown links
- simple: White background, black text, blue links
+- solarized: Cream-colored background, dark green text, blue links
Each theme is available as a separate stylesheet. To change theme you will need to replace **default** below with your desired theme name in index.html:
@@ -512,6 +599,8 @@ reveal.js comes with a speaker notes plugin which can be used to present per-sli
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.
+When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
+
```html
<section>
<h2>Some Slide</h2>
@@ -782,29 +871,29 @@ The core of reveal.js is very easy to install. You'll simply need to download a
### Full setup
-Some reveal.js features, like external markdown, 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.
+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.
1. Install [Node.js](http://nodejs.org/)
2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
4. Clone the reveal.js repository
-```
-$ git clone git@github.com:hakimel/reveal.js.git
+```sh
+$ git clone https://github.com/hakimel/reveal.js.git
```
5. Navigate to the reveal.js folder
-```
+```sh
$ cd reveal.js
```
6. Install dependencies
-```
+```sh
$ npm install
```
7. Serve the presentation and monitor source files for changes
-```
+```sh
$ grunt serve
```
@@ -822,20 +911,19 @@ You can change the port by using `grunt serve --port 8001`.
### Contributing
-Please keep the [issue tracker](github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. If you are reporting a bug make sure to include information about which browser and operating system you are using as well as the necessary steps to reproduce the issue.
+Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. If you are reporting a bug make sure to include information about which browser and operating system you are using as well as the necessary steps to reproduce the issue.
If you have personal support questions use [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js).
#### Pull requests
-- Should follow the coding style
+- Should follow the coding style of the file you work in, most importantly:
- Tabs to indent
- Single-quoted strings
- - No space between function name and opening argument parenthesis
- - One space after opening and before closing parenthesis
- Should be made towards the **dev branch**
- Should be submitted from a feature/topic branch (not your master)
+- Should not include the minified **reveal.min.js** file
## License