summaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md123
1 files changed, 112 insertions, 11 deletions
diff --git a/README.md b/README.md
index c521b90..fbd06fe 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).
@@ -58,6 +58,33 @@ You can write your content as a separate file and have reveal.js load it at runt
<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 is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
+
+```html
+<section data-markdown>
+ <script type="text/template">
+ - Item 1 {.class="fragment" data-fragment-index="2"}
+ - Item 2 {.class="fragment" data-fragment-index="1"}
+ </script>
+</section>
+```
+
+### Slide Attributes
+
+Special syntax is available for adding attributes to the slide `<section>` elements generated by your Markdown.
+
+```html
+<section data-markdown>
+ <script type="text/template">
+ <!-- slide-attributes: 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.
@@ -77,37 +104,63 @@ Reveal.initialize({
// 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"
+
});
```
@@ -192,6 +245,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:
@@ -292,6 +366,29 @@ 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).
+
+```javascript
+Reveal.initialize({
+
+ // 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" - currently only pixels are supported (don't use % or auto)
+
+ // This slide transition gives best results:
+ transition: linear
+
+});
+```
+
+Make sure that the background size is much bigger than screen size to allow for some scrolling.
+
+
+
### 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:
@@ -330,7 +427,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:
@@ -424,6 +521,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:
@@ -464,6 +563,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:
@@ -757,22 +857,22 @@ Some reveal.js features, like external markdown, require that presentations run
2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
4. Clone the reveal.js repository
-```
+```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
```
@@ -802,6 +902,7 @@ If you have personal support questions use [StackOverflow](http://stackoverflow.
- Single-quoted strings
- 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