|
1 | 1 | == reveal.js Backend
|
2 | 2 |
|
| 3 | +//image:https://travis-ci.org/asciidoctor/asciidoctor-reveal.js.svg?branch=master[Build Status, link="https://travis-ci.org/asciidoctor/asciidoctor-reveal.js"] |
3 | 4 | The https://github.com/asciidoctor/asciidoctor-reveal.js/[reveal.js backend] is a slim template which transforms an AsciiDoc document to HTML5 slides animated by http://lab.hakim.se/reveal-js/[reveal.js].
|
4 | 5 |
|
5 |
| -=== Installation |
| 6 | +== Usage Instructions |
6 | 7 |
|
7 |
| -First, you should download (or git clone) the https://github.com/asciidoctor/asciidoctor-reveal.js/[asciidoctor-REVEAL.JS] repository to a convenient location. |
| 8 | +. Ensure Asciidoctor is installed |
8 | 9 |
|
9 |
| - git clone https://github.com/asciidoctor/asciidoctor-reveal.js |
| 10 | + $ gem install asciidoctor |
10 | 11 |
|
11 |
| -Then from your working directory (that is where your AsciiDoc document resides) you must create a +reveal.js+ directory and copy there the +reveal.js+ file with its directories (plugin, css, ...). |
12 |
| -You could also just clone the https://github.com/hakimel/reveal.js[reveal.js] repository. |
| 12 | +. Clone `asciidoctor/asciidoctor-reveal.js` to get templates for rendering presentation HTML. |
13 | 13 |
|
14 |
| - git clone git://github.com/hakimel/reveal.js.git |
| 14 | + $ git clone git://github.com/asciidoctor/asciidoctor-reveal.js.git |
15 | 15 |
|
16 |
| -=== Settings |
| 16 | +. Edit `CONTENT_FILE` ( *.adoc or *.ad or ...) |
| 17 | +** Slides & content per slide |
| 18 | +** [Optional] Set presentation "options" at top of `CONTENT_FILE`. The options available & their values will depend on presentation library (some examples below). |
17 | 19 |
|
18 |
| -There are some attributes that can be set at the top of the document which they are specific of +revealjs+ backend. |
| 20 | + ATTRIBUTE: ${value} |
19 | 21 |
|
20 |
| -[NOTE] |
21 |
| --- |
22 |
| -Default settings are based on `reveal.js` default settings. |
23 |
| --- |
| 22 | +. Generate HTML from Asciidoctor Template |
24 | 23 |
|
25 |
| -[options="header",cols="1m,1"] |
26 |
| -|=== |
27 |
| -|Attribute |Description |
28 |
| -|:revealjs_theme: <theme> | Chooses one of reveal.js' https://github.com/hakimel/reveal.js#theming[built-in themes]. |
29 |
| - Default: default |
30 |
| -|:revealjs_customtheme: <file\|URL> | Overrides CSS with given file or URL. Default is disabled. |
31 |
| -|:revealjs_controls: <true\|false> | Display controls in the bottom right corner. Default: true |
32 |
| -|:revealjs_progress: <true\|false> | Display a presentation progress bar. Default: true |
33 |
| -|:revealjs_slideNumber: <true\|false> | Display the page number of the current slide. Default: false |
34 |
| -|:revealjs_history: <true\|false> | Push each slide change to the browser history. Default: false |
35 |
| -|:revealjs_keyboard: <true\|false> | Enable keyboard shortcuts for navigation. Default: true |
36 |
| -|:revealjs_overview: <true\|false> | Enable the slide overview mode. Default: true |
37 |
| -|:revealjs_touch: <true\|false> | Enables touch navigation on devices with touch input. Default: true |
38 |
| -|:revealjs_center: <true\|false> | Vertical centering of slides. Default: true |
39 |
| -|:revealjs_loop: <true\|false> | Loop the presentation. Default: false |
40 |
| -|:revealjs_rtl: <true\|false> | Change the presentation direction to be RTL. Default: false |
41 |
| -|:revealjs_fragments: <true\|false> | Turns fragments on and off globally. Default: true |
42 |
| -|:revealjs_embedded: <true\|false> | Flags if the presentation is running in an embedded mode, |
43 |
| - i.e. contained within a limited portion of the screen. Default: false |
44 |
| -|:revealjs_autoSlide: <integer> | Number of milliseconds between automatically proceeding to the |
45 |
| - next slide, disabled when set to 0, this value can be overwritten |
46 |
| - by using a data-autoslide attribute on your slides. Default 0 |
47 |
| -|:revealjs_autoSlideStoppable: <true\|false> | Stop auto-sliding after user input. Default: true |
48 |
| -|:revealjs_mouseWheel: <true\|false> | Enable slide navigation via mouse wheel. Default: false |
49 |
| -|:revealjs_hideAddressBar: <true\|false> | Hides the address bar on mobile devices. Default: true |
50 |
| -|:revealjs_previewLinks: <true\|false> | Opens links in an iframe preview overlay. Default: false |
51 |
| -|:revealjs_transition: <transition> | Transition style. |
52 |
| - Valid values: default/cube/page/concave/zoom/linear/fade/none |
53 |
| -|:revealjs_transitionSpeed: <speed> | Transition speed. Valid values: default/fast/slow |
54 |
| -|:revealjs_backgroundTransition: <transition>| Transition style for full page slide backgrounds. |
55 |
| - Valid values: default/none/slide/concave/convex/zoom |
56 |
| -|:revealjs_viewDistance: <integer> | Number of slides away from the current that are visible. Default: 3 |
57 |
| -|:revealjs_parallaxBackgroundImage: <file\|URL> | Parallax background image. Defaults to none |
58 |
| -|:revealjs_parallaxBackgroundSize: <CSS size syntax>| Parallax background size (accepts any CSS syntax). Defaults to none |
| 24 | +** Command Line: |
59 | 25 |
|
60 |
| -|=== |
| 26 | + $ asciidoctor -T templates/slim ${options} CONTENT_FILE |
61 | 27 |
|
62 |
| -If you want to build a custom theme or customize an existing one you should look at `reveal.js's` documentation and use `revealjs_theme` attribute: https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md |
| 28 | +** Build Script: use Ruby, JavaScript, Gradle, or your favorite build tool/script with presentation options |
| 29 | +. Copy or clone presentation library (to output destination/branch) |
| 30 | + |
| 31 | + $ git clone git://github.com/hakimel/reveal.js.git |
63 | 32 |
|
64 |
| -=== Examples |
| 33 | +TIP: if leveraging https://pages.github.com/[GitHub Pages], plan ahead by keeping your source files on `master` branch and all output files on `gh-pages` branch. |
| 34 | + |
| 35 | +== Source Examples |
65 | 36 |
|
66 | 37 | // FIXME: incomplete
|
67 | 38 |
|
@@ -182,16 +153,123 @@ Here is https://github.com/hakimel/reveal.js#markup[upstream documentation] on t
|
182 | 153 |
|
183 | 154 | NOTE: The `reveal.js` backend only supports level 1 (`==`) and level 2 (`===`) sections. Level 3 sections are not supported and will not render correctly.
|
184 | 155 |
|
185 |
| -=== Rendering |
| 156 | +== reveal.js Options |
| 157 | + |
| 158 | +There are some attributes that can be set at the top of the document which they are specific of +revealjs+ backend. |
| 159 | + |
| 160 | +[NOTE] |
| 161 | +-- |
| 162 | +Default settings are based on `reveal.js` default settings. |
| 163 | +-- |
| 164 | + |
| 165 | +[options="header",cols="1m,1,2"] |
| 166 | +|=== |
| 167 | +|Attribute |Value(s) |Description |
| 168 | + |
| 169 | +|:revealjs_theme: |
| 170 | +|*default*, beige, sky, night, serif, simple, solarized |
| 171 | +|Chooses one of reveal.js' https://github.com/hakimel/reveal.js#theming[built-in themes]. |
| 172 | + |
| 173 | +|:revealjs_customtheme: |
| 174 | +|<file\|URL> |
| 175 | +| Overrides CSS with given file or URL. Default is disabled. |
186 | 176 |
|
187 |
| -First, make sure Asciidoctor is installed: |
| 177 | +|:revealjs_controls: |
| 178 | +|*true*, false |
| 179 | +|Display controls in the bottom right corner. |
188 | 180 |
|
189 |
| - gem install asciidoctor |
| 181 | +|:revealjs_progress: |
| 182 | +|*true*, false |
| 183 | +|Display a presentation progress bar. |
190 | 184 |
|
191 |
| -Then, to render your presentation as HTML5, simply execute the command: |
| 185 | +|:revealjs_slideNumber: |
| 186 | +|true, *false* |
| 187 | +|Display the page number of the current slide. |
192 | 188 |
|
193 |
| - asciidoctor -T <backend directory> <asciidoc file> |
| 189 | +|:revealjs_history: |
| 190 | +|true, *false* |
| 191 | +|Push each slide change to the browser history. |
194 | 192 |
|
195 |
| -So for the above revealjs backend you'd use |
| 193 | +|:revealjs_keyboard: |
| 194 | +|*true*, false |
| 195 | +|Enable keyboard shortcuts for navigation. |
196 | 196 |
|
197 |
| - asciidoctor -T <base>/asciidoctor-reveal.js/template/slim <asciidoc file> |
| 197 | +|:revealjs_overview: |
| 198 | +|*true*, false |
| 199 | +|Enable the slide overview mode. |
| 200 | + |
| 201 | +|:revealjs_touch: |
| 202 | +|*true*, false |
| 203 | +|Enables touch navigation on devices with touch input. |
| 204 | + |
| 205 | +|:revealjs_center: |
| 206 | +|*true*, false |
| 207 | +|Vertical centering of slides. |
| 208 | + |
| 209 | +|:revealjs_loop: |
| 210 | +|true, *false* |
| 211 | +|Loop the presentation. |
| 212 | + |
| 213 | +|:revealjs_rtl: |
| 214 | +|true, *false* |
| 215 | +|Change the presentation direction to be RTL. |
| 216 | + |
| 217 | +|:revealjs_fragments: |
| 218 | +|*true*, false |
| 219 | +|Turns fragments on and off globally. |
| 220 | + |
| 221 | +|:revealjs_embedded: |
| 222 | +|true, *false* |
| 223 | +|Flags if the presentation is running in an embedded mode, |
| 224 | +i.e. contained within a limited portion of the screen. |
| 225 | + |
| 226 | +|:revealjs_autoSlide: |
| 227 | +|<integer> |
| 228 | +| Delay in milliseconds between automatically proceeding to the |
| 229 | +next slide. + |
| 230 | +Disabled when set to *0* (the default). + |
| 231 | +This value can be overwritten by using a `data-autoslide` attribute on your slides. |
| 232 | + |
| 233 | +|:revealjs_autoSlideStoppable: |
| 234 | +|*true*, false |
| 235 | +|Stop auto-sliding after user input. |
| 236 | + |
| 237 | +|:revealjs_mouseWheel: |
| 238 | +|true, *false* |
| 239 | +|Enable slide navigation via mouse wheel. |
| 240 | + |
| 241 | +|:revealjs_hideAddressBar: |
| 242 | +|*true*, false |
| 243 | +|Hides the address bar on mobile devices. |
| 244 | + |
| 245 | +|:revealjs_previewLinks: |
| 246 | +|true, *false* |
| 247 | +|Opens links in an iframe preview overlay. |
| 248 | + |
| 249 | +|:revealjs_transition: |
| 250 | +|*default*, cube, page, concave, zoom, linear, fade, none |
| 251 | +|Transition style. |
| 252 | + |
| 253 | +|:revealjs_transitionSpeed: |
| 254 | +|*default*, fast, slow |
| 255 | +|Transition speed. |
| 256 | + |
| 257 | +|:revealjs_backgroundTransition: |
| 258 | +|*default*, none, slide, concave, convex, zoom |
| 259 | +| Transition style for full page slide backgrounds. |
| 260 | + |
| 261 | +|:revealjs_viewDistance: |
| 262 | +|<integer> |
| 263 | +|Number of slides away from the current that are visible. Default: 3 |
| 264 | + |
| 265 | +|:revealjs_parallaxBackgroundImage: |
| 266 | +|<file\|URL> |
| 267 | +|Parallax background image. Defaults to none |
| 268 | + |
| 269 | +|:revealjs_parallaxBackgroundSize: |
| 270 | +|<CSS size syntax> |
| 271 | +|Parallax background size (accepts any CSS syntax). Defaults to none |
| 272 | + |
| 273 | +|=== |
| 274 | + |
| 275 | +If you want to build a custom theme or customize an existing one you should look at `reveal.js's` documentation and use `revealjs_theme` attribute: https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md |
0 commit comments