asciidoctor-revealjs 3.0.0.pre.rc1 → 4.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.adoc +1 -1
  3. data/README.adoc +416 -64
  4. data/Rakefile +30 -7
  5. data/asciidoctor-revealjs.gemspec +6 -4
  6. data/bin/asciidoctor-revealjs +7 -0
  7. data/examples/a11y-dark.css +99 -0
  8. data/examples/autoslide.adoc +22 -0
  9. data/examples/custom-layout.adoc +10 -0
  10. data/examples/customcss.adoc +1 -1
  11. data/examples/data-attributes.adoc +245 -0
  12. data/examples/docinfo-footer-revealjs.html +10 -0
  13. data/examples/docinfo-revealjs.html +7 -0
  14. data/examples/font-awesome-specific-version.adoc +11 -0
  15. data/examples/font-awesome.adoc +23 -4
  16. data/examples/font-awesome.css +3 -0
  17. data/examples/footnotes.adoc +46 -0
  18. data/examples/fragments.adoc +44 -0
  19. data/examples/fragments.css +18 -0
  20. data/examples/grid-layout-3x2.adoc +50 -0
  21. data/examples/grid-layout-docinfo-revealjs.html +11 -0
  22. data/examples/grid-layout.adoc +194 -0
  23. data/examples/history-hash.adoc +19 -0
  24. data/examples/history-regression-tests.adoc +0 -5
  25. data/examples/history.adoc +4 -4
  26. data/examples/images/asciidoctor-logo.svg +102 -0
  27. data/examples/images/cute-cat-1.jpg +0 -0
  28. data/examples/images/cute-cat-2.jpg +0 -0
  29. data/examples/images/cute-cat-3.jpg +0 -0
  30. data/examples/images/flock-of-seagulls_daniel-simion.mp3 +0 -0
  31. data/examples/issue-grid-layout-images.adoc +25 -0
  32. data/examples/level-sectnums.adoc +24 -0
  33. data/examples/links-preview.adoc +32 -0
  34. data/examples/links.adoc +39 -0
  35. data/examples/mathjax-cdn.adoc +21 -0
  36. data/examples/mathjax.adoc +20 -0
  37. data/examples/release-4.0.adoc +192 -0
  38. data/examples/release-4.0.css +23 -0
  39. data/examples/release-4.1.adoc +133 -0
  40. data/examples/release-4.1.css +50 -0
  41. data/examples/revealjs-custom-theme.adoc +10 -0
  42. data/examples/source-coderay.adoc +15 -0
  43. data/examples/source-emphasis.adoc +128 -0
  44. data/examples/source-highlightjs-html.adoc +1 -1
  45. data/examples/source-highlightjs-languages.adoc +27 -0
  46. data/examples/source-highlightjs.adoc +85 -2
  47. data/examples/source-pygments.adoc +12 -0
  48. data/examples/source-rouge-docinfo.html +8 -0
  49. data/examples/source-rouge.adoc +18 -0
  50. data/examples/steps.adoc +87 -0
  51. data/examples/text-alignments.adoc +44 -0
  52. data/examples/video.adoc +30 -8
  53. data/examples/with-docinfo-shared.adoc +13 -0
  54. data/lib/asciidoctor-revealjs/converter.rb +1053 -769
  55. data/lib/asciidoctor-revealjs/highlightjs.rb +333 -2
  56. data/lib/asciidoctor-revealjs/version.rb +1 -1
  57. data/templates/admonition.html.slim +1 -1
  58. data/templates/asciidoctor-compatibility.css +390 -0
  59. data/templates/audio.html.slim +1 -1
  60. data/templates/colist.html.slim +1 -1
  61. data/templates/dlist.html.slim +3 -3
  62. data/templates/document.html.slim +76 -59
  63. data/templates/example.html.slim +1 -1
  64. data/templates/helpers.rb +170 -5
  65. data/templates/image.html.slim +3 -3
  66. data/templates/inline_anchor.html.slim +6 -4
  67. data/templates/inline_button.html.slim +2 -1
  68. data/templates/inline_footnote.html.slim +11 -4
  69. data/templates/inline_image.html.slim +5 -8
  70. data/templates/inline_kbd.html.slim +3 -2
  71. data/templates/inline_menu.html.slim +4 -3
  72. data/templates/inline_quoted.html.slim +13 -21
  73. data/templates/listing.html.slim +15 -10
  74. data/templates/literal.html.slim +1 -1
  75. data/templates/olist.html.slim +2 -2
  76. data/templates/open.html.slim +3 -3
  77. data/templates/paragraph.html.slim +1 -1
  78. data/templates/quote.html.slim +1 -1
  79. data/templates/section.html.slim +51 -43
  80. data/templates/sidebar.html.slim +1 -1
  81. data/templates/stem.html.slim +1 -1
  82. data/templates/stretch_nested_elements.js.slim +65 -0
  83. data/templates/table.html.slim +3 -2
  84. data/templates/title_slide.html.slim +28 -0
  85. data/templates/ulist.html.slim +3 -3
  86. data/templates/verse.html.slim +1 -1
  87. data/templates/video.html.slim +14 -8
  88. metadata +79 -16
  89. data/CHANGELOG.adoc +0 -396
  90. data/HACKING.adoc +0 -343
  91. data/examples/revealjs-features.adoc +0 -23
  92. data/templates/asciidoctor_revealjs.css.slim +0 -59
@@ -1,343 +0,0 @@
1
- = HACKING asciidoctor-reveal.js
2
- :toc: preamble
3
- :toclevels: 2
4
-
5
- Short instructions that aim to help potential contributors.
6
-
7
- == Getting Started
8
-
9
- * Setup the Asciidoctor-revealjs plugin in <<ruby-localversion,development mode>>
10
- * Modify the http://slim-lang.com/[slim templates] in `templates/`
11
- * Templates need to be compiled before being used, do so with:
12
-
13
- bundle exec rake build
14
-
15
- * Then using the following command will render slides with your template changes baked in:
16
-
17
- bundle exec asciidoctor-revealjs <source.adoc>
18
-
19
- The next section will provide further help on how to use `print` statements or a debugger to assist development.
20
-
21
-
22
- == Inspect the template system
23
-
24
- To understand what you have access to in templates you can inject some ruby.
25
- With the slim templating system, this is done by prepending the lines with a dash (`-`) and inserting a ruby statement.
26
- Two complementary approaches can be used to explore the context offered by asciidoctor through the template system:
27
-
28
- * logging on the command line via print-like statements
29
- * jump into the context through an interactive debugger
30
-
31
- [NOTE]
32
- --
33
- Starting with v1.1.0 the slim templates are compiled to Ruby in order to
34
- use the same templates from Asciidoctor.js (Javascript / Node.js ecosystem).
35
- Don't forget to recompile the templates if you make changes to them.
36
- This can be done by running:
37
-
38
- bundle exec rake build
39
- --
40
-
41
- === Print debugging information
42
-
43
- For example to see which attributes are available, you can print them by adding these lines in the `.slim` file of interest:
44
-
45
- ----
46
- - puts @document.attributes.inspect
47
- - puts @attributes.inspect
48
- - puts @document.methods
49
- ----
50
-
51
- Other generally useful ruby specific introspection:
52
-
53
- ----
54
- - puts instance_variables
55
- - puts local_variables
56
- ----
57
-
58
- One might find `pp` to produce better output (and in some cases not):
59
-
60
- ----
61
- - require 'pp'
62
- - pp @document.attributes
63
- ----
64
-
65
- === Interactively debug a template
66
-
67
- Pry is a powerful debugger for ruby that features tab-completion.
68
- It is very useful to discover a complex object hierarchy like what asciidoctor offers.
69
-
70
- ==== Initial Setup
71
-
72
- bundle --path=.bundle/gems --binstubs=.bundle/.bin
73
-
74
- ==== Usage
75
-
76
- In order to be dropped into the debugger at a specific point in a template simply add the following two lines in the relevant `.slim` template file:
77
-
78
- ----
79
- - require 'pry'
80
- - binding.pry
81
- ----
82
-
83
- Then run `asciidoctor-revealjs` from the command-line to generate your document and you'll be dropped in the debugger:
84
-
85
- ----
86
- $ bundle exec asciidoctor-revealjs examples/video.adoc
87
- asciidoctor: WARNING: level-sections.adoc: line 29: section title out of sequence: expected level 2, got level 3
88
-
89
- From: /home/olivier/src/asciidoc/asciidoctor-reveal.js/templates/slim/section.html.slim @ line 3 :
90
-
91
- 1: - hide_title = (title = self.title) == '!'
92
- 2: - require 'pry'
93
- => 3: - binding.pry
94
- 4: / parent section of vertical slides set
95
- 5: - if @level == 1 && !(subsections = sections).empty?
96
- 6: section
97
- 7: section id=(hide_title ? nil : @id) data-transition=(attr 'data-transition') data-transition-speed=(attr 'data-transition-speed') data-background=(attr 'data-background') data-background-size=(attr 'data-background-size') data-background-repeat=(attr 'data-background-repeat') data-background-transition=(attr 'data-background-transition')
98
- 8: - unless hide_title
99
-
100
- [1] pry(#<Asciidoctor::Section>)>
101
- ----
102
-
103
- Then using commands like the following allows you to explore interactively asciidoctor's API and object model with syntax highlighting:
104
-
105
- [1] pry(#<Asciidoctor::Section>)> @document
106
-
107
- You can also query asciidoctor's documentation:
108
-
109
- [4] pry(#<Asciidoctor::Section>)> ? find_by
110
-
111
- If you install the `pry-byebug` gem you get additional debugging capabilities.
112
- See the gem's documentation for details.
113
-
114
- Since 1.1.0, templates are compiled. It is easier to inject the debug
115
- triggering statements and use the templates directly instead of debugging
116
- compiled templates. You can call the slim templates directly with:
117
-
118
- // TODO it's still not clear whether `-r slim-htag` is required right now (#153)
119
-
120
- bundle exec asciidoctor --trace -T templates/ examples/customcss.adoc
121
-
122
- === References
123
-
124
- * https://github.com/asciidoctor/asciidoctor.org/issues/80#issuecomment-145698579
125
- * http://pryrepl.org/
126
- * http://discuss.asciidoctor.org/Interactively-debugging-a-template-with-a-REPL-td4498.html
127
-
128
- == Manual Tests
129
-
130
- In order to help troubleshoot issues and test syntax improvements, some minimalist asciidoc test files are provided.
131
- You can render the tests files and then load them in a browser and check if `asciidoctor-revealjs` behaves as expected.
132
-
133
- === Initial Setup
134
-
135
- Make sure to have a working version of `asciidoctor-reveals` this is usually
136
- done with `bundler`:
137
-
138
- bundle config --local github.https true
139
- bundle --path=.bundle/gems --binstubs=.bundle/.bin
140
- bundle exec rake build
141
-
142
- Go to `test/doctest` folder and install `reveal.js`:
143
-
144
- cd test/doctest/
145
- git clone https://github.com/hakimel/reveal.js.git
146
-
147
- === Render tests into .html
148
-
149
- From the project's root directory:
150
-
151
- bundle exec rake doctest::generate FORCE=yes
152
-
153
- === Open rendered files
154
-
155
- NOTE: Right now, https://github.com/asciidoctor/asciidoctor-doctest/issues/12[doctest issue #12] means that the generated examples will not be pretty.
156
-
157
- You can open the generated `.html` in `test/doctest/` in a Web browser.
158
-
159
-
160
- == Asciidoctor API's gotchas
161
-
162
- === Attribute inheritence
163
-
164
- 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.
165
-
166
- You only want to enable inheritance if you intend to allow an attribute of the same name to be controlled globally.
167
- That might be good for configuring transitions. For instance:
168
-
169
- ----
170
- = My Slides
171
- :transition-speed: fast
172
-
173
- == First Slide
174
- ----
175
-
176
- However, there may be attributes that you don't want to inherit.
177
- If that's the case, you generally use the form:
178
-
179
- attr('name', nil, false)
180
-
181
- The second parameter value is the default attribute value, which is nil by default.
182
-
183
- Relevant documentation: http://www.rubydoc.info/github/asciidoctor/asciidoctor/Asciidoctor%2FAbstractNode%3Aattr
184
-
185
-
186
- == Merge / Review policy
187
-
188
- Any non-trivial change should be integrated in master via a pull-request.
189
- This gives the community a chance to participate and helps write better code because it encourages people to review their own patches.
190
-
191
- Pull requests should come from personal forks in order not the clutter the upstream repository.
192
-
193
- === Wait time
194
-
195
- Once a pull request is submitted, let it sit for 24-48 hours for small changes.
196
- If you get positive feedback you can merge before the sitting time frame.
197
- If you don't get feedback, just merge after the sitting time frame.
198
-
199
- Larger changes should sit longer at around a week.
200
- Positive feedback or no feedback should be handled like for small changes.
201
-
202
- Breaking changes should sit until a prominent contributor comments on the changes.
203
- Ping `@mojavelinux` and `@obilodeau` if necessary.
204
-
205
- Remember that this is a slower moving project since people are not designing slides everyday.
206
- Well, for most people.
207
-
208
- === Work-in-progress pull-requests
209
-
210
- If you prepend "WIP" in front of your pull request we will understand that it is not complete and we will not merge it before you remove the WIP string.
211
-
212
- This is useful to let people know that you are working on stuff.
213
- Branches are not that visible otherwise but pull requests are.
214
-
215
- You might even be able to get some feedback early which could save you some time.
216
-
217
- === 'needs review' label
218
-
219
- You can apply that label to a pull request that is complete and ready for review.
220
-
221
- Makes triaging easier.
222
-
223
- == Node package
224
-
225
- === Test a local asciidoctor-reveal.js version
226
-
227
- In order to test the Node package, you first need to build the converter into Javascript and create a tarball of the project.
228
-
229
- $ bundle exec rake build:js
230
- $ npm pack
231
-
232
- That last command will produce a file named `asciidoctor-reveal.js-<version>.tgz` in the working directory.
233
-
234
- Then, create a test project adjacent to the clone of the [.path]_asciidoctor-reveal.js_ repository:
235
-
236
- $ mkdir test-project
237
- $ cd test-project
238
-
239
- Now, install the dependencies from the tarball:
240
-
241
- $ npm i --save ../asciidoctor-reveal.js/asciidoctor-reveal.js-<version>.tgz
242
-
243
- NOTE: The relative portion of the last command is where you are installing the local `asciidoctor-reveal.js` version from.
244
-
245
- Then proceed as documented in the `README.adoc`.
246
-
247
- === Upgrade Asciidoctor.js version
248
-
249
- WARNING: It is important to track `Asciidoctor.js` and `opal` versions together.
250
- The `opal` used to compile our node package must match `asciidoctor.js`'s `opal` requirement.
251
- The former is specified in our `package.json` and the latter in the `asciidoctor-revealjs.gemspec`.
252
- When you update one remember to update the other.
253
- Versions known to work together can be found by looking at the Asciidoctor.js release notes, just replace <tag> with the `asciidoctor.js` release you are interested in: https://github.com/asciidoctor/asciidoctor.js/releases/tag/<tag>.
254
-
255
- == RubyGem package
256
-
257
- [[ruby-localversion]]
258
- === Test a local asciidoctor-revealjs version
259
-
260
- Compile the converter:
261
-
262
- $ bundle exec rake build
263
-
264
- In a clean directory besides the `asciidoctor-reveal.js` repository, create the following `Gemspec` file:
265
-
266
- source 'https://rubygems.org'
267
- gem 'asciidoctor-revealjs', :path => '../asciidoctor-reveal.js'
268
-
269
- Then run:
270
-
271
- $ bundle --path=.bundle/gems --binstubs=.bundle/.bin
272
-
273
-
274
- == Release process
275
-
276
- . Update the version in `lib/asciidoctor-revealjs/version.rb` and `package.json`
277
- . Update the changelog
278
- ** Generate author list with:
279
- +
280
- git log <prev-version-tag>.. --format="%aN" --reverse | perl -e 'my %dedupe; while (<STDIN>) { print unless $dedupe{$_}++}' | sort
281
-
282
- . Prepare release commit
283
- ** commit msg: Prepare %version% release
284
- ** release commit (--allow-empty) msg: Release %version%
285
- . Tag the release commit
286
- ** Annotated Tag msg: Version %version%
287
- . Push your changes (including the tag)
288
- . Make a release on github (from changelog and copy from previous releases)
289
- // TODO: reg needs fixin'
290
- ** Useful vim regex for AsciiDoc to Markdown: `:%s/{uri-issue}\d\+\(\(\[#\d\+\)]\)/\1(https:\/\/github.com\/asciidoctor\/asciidoctor-reveal.js\/issues\/\2)/gc`
291
- . Pushing the gem on rubygems.org:
292
- +
293
- $ bundle exec rake build
294
- $ gem build asciidoctor-revealjs.gemspec
295
- $ gem push asciidoctor-revealjs-X.Y.Z.gem
296
-
297
- . Check that the new version is available on https://rubygems.org/gems/asciidoctor-revealjs[rubygems.org]
298
- . Generate the javascript version of the Ruby converter
299
- +
300
- $ bundle exec rake build:js
301
-
302
- . Test the node package (make sure you have `devDependencies` installed with: `npm install`):
303
- +
304
- $ npm run test
305
-
306
- . Publish the node package on npm:
307
- +
308
- $ npm login # only required if not already authenticated
309
- $ npm publish
310
-
311
- . Check that the new version is available on https://www.npmjs.com/package/asciidoctor-reveal.js[npmjs.com]
312
- . Update version in `lib/asciidoctor-revealjs/version.rb` and `package.json` (+1 bugfix and append '-dev') and commit
313
- ** commit msg: Begin development on next release
314
- . Submit a PR upstream to sync the documentation on asciidoctor.org
315
- ** Modify this page: https://github.com/asciidoctor/asciidoctor.org/edit/master/docs/asciidoctor-revealjs.adoc
316
-
317
- == Ruby and asciidoctor-doctest tests
318
-
319
- === Running tests
320
-
321
- 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):
322
-
323
- bundle --path=.bundle/gems --binstubs=.bundle/.bin
324
-
325
- Then you can execute the tests with:
326
-
327
- bundle exec rake doctest
328
-
329
- However, if you have all dependencies properly installed this command should run the tests successfully:
330
-
331
- rake doctest
332
-
333
- === Generating HTML test target
334
-
335
- 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.
336
- This is done using the following command:
337
-
338
- bundle exec rake doctest:generate FORCE=y
339
-
340
- === Custom tests
341
-
342
- Files in the `examples/` directory are used as tests.
343
- Resulting slides are kept in `test/doctest/`.
@@ -1,23 +0,0 @@
1
- // .revealjs-features
2
- // This example tests some of Reveal.js 3.7.0 features
3
- // :include: //body/script | //div[@class="slides"]
4
- // :header_footer:
5
- = Reveal.JS
6
- :revealjs_history: true
7
- :revealjs_fragmentInURL: true
8
-
9
- == Slide One
10
-
11
- Some content
12
-
13
- === And
14
-
15
- With Reveal.JS 3.6
16
-
17
- === Fragments
18
-
19
- Can now be displayed in URLs
20
-
21
- == Second slide
22
-
23
- Done
@@ -1,59 +0,0 @@
1
- /! This CSS is generated by the Asciidoctor-Reveal.js converter to further integrate AsciiDoc's existing semantic with Reveal.js
2
- css:
3
- .reveal div.right {
4
- float: right;
5
- }
6
-
7
- .reveal .listingblock.stretch > .content {
8
- height: 100%;
9
- }
10
-
11
- .reveal .listingblock.stretch > .content > pre {
12
- height: 100%;
13
- }
14
-
15
- .reveal .listingblock.stretch > .content > pre > code {
16
- height: 100%;
17
- max-height: 100%;
18
- }
19
-
20
- /* tables */
21
- table{border-collapse:collapse;border-spacing:0}
22
- table{margin-bottom:1.25em;border:solid 1px #dedede}
23
- table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;text-align:left}
24
- table tr th,table tr td{padding:.5625em .625em;font-size:inherit}
25
- table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
26
- td.tableblock>.content{margin-bottom:1.25em}
27
- td.tableblock>.content>:last-child{margin-bottom:-1.25em}
28
- table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
29
- table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
30
- table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
31
- table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
32
- table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
33
- table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
34
- table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
35
- table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
36
- table.frame-all{border-width:1px}
37
- table.frame-sides{border-width:0 1px}
38
- table.frame-topbot,table.frame-ends{border-width:1px 0}
39
- .reveal table th.halign-left,.reveal table td.halign-left{text-align:left}
40
- .reveal table th.halign-right,.reveal table td.halign-right{text-align:right}
41
- .reveal table th.halign-center,.reveal table td.halign-center{text-align:center}
42
- .reveal table th.valign-top,.reveal table td.valign-top{vertical-align:top}
43
- .reveal table th.valign-bottom,.reveal table td.valign-bottom{vertical-align:bottom}
44
- .reveal table th.valign-middle,.reveal table td.valign-middle{vertical-align:middle}
45
- table thead th,table tfoot th{font-weight:bold}
46
- tbody tr th{display:table-cell;line-height:1.6}
47
- tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{font-weight:bold}
48
- thead{display:table-header-group}
49
-
50
- .reveal table.grid-none th,.reveal table.grid-none td{border-bottom:0!important}
51
-
52
- /* callouts */
53
- .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
54
- .conum[data-value] *{color:#fff!important}
55
- .conum[data-value]+b{display:none}
56
- .conum[data-value]:after{content:attr(data-value)}
57
- pre .conum[data-value]{position:relative;top:-.125em}
58
- b.conum *{color:inherit!important}
59
- .conum:not([data-value]):empty{display:none}