asciidoctor-revealjs 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +40 -9
  3. data/Gemfile +4 -0
  4. data/HACKING.adoc +104 -39
  5. data/LICENSE.adoc +1 -1
  6. data/README.adoc +57 -27
  7. data/Rakefile +114 -0
  8. data/asciidoctor-revealjs.gemspec +13 -4
  9. data/examples/README.adoc +17 -0
  10. data/examples/admonitions-icons.adoc +37 -0
  11. data/examples/admonitions.adoc +38 -0
  12. data/examples/concealed-slide-titles.adoc +20 -0
  13. data/examples/customcss.adoc +9 -0
  14. data/examples/customcss.css +8 -0
  15. data/examples/data-background-newstyle.adoc +63 -0
  16. data/examples/data-background-oldstyle.adoc +44 -0
  17. data/examples/history-regression-tests.adoc +34 -0
  18. data/examples/history.adoc +19 -0
  19. data/examples/images.adoc +19 -0
  20. data/examples/images/70s.jpg +0 -0
  21. data/examples/images/bio.jpg +0 -0
  22. data/examples/images/cover.jpg +0 -0
  23. data/examples/images/meme-2.jpg +0 -0
  24. data/examples/images/meme-7.png +0 -0
  25. data/examples/images/web_surfing_time.gif +0 -0
  26. data/examples/keyboard-shortcuts.adoc +24 -0
  27. data/examples/level-sections.adoc +44 -0
  28. data/examples/multi-destination-content.adoc +66 -0
  29. data/examples/revealjs-stretch.adoc +22 -0
  30. data/examples/slide-state.adoc +18 -0
  31. data/examples/slide-state.css +6 -0
  32. data/examples/source-callouts.adoc +20 -0
  33. data/examples/speaker-notes.adoc +21 -0
  34. data/examples/theme-custom.adoc +33 -0
  35. data/examples/theme-custom.css +33 -0
  36. data/examples/title-preamble.adoc +10 -0
  37. data/examples/title-slide-color.adoc +10 -0
  38. data/examples/title-slide-image.adoc +13 -0
  39. data/examples/title-slide-video.adoc +13 -0
  40. data/examples/title-subtitle-partitioning.adoc +7 -0
  41. data/examples/transitions.adoc +20 -0
  42. data/examples/vertical-slides.adoc +24 -0
  43. data/examples/video.adoc +32 -0
  44. data/lib/asciidoctor-revealjs.rb +1 -1
  45. data/lib/asciidoctor-revealjs/version.rb +1 -1
  46. data/lib/asciidoctor-templates-compiler.rb +11 -0
  47. data/templates/{slim/block_admonition.html.slim → admonition.html.slim} +2 -2
  48. data/templates/{slim/block_audio.html.slim → audio.html.slim} +0 -0
  49. data/templates/{slim/block_colist.html.slim → colist.html.slim} +0 -0
  50. data/templates/{slim/block_dlist.html.slim → dlist.html.slim} +0 -0
  51. data/templates/{slim/document.html.slim → document.html.slim} +25 -5
  52. data/templates/{slim/embedded.html.slim → embedded.html.slim} +0 -0
  53. data/templates/{slim/block_example.html.slim → example.html.slim} +0 -0
  54. data/templates/floating_title.html.slim +2 -0
  55. data/templates/helpers.rb +99 -0
  56. data/templates/{slim/block_image.html.slim → image.html.slim} +1 -1
  57. data/templates/{slim/inline_anchor.html.slim → inline_anchor.html.slim} +0 -0
  58. data/templates/{slim/inline_break.html.slim → inline_break.html.slim} +0 -0
  59. data/templates/{slim/inline_button.html.slim → inline_button.html.slim} +0 -0
  60. data/templates/{slim/inline_callout.html.slim → inline_callout.html.slim} +0 -0
  61. data/templates/{slim/inline_footnote.html.slim → inline_footnote.html.slim} +0 -0
  62. data/templates/{slim/inline_image.html.slim → inline_image.html.slim} +0 -0
  63. data/templates/{slim/inline_indexterm.html.slim → inline_indexterm.html.slim} +0 -0
  64. data/templates/{slim/inline_kbd.html.slim → inline_kbd.html.slim} +0 -0
  65. data/templates/{slim/inline_menu.html.slim → inline_menu.html.slim} +0 -0
  66. data/templates/{slim/inline_quoted.html.slim → inline_quoted.html.slim} +0 -0
  67. data/templates/{slim/block_listing.html.slim → listing.html.slim} +1 -1
  68. data/templates/{slim/block_literal.html.slim → literal.html.slim} +0 -0
  69. data/templates/{slim/block_olist.html.slim → olist.html.slim} +0 -0
  70. data/templates/{slim/block_open.html.slim → open.html.slim} +0 -0
  71. data/templates/outline.html.slim +9 -0
  72. data/templates/{slim/block_page_break.html.slim → page_break.html.slim} +0 -0
  73. data/templates/{slim/block_paragraph.html.slim → paragraph.html.slim} +0 -0
  74. data/templates/{slim/block_pass.html.slim → pass.html.slim} +0 -0
  75. data/templates/{slim/block_preamble.html.slim → preamble.html.slim} +0 -0
  76. data/templates/{slim/block_quote.html.slim → quote.html.slim} +0 -0
  77. data/templates/{jade/ruler.jade → ruler.html.slim} +0 -0
  78. data/templates/{slim/section.html.slim → section.html.slim} +8 -5
  79. data/templates/{slim/block_sidebar.html.slim → sidebar.html.slim} +0 -0
  80. data/templates/{slim/block_stem.html.slim → stem.html.slim} +0 -0
  81. data/templates/{slim/block_table.html.slim → table.html.slim} +5 -3
  82. data/templates/{jade/thematic_break.jade → thematic_break.html.slim} +0 -0
  83. data/templates/toc.html.slim +17 -0
  84. data/templates/{slim/block_ulist.html.slim → ulist.html.slim} +0 -0
  85. data/templates/{slim/block_verse.html.slim → verse.html.slim} +0 -0
  86. data/templates/{slim/block_video.html.slim → video.html.slim} +0 -0
  87. metadata +179 -89
  88. data/lib/asciidoctor-revealjs/converter.rb +0 -38
  89. data/templates/jade/admonition.jade +0 -17
  90. data/templates/jade/audio.jade +0 -6
  91. data/templates/jade/colist.jade +0 -22
  92. data/templates/jade/dlist.jade +0 -60
  93. data/templates/jade/document.jade +0 -103
  94. data/templates/jade/embedded.jade +0 -11
  95. data/templates/jade/example.jade +0 -4
  96. data/templates/jade/floating_title.jade +0 -2
  97. data/templates/jade/image.jade +0 -12
  98. data/templates/jade/inline_anchor.jade +0 -9
  99. data/templates/jade/inline_break.jade +0 -2
  100. data/templates/jade/inline_button.jade +0 -1
  101. data/templates/jade/inline_callout.jade +0 -9
  102. data/templates/jade/inline_image.jade +0 -24
  103. data/templates/jade/inline_indexterm.jade +0 -2
  104. data/templates/jade/inline_kbd.jade +0 -9
  105. data/templates/jade/inline_quoted.jade +0 -26
  106. data/templates/jade/listing.jade +0 -29
  107. data/templates/jade/literal.jade +0 -5
  108. data/templates/jade/olist.jade +0 -9
  109. data/templates/jade/page_break.jade +0 -1
  110. data/templates/jade/paragraph.jade +0 -7
  111. data/templates/jade/pass.jade +0 -1
  112. data/templates/jade/quote.jade +0 -11
  113. data/templates/jade/section.jade +0 -15
  114. data/templates/jade/sidebar.jade +0 -5
  115. data/templates/jade/table.jade +0 -45
  116. data/templates/jade/ulist.jade +0 -25
  117. data/templates/jade/verse.jade +0 -14
  118. data/templates/jade/video.jade +0 -30
  119. data/templates/slim/block_floating_title.html.slim +0 -1
  120. data/templates/slim/block_ruler.html.slim +0 -1
  121. data/templates/slim/block_thematic_break.html.slim +0 -1
  122. data/templates/slim/block_toc.html.slim +0 -12
  123. data/templates/slim/helpers.rb +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 055ddf04cfd1adacd71a163e674cbb6fa2171506
4
- data.tar.gz: beac41015126c16206cd999af5173ccc6fe1be19
3
+ metadata.gz: 59739308d6f926a43ca556691f89c0c06cd59ab9
4
+ data.tar.gz: d410a0166013bfa61371c43e82e9b2f37a637b62
5
5
  SHA512:
6
- metadata.gz: 3ef70eb8103ebceff21ed91c8a4a1816cf5fcaf110a29b706a9fdde87161a09cbcfdca31a6c07a29543f0f10c8b7f87c2c00f12e95e0400e7a0c72a3b44ecd55
7
- data.tar.gz: bbb86e656baa1ecb60f9197723e67012c50f6feec54b5280c1e9640079c8b9dd3acf25c850339f1746fe9d1e569e5d544dc2df84e0607445d189db91b7dcb126
6
+ metadata.gz: bfbb7fa08fe665d55fe51f8594b4472c2831e7187474292755336bd85dff269b6c532b82bb905ce23e66b9c526aa550c2acecba529d16b2ae3fe44841aa30a24
7
+ data.tar.gz: 7ecb489607db5f527ae2fa1f60ed1ae4edb2104581a33d6cb1151906d9f134622af48917a83b1e71795611b4a2c4bbbbee3e9467148b51cfeba87a26ad8e5808
data/CHANGELOG.adoc CHANGED
@@ -6,21 +6,52 @@
6
6
  This document provides a high-level view of the changes introduced in {project-name} by release.
7
7
  For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
8
8
 
9
- == 1.0.4 (2017-09-27) - @obilodeau
9
+ == 1.1.0 (2017-12-25) - @obilodeau
10
10
 
11
- Bug fixes::
12
- * Dependency problems leading to crashes when used from Asciidoctor.js ({uri-issue}145[#145])
13
-
14
- ////
15
11
  Enhancements::
16
- * item
12
+ * Support for Reveal.JS 3.5.0+ ({uri-issue}146[#146], {uri-issue}151[#151])
13
+ * Support for Asciidoctor 1.5.6 ({uri-issue}132[#132], {uri-issue}136[#136], {uri-issue}142[#142])
14
+ * Support for Asciidoctor.js 1.5.6-preview.4 ({uri-issue}130[#130], {uri-issue}143[#143], {uri-issue}156[#156])
15
+ * Compiling slim templates to Ruby allows us to drop Jade templates for Asciidoctor.js users
16
+ ({uri-issue}63[#63], {uri-issue}131[#131])
17
+ * Documentation polish ({uri-issue}153[#153], {uri-issue}158[#158] and more)
17
18
 
18
19
  Compliance::
19
- * item
20
+ * Users of Asciidoctor (Ruby) and Asciidoctor.js (Javascript) now run the same set of templates meaning that we achieved feature parity between the two implementations
21
+ ({uri-issue}63[#63], {uri-issue}131[#131])
22
+
23
+ Bug fixes::
24
+ * Reveal.js https://github.com/hakimel/reveal.js/#configuration[history feature] now works.
25
+ We are working around Reveal.js' section id character limits.
26
+ ({uri-issue}127[#127], {uri-issue}150[#150], https://github.com/hakimel/reveal.js/issues/1346[hakimel/reveal.js#1346])
20
27
 
21
28
  Infrastructure::
22
- * item
23
- ////
29
+ * https://github.com/asciidoctor/asciidoctor-doctest[Asciidoctor-doctest] integration.
30
+ This layer of automated testing should help prevent regressions and improve our development process.
31
+ ({uri-issue}92[#92], {uri-issue}116[#116])
32
+ * Travis-CI integration to automatically run doctests and examples AsciiDoc conversions
33
+ * Travis-CI tests are triggered by changes done in Asciidoctor.
34
+ We will detect upstream changes affecting us sooner.
35
+ * Smoke tests for our Javascript / Node / Asciidoctor.js toolchain (integrated in Travis-CI also)
36
+ * `npm run examples` will convert all examples using the Javascript / Node / Asciidoctor.js toolchain ({uri-issue}149[#149])
37
+ * `rake examples:serve` will run a Web server from `examples/` so you can preview rendered examples ({uri-issue}154[#154])
38
+
39
+ === Release meta
40
+
41
+ {uri-repo}/releases/tag/v1.1.0[git tag] |
42
+ {uri-repo}/compare/v1.0.4...v1.1.0[full diff]
43
+
44
+ === Credits
45
+
46
+ Thanks to the following people who contributed to this release:
47
+
48
+ @jirutka, Dan Allen, Guillaume Grossetie, Jacob Aae Mikkelsen, Olivier Bilodeau, Rahul Somasunderam
49
+
50
+
51
+ == 1.0.4 (2017-09-27) - @obilodeau
52
+
53
+ Bug fixes::
54
+ * Dependency problems leading to crashes when used from Asciidoctor.js ({uri-issue}145[#145])
24
55
 
25
56
  === Release meta
26
57
 
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in asciidoctor-revealjs.gemspec
4
+ gemspec
data/HACKING.adoc CHANGED
@@ -6,7 +6,6 @@ Short instructions that aim to help potential contributors.
6
6
 
7
7
  == Inspect the template system
8
8
 
9
-
10
9
  To understand what you have access to in templates you can inject some ruby.
11
10
  With the slim templating system, this is done by prepending the lines with a dash (`-`) and inserting a ruby statement.
12
11
  Two complementary approaches can be used to explore the context offered by asciidoctor through the template system:
@@ -14,6 +13,16 @@ Two complementary approaches can be used to explore the context offered by ascii
14
13
  * logging on the command line via print-like statements
15
14
  * jump into the context through an interactive debugger
16
15
 
16
+ [NOTE]
17
+ --
18
+ Starting with v1.1.0 the slim templates are compiled to Ruby in order to
19
+ use the same templates from Asciidoctor.js (Javascript / Node.js ecosystem).
20
+ Don't forget to recompile the templates if you make changes to them.
21
+ This can be done by running:
22
+
23
+ bundle exec rake build
24
+ --
25
+
17
26
  === Print debugging information
18
27
 
19
28
  For example to see which attributes are available, you can print them by adding these lines in the `.slim` file of interest:
@@ -45,7 +54,7 @@ It is very useful to discover a complex object hierarchy like what asciidoctor o
45
54
 
46
55
  ==== Initial Setup
47
56
 
48
- gem install pry
57
+ bundle --path=.bundle/gems --binstubs=.bundle/.bin
49
58
 
50
59
  ==== Usage
51
60
 
@@ -56,11 +65,10 @@ In order to be dropped into the debugger at a specific point in a template simpl
56
65
  - binding.pry
57
66
  ----
58
67
 
59
- Then run asciidoctor from the command-line to generate your document and you'll be dropped in the debugger:
68
+ Then run `asciidoctor-revealjs` from the command-line to generate your document and you'll be dropped in the debugger:
60
69
 
61
70
  ----
62
- $ make
63
- asciidoctor -T templates/slim -b revealjs test/level-sections.adoc
71
+ $ bundle exec asciidoctor-revealjs examples/video.adoc
64
72
  asciidoctor: WARNING: level-sections.adoc: line 29: section title out of sequence: expected level 2, got level 3
65
73
 
66
74
  From: /home/olivier/src/asciidoc/asciidoctor-reveal.js/templates/slim/section.html.slim @ line 3 :
@@ -85,16 +93,27 @@ You can also query asciidoctor's documentation:
85
93
 
86
94
  [4] pry(#<Asciidoctor::Section>)> ? find_by
87
95
 
96
+ If you install the `pry-byebug` gem you get additional debugging capabilities.
97
+ See the gem's documentation for details.
98
+
99
+ Since 1.1.0, templates are compiled. It is easier to inject the debug
100
+ triggering statements and use the templates directly instead of debugging
101
+ compiled templates. You can call the slim templates directly with:
102
+
103
+ // TODO it's still not clear whether `-r slim-htag` is required right now (#153)
104
+
105
+ bundle exec asciidoctor --trace -T templates/ examples/customcss.adoc
106
+
88
107
  === References
89
108
 
90
109
  * https://github.com/asciidoctor/asciidoctor.org/issues/80#issuecomment-145698579
91
110
  * http://pryrepl.org/
92
111
  * http://discuss.asciidoctor.org/Interactively-debugging-a-template-with-a-REPL-td4498.html
93
112
 
94
- == Tests
113
+ == Manual Tests
95
114
 
96
115
  In order to help troubleshoot issues and test syntax improvements, some minimalist asciidoc test files are provided.
97
- You can render the tests files and then load them in a browser and check if `asciidoctor-reveal.js` behaves as expected.
116
+ You can render the tests files and then load them in a browser and check if `asciidoctor-revealjs` behaves as expected.
98
117
 
99
118
  === Initial Setup
100
119
 
@@ -103,42 +122,29 @@ done with `bundler`:
103
122
 
104
123
  bundle config --local github.https true
105
124
  bundle --path=.bundle/gems --binstubs=.bundle/.bin
125
+ bundle exec rake build
106
126
 
107
- Go to `test/` folder and install `reveal.js`:
127
+ Go to `test/output/slim/` folder and install `reveal.js`:
108
128
 
109
- cd test/
129
+ cd test/output/slim/
110
130
  git clone https://github.com/hakimel/reveal.js.git
111
131
 
112
132
  === Render tests into .html
113
133
 
114
134
  From the project's root directory:
115
135
 
116
- make
136
+ bundle exec rake generate FORCE=yes
117
137
 
118
138
  === Open rendered files
119
139
 
120
- You can open the generated `.html` in a Web browser.
121
- For convenience the following command will open the last modified file:
122
-
123
- make open
124
-
125
- Additionally, if you want to test with a minimalist web server:
126
-
127
- make serve
128
-
129
- The server is running in the foreground and needs `Ctrl-C` to be killed.
140
+ NOTE: Right now, https://github.com/asciidoctor/asciidoctor-doctest/issues/12[doctest issue #12] means that the generated examples will not be pretty.
130
141
 
131
- == Jade templates
142
+ You can open the generated `.html` in `test/output/slim/` in a Web browser.
132
143
 
133
- Jade templates are used by AsciidocFX. Since they are separate they might be
134
- out of sync with our asciidoctor's slim templates.
135
144
 
136
- To test the jade templates, install AsciidocFX and copy the jade templates
137
- over to AsciidocFX's `conf/slide/templates/revealjs/` directory. Then use
138
- AsciidocFX to render the slides.
145
+ == Asciidoctor API's gotchas
139
146
 
140
-
141
- == Attribute inheritence
147
+ === Attribute inheritence
142
148
 
143
149
  The attr and attr? methods inherit by default. That means if they don't find the attribute defined on the node, they look on the document.
144
150
 
@@ -199,30 +205,55 @@ You can apply that label to a pull request that is complete and ready for review
199
205
 
200
206
  Makes triaging easier.
201
207
 
202
-
203
208
  == Node package
204
209
 
205
210
  === Test a local asciidoctor-reveal.js version
206
211
 
207
- In order to test the Node package, you need to create a test project adjacent to the clone of the `asciidoctor-reveal.js` repository:
212
+ In order to test the Node package, you first need to build the converter into Javascript and create a tarball of the project.
213
+
214
+ $ bundle exec rake build:converter:opal
215
+ $ npm run build
216
+ $ npm pack
217
+
218
+ That last command will produce a file named `asciidoctor-reveal.js-<version>.tgz` in the working directory.
219
+
220
+ Then, create a test project adjacent to the clone of the [.path]_asciidoctor-reveal.js_ repository:
208
221
 
209
222
  $ mkdir test-project
210
223
  $ cd test-project
211
224
 
212
- Now, install the dependencies.
225
+ Now, install the dependencies from the tarball:
226
+
227
+ $ npm i --save ../asciidoctor-reveal.js/asciidoctor-reveal.js-<version>.tgz
228
+
229
+ NOTE: The relative portion of the last command is where you are installing the local `asciidoctor-reveal.js` version from.
230
+
231
+ Then proceed as documented in the `README.adoc`.
232
+
233
+ === Upgrade Asciidoctor.js version
213
234
 
214
- WARNING: It is important to track `Asciidoctor.js`, `Asciidoctor-template.js` and `bestikk-opal-compiler` versions all together.
235
+ WARNING: It is important to track `Asciidoctor.js` and `bestikk-opal-compiler` versions together.
215
236
  The `opal-compiler` used to compile our node package must match `asciidoctor.js` `opal-runtime`.
216
- The first one is explicitly installed by users on install and the two later are specified in our `package.json`.
217
- When you update one remember to update the others.
237
+ The former is explicitly installed by users on install and the later is specified in our `package.json`.
238
+ When you update one remember to update the other.
218
239
  Versions known to work together can be found here, just replace <tag> with the `asciidoctor.js` release you are interested in: https://github.com/asciidoctor/asciidoctor.js/blob/<tag>/package.json
219
240
 
220
- $ npm i --save asciidoctor.js@1.5.5-5
221
- $ npm i --save ../asciidoctor-reveal.js
241
+ == RubyGem package
222
242
 
223
- NOTE: The relative portion of the last command is where you are installing the local `asciidoctor-reveal.js` version from.
243
+ === Test a local asciidoctor-revealjs version
224
244
 
225
- Then proceed as documented in the `README.adoc`.
245
+ Compile the converter:
246
+
247
+ $ bundle exec rake build
248
+
249
+ In a clean directory besides the `asciidoctor-reveal.js` repository, create the following `Gemspec` file:
250
+
251
+ source 'https://rubygems.org'
252
+ gem 'asciidoctor-revealjs', :path => '../asciidoctor-reveal.js'
253
+
254
+ Then run:
255
+
256
+ $ bundle --path=.bundle/gems --binstubs=.bundle/.bin
226
257
 
227
258
 
228
259
  == Release process
@@ -242,20 +273,54 @@ Then proceed as documented in the `README.adoc`.
242
273
  . Make a release on github (from changelog and copy from previous releases)
243
274
  . Pushing the gem on rubygems.org:
244
275
  +
276
+ $ bundle exec rake build
245
277
  $ gem build asciidoctor-revealjs.gemspec
246
278
  $ gem push asciidoctor-revealjs-X.Y.Z.gem
247
279
 
248
280
  . Check that the new version is available on https://rubygems.org/gems/asciidoctor-revealjs[rubygems.org]
281
+ . Generate a compatible version of the Ruby converter (using opal mode)
282
+ +
283
+ $ bundle exec rake build:converter:opal
284
+
249
285
  . Build the node package (make sure you have `devDependencies` installed with: `npm install`):
250
286
  +
251
287
  $ npm run build
252
288
 
253
289
  . Publish the node package on npm:
254
290
  +
255
- $ npm login
291
+ $ npm login # only required if not already authenticated
256
292
  $ npm publish
257
293
 
258
294
  . Check that the new version is available on https://www.npmjs.com/package/asciidoctor-reveal.js[npmjs.com]
259
295
  . Update version in `lib/asciidoctor-revealjs/version.rb` and `package.json` (+1 bugfix and append '-dev') and commit
260
296
  ** commit msg: Begin development on next release
297
+ . Submit a PR upstream to sync the documentation on asciidoctor.org
298
+ ** Modify this page: https://github.com/asciidoctor/asciidoctor.org/edit/master/docs/asciidoctor-revealjs.adoc
299
+
300
+ == Ruby and asciidoctor-doctest tests
301
+
302
+ === Running tests
303
+
304
+ We recommend tests to be run with a fresh install of all dependencies in a local folder that won't affect your ruby install (a `.bundle/` in this directory):
305
+
306
+ bundle --path=.bundle/gems --binstubs=.bundle/.bin
307
+
308
+ Then you can execute the tests with:
309
+
310
+ bundle exec rake doctest
311
+
312
+ However, if you have all dependencies properly installed this command should run the tests successfully:
313
+
314
+ rake doctest
315
+
316
+ === Generating HTML test target
317
+
318
+ Tests were bootstrapped by https://github.com/asciidoctor/asciidoctor-doctest/#generate-examples[generating them from asciidoctor-doctest's test corpus] and current asciidoctor-revealjs' slim template engine.
319
+ This is done using the following command:
320
+
321
+ bundle exec rake doctest:generate FORCE=y
322
+
323
+ === Custom tests
261
324
 
325
+ Files in the `examples/` directory are used as tests.
326
+ Resulting slides are kept in `test/doctest/`.
data/LICENSE.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  .The MIT License
2
2
  ....
3
- Copyright (C) 2012-2016 Olivier Bilodeau, Charles Moulliard, Dan Allen and the Asciidoctor Project
3
+ Copyright (C) 2012-2017 Olivier Bilodeau, Charles Moulliard, Dan Allen and the Asciidoctor Project
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.adoc CHANGED
@@ -5,6 +5,7 @@ ifdef::env-github,env-browser[]
5
5
  :toclevels: 2
6
6
  endif::[]
7
7
  ifdef::env-github[]
8
+ :branch: master
8
9
  :status:
9
10
  :outfilesuffix: .adoc
10
11
  :!toc-title:
@@ -22,6 +23,7 @@ endif::[]
22
23
  :uri-nodejs-download: https://nodejs.org/en/download/
23
24
 
24
25
  ifdef::env-github[]
26
+ image:https://travis-ci.org/asciidoctor/asciidoctor-reveal.js.svg?branch=master[Build Status,link=https://travis-ci.org/asciidoctor/asciidoctor-reveal.js]
25
27
  image:http://img.shields.io/gem/v/asciidoctor-revealjs.svg[gem, link=https://rubygems.org/gems/asciidoctor-revealjs]
26
28
  image:http://img.shields.io/npm/v/asciidoctor-reveal.js.svg[npm, link=https://www.npmjs.org/package/asciidoctor-reveal.js]
27
29
  endif::[]
@@ -29,14 +31,21 @@ endif::[]
29
31
  // IMPORTANT: Changes made to this description should be sync'ed with the readme field in package.json.
30
32
  {uri-project-repo}[Asciidoctor reveal.js] is a converter for {uri-asciidoctor}[Asciidoctor] and {uri-asciidoctorjs}[Asciidoctor.js] that transforms an AsciiDoc document into an HTML5 presentation designed to be executed by the {uri-revealjs-home}[reveal.js] presentation framework.
31
33
 
32
- //image:https://travis-ci.org/asciidoctor/asciidoctor-reveal.js.svg?branch=master[Build Status,link=https://travis-ci.org/asciidoctor/asciidoctor-reveal.js]
33
34
 
34
35
  There are two main technology stacks that can transform AsciiDoc into HTML5 / reveal.js:
35
36
 
36
- * Asciidoctor / Ruby / Slim / Bundler (See <<Ruby Setup>>)
37
- * Asciidoctor.js / JavaScript / Jade / Node.js (See <<Node / JavaScript Setup>>)
37
+ * Asciidoctor / Ruby / Bundler (See <<Ruby Setup>>)
38
+ * Asciidoctor.js / JavaScript (Node.js) / NPM (See <<Node / JavaScript Setup>>)
38
39
 
39
- Right now the Ruby / Slim templates are more featureful but that is changing quickly.
40
+ Right now the Asciidoctor / Ruby stack is the better tested one but with the changes in v1.1.0 they have feature parity.
41
+
42
+ ifeval::['{branch}' == 'master']
43
+ NOTE: You're viewing the documentation for the upcoming release.
44
+ If you're looking for the documentation for an older release, please refer to one of the following branches: +
45
+ {uri-project-repo}/tree/maint-1.0.x#readme[1.0.x]
46
+ &hybull;
47
+ {uri-project-repo}/tree/reveal.js-2.x#readme[Unversioned pre-release] (compatible with RevealJS 2.x)
48
+ endif::[]
40
49
 
41
50
 
42
51
  == Ruby Setup
@@ -48,8 +57,6 @@ For a quick start clone our https://github.com/obilodeau/presentation-revealjs-s
48
57
 
49
58
  For more complete instructions, read on.
50
59
 
51
- NOTE: If you want to use reveal.js 2, please clone the asciidoctor-reveal.js repo and switch to the reveal.js-2.x branch.
52
-
53
60
 
54
61
  === Prerequisites
55
62
 
@@ -82,7 +89,6 @@ NOTE: These instructions should be repeated for every presentation project.
82
89
  source 'https://rubygems.org'
83
90
 
84
91
  gem 'asciidoctor-revealjs' # latest released version
85
- #gem 'asciidoctor-revealjs', github: 'asciidoctor/asciidoctor-reveal.js' # github master branch
86
92
  ----
87
93
  +
88
94
  NOTE: For some reason, when you use the system Ruby on Fedora, you also have to add the json gem to the Gemfile.
@@ -95,13 +101,13 @@ NOTE: For some reason, when you use the system Ruby on Fedora, you also have to
95
101
  . Optional: Copy or clone reveal.js presentation framework.
96
102
  Allows you to modify themes or view slides offline.
97
103
 
98
- $ git clone -b 3.3.0 --depth 1 https://github.com/hakimel/reveal.js.git
104
+ $ git clone -b 3.6.0 --depth 1 https://github.com/hakimel/reveal.js.git
99
105
 
100
106
 
101
107
  === Rendering the AsciiDoc into slides
102
108
 
103
109
  . Create content in a file (*.adoc, *.ad, etc.).
104
- See examples in <<Syntax Examples>> section to get started or look at files in `test/`.
110
+ See examples in <<Syntax Examples>> section to get started.
105
111
 
106
112
  . Generate HTML presentation from the AsciiDoc source
107
113
 
@@ -120,7 +126,6 @@ First you must install and configure {uri-nodejs-download}[Node.js] on your mach
120
126
 
121
127
  Using npm:
122
128
 
123
- $ npm i --save asciidoctor.js@1.5.5-5
124
129
  $ npm i --save asciidoctor-reveal.js
125
130
 
126
131
  === Rendering the AsciiDoc into slides
@@ -133,14 +138,12 @@ Here we are converting a file named `presentation.adoc` into a reveal.js present
133
138
  ----
134
139
  // Load asciidoctor.js and asciidoctor-reveal.js
135
140
  var asciidoctor = require('asciidoctor.js')();
136
- var Asciidoctor = asciidoctor.Asciidoctor();
137
-
138
141
  require('asciidoctor-reveal.js');
139
142
 
140
143
  // Convert the document 'presentation.adoc' using the reveal.js converter
141
- var attributes = 'revealjsdir=node_modules/reveal.js@';
144
+ var attributes = {'revealjsdir': 'node_modules/reveal.js@'};
142
145
  var options = {safe: 'safe', backend: 'revealjs', attributes: attributes};
143
- Asciidoctor.convertFile('presentation.adoc', options); // <1>
146
+ asciidoctor.convertFile('presentation.adoc', options); // <1>
144
147
  ----
145
148
  <1> Creates a file named `presentation.html` (in the directory where command is run)
146
149
 
@@ -162,19 +165,19 @@ Asciidoctor.convertFile('presentation.adoc', options); // <1>
162
165
 
163
166
  To render the slides, run:
164
167
 
165
- node asciidoctor-reveal.js
168
+ node asciidoctor-revealjs.js
166
169
 
167
170
  You can open the `presentation.html` file in your browser and enjoy!
168
171
 
169
172
 
170
173
  == Syntax Examples
171
174
 
172
- // FIXME: incomplete
173
-
174
175
  Let's see some examples of `revealjs` backend features.
176
+ Additional examples can be found in the AsciiDoc files (.adoc) in `examples/`.
175
177
 
176
178
  === Basic presentation with speaker notes
177
179
 
180
+ [source, asciidoc]
178
181
  ----
179
182
  = Title Slide
180
183
 
@@ -196,6 +199,18 @@ Actually things aren't that bad
196
199
 
197
200
  In previous snippet we are creating a slide titled Slide One with bullets and another one titled Slide Two with centered text (reveal.js`' default behavior) with {uri-revealjs-gh}#speaker-notes[speaker notes].
198
201
 
202
+ Starting with Reveal.js 3.5 speaker notes supports configurable layouts:
203
+ image:https://cloud.githubusercontent.com/assets/629429/21808439/b941eb52-d743-11e6-9936-44ef80c60580.gif[]
204
+
205
+ Speaker notes are opened by pressing `s`.
206
+ With Reveal.js 3.5 they require a webserver to work.
207
+ This limitation is not present in 3.6.
208
+ You can get a Web server running quickly with:
209
+
210
+ ruby -run -e httpd . -p 5000 -b 127.0.0.1
211
+
212
+ Then open your browser at: http://localhost:5000/
213
+
199
214
 
200
215
  === Slides without titles
201
216
 
@@ -207,6 +222,7 @@ There are a few ways to have no titles on slides.
207
222
 
208
223
  Here is an example of the three techniques in action:
209
224
 
225
+ [source, asciidoc]
210
226
  ----
211
227
  include::test/concealed-slide-titles.adoc[]
212
228
  ----
@@ -216,6 +232,7 @@ NOTE: `conceal` and `notitle` have the advantage that the slide still has an id
216
232
 
217
233
  === Background colors
218
234
 
235
+ [source, asciidoc]
219
236
  ----
220
237
  [background-color="yellow"]
221
238
  == Slide Three
@@ -229,6 +246,7 @@ Anything accepted by CSS color formats works.
229
246
 
230
247
  === Background images
231
248
 
249
+ [source, asciidoc]
232
250
  ----
233
251
  [%notitle]
234
252
  == Grand Announcement
@@ -245,6 +263,7 @@ NOTE: Background images file names are now relative to the `:imagedir:` attribut
245
263
 
246
264
  NOTE: The `canvas` keyword can be used instead of `background` for the same effect.
247
265
 
266
+ [source, asciidoc]
248
267
  ----
249
268
  [%notitle]
250
269
  == The Great Goat
@@ -260,6 +279,7 @@ As you can see, you can use a URL to specify your image resource too.
260
279
 
261
280
  A background video for a slide can be specified using the `background-video` element attribute.
262
281
 
282
+ [source, asciidoc]
263
283
  ----
264
284
  [background-video="https://my.video/file.mp4",background-video-loop=true,background-video-muted=true]
265
285
  == Nice background!
@@ -269,6 +289,7 @@ For convenience `background-video-loop` and `background-video-muted` attributes
269
289
 
270
290
  For example:
271
291
 
292
+ [source, asciidoc]
272
293
  ----
273
294
  [background-video="https://my.video/file.mp4",options="loop,muted"]
274
295
  == Nice background!
@@ -282,6 +303,7 @@ Note that the `data-` prefix is not required in asciidoc files.
282
303
 
283
304
  The background can be replaced with anything a browser can render in an iframe using the `background-iframe` reveal.js feature.
284
305
 
306
+ [source, asciidoc]
285
307
  ----
286
308
  [%notitle,background-iframe="https://www.youtube.com/embed/LaApqL4QjH8?rel=0&start=3&enablejsapi=1&autoplay=1&loop=1&controls=0&modestbranding=1"]
287
309
  == a youtube video
@@ -292,6 +314,7 @@ See {uri-revealjs-gh}#iframe-backgrounds[the relevant reveal.js documentation] f
292
314
 
293
315
  === Slide Transitions
294
316
 
317
+ [source, asciidoc]
295
318
  ----
296
319
  [transition=zoom, %notitle]
297
320
  == Zoom zoom
@@ -309,6 +332,7 @@ See {uri-revealjs-gh}#slide-transitions[the relevant reveal.js documentation] fo
309
332
 
310
333
  === Fragments
311
334
 
335
+ [source, asciidoc]
312
336
  ----
313
337
  == Slide Four
314
338
 
@@ -346,6 +370,7 @@ See {uri-revealjs-gh}#stretching-elements[reveal.js documentation on stretching
346
370
  In addition to <<Background videos,background videos>>, videos can be inserted directly into slides.
347
371
  The syntax is the standard http://asciidoctor.org/docs/user-manual/#video[asciidoc video block macro] syntax.
348
372
 
373
+ [source, asciidoc]
349
374
  ----
350
375
  == Trains, we love trains!
351
376
 
@@ -358,12 +383,13 @@ To override that behavior use the `width` and `height` named attributes.
358
383
 
359
384
  === Syntax highlighting
360
385
 
361
- [listing]
386
+ [source, asciidoc]
362
387
  ....
363
388
  == Slide Five
364
389
 
365
390
  Uses highlighted code
366
391
 
392
+ [source, python]
367
393
  ----
368
394
  print "Hello World"
369
395
  ----
@@ -375,7 +401,7 @@ An explicit `[listing]` block will not be highlighted.
375
401
  `highlight.js` does language auto-detection but using the `language="..."` attribute will hint the highlighter.
376
402
  For example this will highlight this source code as Perl:
377
403
 
378
- [listing]
404
+ [source, asciidoc]
379
405
  ....
380
406
  == Slide Five
381
407
 
@@ -394,6 +420,7 @@ These handle callouts correctly.
394
420
 
395
421
  To use http://coderay.rubychan.de[Coderay]:
396
422
 
423
+ [source, asciidoc]
397
424
  ----
398
425
  = Title slide
399
426
  :source-highlighter: coderay
@@ -401,6 +428,7 @@ To use http://coderay.rubychan.de[Coderay]:
401
428
 
402
429
  To use http://pygments.org[Pygments]:
403
430
 
431
+ [source, asciidoc]
404
432
  ----
405
433
  = Title slide
406
434
  :source-highlighter: pygments
@@ -408,7 +436,7 @@ To use http://pygments.org[Pygments]:
408
436
 
409
437
  === Vertical slides
410
438
 
411
- [listing]
439
+ [source, asciidoc]
412
440
  ....
413
441
  == Slide Six
414
442
 
@@ -442,6 +470,7 @@ Keep in mind that for title slides you must replace `data-` with
442
470
 
443
471
  Here is an example:
444
472
 
473
+ [source, asciidoc]
445
474
  ----
446
475
  include::test/title-slide-image.adoc[]
447
476
  ----
@@ -462,6 +491,7 @@ In the end, the whole document has to be compiled with the backend option:
462
491
 
463
492
  For example:
464
493
 
494
+ [source, asciidoc]
465
495
  ----
466
496
  == Main section
467
497
 
@@ -494,6 +524,7 @@ Doing so, you can then easily override specific elements of your theme per prese
494
524
 
495
525
  For example, to do proper position-independent text placement of a title slide with a specific background you can use:
496
526
 
527
+ [source, css]
497
528
  ----
498
529
  .reveal section.title h1 {
499
530
  margin-top: 2.3em;
@@ -514,6 +545,7 @@ If the `:customcss:` attribute value is empty then `asciidoctor-revealjs.css` is
514
545
  Reveal.js supports a {uri-revealjs-gh}#slide-states[data-state] tag that can be added on slides which gets rendered into `<section>` tags.
515
546
  In AsciiDoc the `data-state` can be applied to a slide by adding a state attribute to a section like this:
516
547
 
548
+ [source, asciidoc]
517
549
  ----
518
550
  [state=topic]
519
551
  == Epic Topic
@@ -522,6 +554,7 @@ In AsciiDoc the `data-state` can be applied to a slide by adding a state attribu
522
554
  That state can be queried from Javascript or used in CSS to apply further customization to your slide deck.
523
555
  For example, by combining this feature with the <<CSS override>> one, you can alter fonts for specific pages with this CSS:
524
556
 
557
+ [source, css]
525
558
  ----
526
559
  @import 'https://fonts.googleapis.com/css?family=Baloo+Bhai';
527
560
 
@@ -536,12 +569,14 @@ section[data-state="topic"] h2 {
536
569
  Asciidoctor font-based http://asciidoctor.org/docs/user-manual/#admonition[admonitions] are supported.
537
570
  Make sure to add the following attribute to your document:
538
571
 
572
+ [source, asciidoc]
539
573
  ----
540
574
  :icons: font
541
575
  ----
542
576
 
543
577
  Here is an example slide:
544
578
 
579
+ [source, asciidoc]
545
580
  ----
546
581
  == But first
547
582
 
@@ -551,11 +586,6 @@ WARNING: This presentation is dangerous!
551
586
  Here are details about Asciidoctor's http://asciidoctor.org/docs/user-manual/#admonition-icons[Admonition icons] support.
552
587
 
553
588
 
554
- // FIXME this is no longer accurate
555
- == About Jade Templates
556
-
557
- `/templates/jade` directory contains jade template files they are ported from `/templates/slim` templates. These templates were written to support the reveal.js converter for Asciidoctor.js environment that is currently using in https://github.com/asciidocfx/AsciidocFX[AsciidocFX] editor. You can look at the https://github.com/asciidocfx/asciidoctor.js-reveal-demo[demo].
558
-
559
589
  == Reveal.js Options
560
590
 
561
591
  There are some attributes that can be set at the top of the document which they are specific of `revealjs` converter.
@@ -691,11 +721,11 @@ activate it.
691
721
 
692
722
  == Minimum Requirements
693
723
 
694
- * asciidoctor 1.5.4
724
+ * asciidoctor 1.5.6
695
725
 
696
726
  == Copyright and Licensing
697
727
 
698
- Copyright (C) 2012-2016 {authors} and the Asciidoctor Project.
728
+ Copyright (C) 2012-2017 {authors} and the Asciidoctor Project.
699
729
  Free use of this software is granted under the terms of the MIT License.
700
730
 
701
731
  ifdef::env-github,env-browser[See the <<LICENSE#,LICENSE>> file for details.]