asciidoctor-revealjs 4.1.0 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -2
  3. data/README.adoc +12 -1351
  4. data/asciidoctor-revealjs.gemspec +2 -3
  5. data/examples/auto-animate-code.adoc +47 -0
  6. data/examples/auto-animate.adoc +351 -0
  7. data/examples/favicon.adoc +13 -0
  8. data/examples/images/sample.svg +27 -0
  9. data/examples/mathjax-cdn.adoc +1 -1
  10. data/examples/mathjax.adoc +1 -1
  11. data/examples/revealjs-custom-theme.adoc +1 -1
  12. data/examples/revealjs-plugin-activation.adoc +3 -2
  13. data/examples/revealjs-plugins/chalkboard/README.md +94 -61
  14. data/examples/revealjs-plugins/chalkboard/img/boardmarker-black.png +0 -0
  15. data/examples/revealjs-plugins/chalkboard/img/boardmarker-blue.png +0 -0
  16. data/examples/revealjs-plugins/chalkboard/img/boardmarker-green.png +0 -0
  17. data/examples/revealjs-plugins/chalkboard/img/boardmarker-orange.png +0 -0
  18. data/examples/revealjs-plugins/chalkboard/img/boardmarker-purple.png +0 -0
  19. data/examples/revealjs-plugins/chalkboard/img/boardmarker-red.png +0 -0
  20. data/examples/revealjs-plugins/chalkboard/img/boardmarker-yellow.png +0 -0
  21. data/examples/revealjs-plugins/chalkboard/img/chalk-blue.png +0 -0
  22. data/examples/revealjs-plugins/chalkboard/img/chalk-green.png +0 -0
  23. data/examples/revealjs-plugins/chalkboard/img/chalk-orange.png +0 -0
  24. data/examples/revealjs-plugins/chalkboard/img/chalk-purple.png +0 -0
  25. data/examples/revealjs-plugins/chalkboard/img/chalk-red.png +0 -0
  26. data/examples/revealjs-plugins/chalkboard/img/chalk-yellow.png +0 -0
  27. data/examples/revealjs-plugins/chalkboard/plugin.js +1836 -0
  28. data/examples/revealjs-plugins/chalkboard/style.css +38 -0
  29. data/examples/revealjs-plugins/{reveal.js-menu → menu}/LICENSE +1 -1
  30. data/examples/revealjs-plugins/menu/README.md +368 -0
  31. data/examples/revealjs-plugins/{reveal.js-menu → menu}/menu.css +116 -115
  32. data/examples/revealjs-plugins/menu/menu.esm.js +1 -0
  33. data/examples/revealjs-plugins/menu/menu.js +1 -0
  34. data/examples/revealjs-plugins/menu/plugin.js +1252 -0
  35. data/examples/revealjs-plugins-docinfo-footer.html +20 -0
  36. data/examples/revealjs-plugins.adoc +2 -3
  37. data/examples/search-plugin.adoc +26 -0
  38. data/examples/source-rouge.adoc +1 -1
  39. data/examples/svg-images-docinfo-revealjs.html +15 -0
  40. data/examples/svg-images.adoc +41 -0
  41. data/examples/text-formatting.adoc +34 -0
  42. data/lib/asciidoctor-revealjs/converter.rb +819 -686
  43. data/lib/asciidoctor-revealjs/highlightjs.rb +155 -14
  44. data/lib/asciidoctor-revealjs/version.rb +1 -1
  45. data/templates/asciidoctor-compatibility.css +26 -1
  46. data/templates/document.html.slim +28 -44
  47. data/templates/helpers.rb +188 -10
  48. data/templates/image.html.slim +1 -16
  49. data/templates/inline_image.html.slim +1 -20
  50. data/templates/inline_quoted.html.slim +2 -2
  51. data/templates/listing.html.slim +2 -1
  52. data/templates/section.html.slim +7 -1
  53. data/templates/title_slide.html.slim +1 -2
  54. metadata +58 -81
  55. data/examples/revealjs-plugins/chalkboard/chalkboard.js +0 -1288
  56. data/examples/revealjs-plugins/chalkboard/img/boardmarker.png +0 -0
  57. data/examples/revealjs-plugins/reveal.js-menu/CONTRIBUTING.md +0 -9
  58. data/examples/revealjs-plugins/reveal.js-menu/README.md +0 -334
  59. data/examples/revealjs-plugins/reveal.js-menu/bower.json +0 -21
  60. data/examples/revealjs-plugins/reveal.js-menu/menu.js +0 -949
  61. data/examples/revealjs-plugins/reveal.js-menu/package.json +0 -22
  62. data/examples/revealjs-plugins-conf.js +0 -10
  63. data/examples/revealjs-plugins.js +0 -2
  64. /data/examples/revealjs-plugins/chalkboard/img/{chalk.png → chalk-white.png} +0 -0
  65. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/LICENSE.txt +0 -0
  66. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/all.css +0 -0
  67. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/brands.css +0 -0
  68. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/fontawesome.css +0 -0
  69. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/regular.css +0 -0
  70. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/solid.css +0 -0
  71. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/svg-with-js.css +0 -0
  72. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/v4-shims.css +0 -0
  73. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/css/v4-shims.min.css +0 -0
  74. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-brands-400.eot +0 -0
  75. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-brands-400.svg +0 -0
  76. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-brands-400.ttf +0 -0
  77. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-brands-400.woff +0 -0
  78. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-brands-400.woff2 +0 -0
  79. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-regular-400.eot +0 -0
  80. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-regular-400.svg +0 -0
  81. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-regular-400.ttf +0 -0
  82. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-regular-400.woff +0 -0
  83. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-regular-400.woff2 +0 -0
  84. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-solid-900.eot +0 -0
  85. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-solid-900.svg +0 -0
  86. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-solid-900.ttf +0 -0
  87. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-solid-900.woff +0 -0
  88. /data/examples/revealjs-plugins/{reveal.js-menu → menu}/font-awesome/webfonts/fa-solid-900.woff2 +0 -0
@@ -3,54 +3,49 @@
3
3
  With this plugin you can add a chalkboard to reveal.js. The plugin provides two possibilities to include handwritten notes to your presentation:
4
4
 
5
5
  - you can make notes directly on the slides, e.g. to comment on certain aspects,
6
- - you can open a chalkboard on which you can make notes.
6
+ - you can open a chalkboard or whiteboard on which you can make notes.
7
7
 
8
- The main use case in mind when implementing the plugin is classroom usage in which you may want to explain some course content and quickly need to make some notes.
8
+ The main use case in mind when implementing the plugin is classroom usage in which you may want to explain some course content and quickly need to make some notes.
9
9
 
10
- The plugin records all drawings made so that they can be play backed using the ```autoSlide``` feature or the ```audio-slideshow``` plugin.
10
+ The plugin records all drawings made so that they can be play backed using the `autoSlide` feature or the `audio-slideshow` plugin.
11
11
 
12
12
  [Check out the live demo](https://rajgoel.github.io/reveal.js-demos/chalkboard-demo.html)
13
13
 
14
14
  The chalkboard effect is based on [Chalkboard](https://github.com/mmoustafa/Chalkboard) by Mohamed Moustafa.
15
15
 
16
+ Multi color support added by Kurt Rinnert [GitHub](https://github.com/rinnert).
17
+
16
18
  ## Installation
17
19
 
18
- Copy the file ```chalkboard.js``` and the ```img``` directory into the plugin folder of your reveal.js presentation, i.e. ```plugin/chalkboard```.
20
+ Copy the file `plugin.js` and the `img` directory into the plugin folder of your reveal.js presentation, i.e. `plugin/chalkboard` and load the plugin as shown below.
19
21
 
20
- Add the plugins to the dependencies in your presentation as shown below.
22
+ ```html
23
+ <link rel="stylesheet" href="plugin/chalkboard/style.css">
24
+ <script src="plugin/chalkboard/plugin.js"></script>
21
25
 
22
- ```javascript
23
- Reveal.initialize({
24
- // ...
25
- chalkboard: {
26
- // optionally load pre-recorded chalkboard drawing from file
27
- src: "chalkboard.json",
28
- },
29
- dependencies: [
30
- // ...
31
- { src: 'plugin/chalkboard/chalkboard.js' },
32
- // ...
33
- ],
34
- keyboard: {
35
- 67: function() { RevealChalkboard.toggleNotesCanvas() }, // toggle notes canvas when 'c' is pressed
36
- 66: function() { RevealChalkboard.toggleChalkboard() }, // toggle chalkboard when 'b' is pressed
37
- 46: function() { RevealChalkboard.clear() }, // clear chalkboard when 'DEL' is pressed
38
- 8: function() { RevealChalkboard.reset() }, // reset chalkboard data on current slide when 'BACKSPACE' is pressed
39
- 68: function() { RevealChalkboard.download() }, // downlad recorded chalkboard drawing when 'd' is pressed
40
- },
41
- // ...
42
-
43
- });
26
+ <script>
27
+ Reveal.initialize({
28
+ // ...
29
+ plugins: [ RevealChalkboard ],
30
+ // ...
31
+ });
32
+ </script>
44
33
  ```
45
- In order to include buttons for opening and closing the notes canvas or the chalkboard you should make sure that ```font-awesome``` is available. The easiest way is to include
34
+
35
+ In order to include buttons for opening and closing the notes canvas or the chalkboard you should make sure that `font-awesome` is available. The easiest way is to include
36
+ ```html
37
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css">
46
38
  ```
47
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
39
+ to the `head` section of you HTML-file.
40
+
41
+ Alternatively, if you're using this package via NPM, you can use the built-in font-awesome distribution like so:
42
+ ```html
43
+ <link rel="stylesheet" href="node_modules/reveal.js-plugins/menu/font-awesome/css/all.css">
48
44
  ```
49
- to the ```head``` section of you HTML-file.
50
45
 
51
46
  ## Usage
52
47
 
53
- ### Enable & disable
48
+ ### Enable & disable
54
49
 
55
50
  With above configuration the notes canvas is opened and closed when pressing 'c' and the chalkboard is opened and closed when pressing 'b'.
56
51
 
@@ -63,62 +58,100 @@ With above configuration the notes canvas is opened and closed when pressing 'c'
63
58
  - Touch and hold for half a second, then move to wipe away previous drawings
64
59
 
65
60
  ### Keyboard
66
- - Click the 'DEL' key to clear the chalkboard </li>
67
- - Click the 'd' key to download chalkboard drawings</li>
68
- - Click the 'BACKSPACE' key to delete all chalkboard drawings on the current slide</li>
61
+ - Press the 'DEL' key to clear the chalkboard
62
+ - Press the 'd' key to download chalkboard drawings
63
+ - Press the 'BACKSPACE' key to delete all chalkboard drawings on the current slide
64
+ - Press the 'x' key to cycle colors forward
65
+ - Press the 'y' key to cycle colors backward
69
66
 
70
67
  ## Playback
71
68
 
72
- If the ```autoSlide``` feature is set or if the ```audio-slideshow``` plugin is used, pre-recorded chalkboard drawings can be played. The slideshow plays back the user interaction with the chalkboard in the same way as it was conducted when recording the data.
69
+ If the `autoSlide` feature is set or if the `audio-slideshow` plugin is used, pre-recorded chalkboard drawings can be played. The slideshow plays back the user interaction with the chalkboard in the same way as it was conducted when recording the data.
70
+
71
+ ## Broadcasting
72
+
73
+ The plugin supports broadcasting of drawings via the [`seminar`](https://github.com/rajgoel/reveal.js-plugins/tree/master/seminar) plugin. Alternatively, the [`multiplex`](https://github.com/reveal/multiplex) plugin can be used to share drawings (in this case, the `messageType` parameter (see Configuration) must be set to `'send'`).
74
+
73
75
 
74
76
  ## PDF-Export
75
77
 
76
- If the slideshow is opened in [print mode](https://github.com/hakimel/reveal.js/#pdf-export) the pre-recorded chalkboard drawings (which must be provided in a file, see ```src``` option) are included in the PDF-file. Each drawing on the chalkboard is added after the slide that was shown when opening the chalkboard. Drawings are also included if they had been cleared (using the 'DEL' key). Drawings on the notes canvas are not included in the PDF-file.
78
+ If the slideshow is opened in [print mode](https://revealjs.com/pdf-export/), the chalkboard drawings in the session storage (see `storage` option - print version must be opened in the same tab or window as the original slideshow) or provided in a file (see `src` option) are included in the PDF-file. Each drawing on the chalkboard is added after the slide that was shown when opening the chalkboard. Drawings on the notes canvas are not included in the PDF-file.
77
79
 
78
80
 
79
81
  ## Configuration
80
82
 
81
83
  The plugin has several configuration options:
82
84
 
83
- - ```src```: Optional filename for pre-recorded drawings.
84
- - ```readOnly```: Configuation option allowing to prevent changes to existing drawings. If set to ```true``` no changes can be made, if set to false ```false``` changes can be made, if unset or set to ```undefined``` no changes to the drawings can be made after returning to a slide or fragment for which drawings had been recorded before. In any case the recorded drawings for a slide or fragment can be cleared by pressing the 'DEL' key (i.e. by using the ```RevealChalkboard.clear()``` function).
85
- - ```toggleNotesButton```: If set to ```true``` a button for opening and closing the notes canvas is shown. Alternatively, the css position attributes can be provided if the default position is not appropriate.
86
- - ```toggleChalkboardButton```: If set to ```true``` a button for opening and closing the chalkboard is shown. Alternatively, the css position attributes can be provided if the default position is not appropriate.
87
- - ```transition```: Gives the duration (in milliseconds) of the transition for a slide change, so that the notes canvas is drawn after the transition is completed.
88
- - ```theme```: Can be set to either ```"chalkboard"``` or ```"whiteboard"```.
85
+ - `boardmarkerWidth`: an integer, the drawing width of the boardmarker; larger values draw thicker lines.
86
+ - `chalkWidth`: an integer, the drawing width of the chalk; larger values draw thicker lines.
87
+ - `chalkEffect`: a float in the range `[0.0, 1.0]`, the intesity of the chalk effect on the chalk board. Full effect (default) `1.0`, no effect `0.0`.
88
+ - `storage`: Optional variable name for session storage of drawings.
89
+ - `src`: Optional filename for pre-recorded drawings.
90
+ - `readOnly`: Configuation option allowing to prevent changes to existing drawings. If set to `true`, no changes can be made. However, recorded drawings for a slide or fragment can be cleared by pressing the 'DEL' key (i.e. by using the `RevealChalkboard.clear()` function).
91
+ - `toggleNotesButton`: If set to `true`, a button for opening and closing the notes canvas is shown. Alternatively, the css position attributes can be provided if the default position is not appropriate.
92
+ - `toggleChalkboardButton`: If set to `true`, a button for opening and closing the chalkboard is shown. Alternatively, the css position attributes can be provided if the default position is not appropriate.
93
+ - `colorButtons`: If set to `true`, the notes canvas and chalkboard will show a palette with buttons allowing to change the color. Alternatively, a numeric value can be assigned to the parameter limiting the number of colors buttons shown.
94
+ - `boardHandle`: If set to `true`, navigation buttons are shown, allowing to use multiple chalkboards on the same slide.
95
+ - `transition`: Gives the duration (in milliseconds) of the transition for a slide change, so that the notes canvas is drawn after the transition is completed.
96
+ - `theme`: Can be set to either `"chalkboard"` or `"whiteboard"`.
89
97
 
90
98
  The following configuration options allow to change the appearance of the notes canvas and the chalkboard. All of these options require two values, the first gives the value for the notes canvas, the second for the chalkboard.
91
99
 
92
- - ```color```: The first value gives the pen color, the second value gives the color of the chalk.
93
- - ```background```: The first value expects a (semi-)transparent color which is used to provide visual feedback that the notes canvas is enabled, the second value expects a filename to a background image for the chalkboard.
94
- - ```pen```: The first value expects a filename for an image of the pen used for the notes canvas, the second value expects a filename for an image of the pen used for the chalkboard.
100
+ - `background`: The first value expects a (semi-)transparent color which is used to provide visual feedback that the notes canvas is enabled, the second value expects a filename to a background image for the chalkboard.
101
+ - `grid`: By default whiteboard and chalkboard themes include a grid pattern on the background. This pattern can be modified by setting the color, the distance between lines, and the line width, e.g. `{ color: 'rgb(127,127,255,0.1)', distance: 40, width: 2}`. Alternatively, the grid can be removed by setting the value to `false`.
102
+ - `eraser`: An image path and radius for the eraser.
103
+ - `boardmarkers`: A list of boardmarkers with given color and cursor.
104
+ - `chalks`: A list of chalks with given color and cursor.
105
+ - `rememberColor`: Whether to remember the last selected color for the slide canvas or the board.
95
106
 
96
107
  All of the configurations are optional and the default values shown below are used if the options are not provided.
97
108
 
98
109
  ```javascript
99
110
  Reveal.initialize({
100
111
  // ...
101
- chalkboard: {
102
- src: null,
103
- readOnly: undefined,
104
- toggleChalkboardButton: { left: "30px", bottom: "30px", top: "auto", right: "auto" },
105
- toggleNotesButton: { left: "30px", bottom: "30px", top: "auto", right: "auto" },
106
- transition: 800,
107
- theme: "chalkboard",
108
- // configuration options for notes canvas and chalkboard
109
- color: [ 'rgba(0,0,255,1)', 'rgba(255,255,255,0.5)' ],
110
- background: [ 'rgba(127,127,127,.1)' , 'reveal.js-plugins/chalkboard/img/blackboard.png' ],
111
- pen: [ 'url(reveal.js-plugins/chalkboard/img/boardmarker.png), auto', 'url(reveal.js-plugins/chalkboard/img/chalk.png), auto' ],
112
- },
113
- // ...
112
+ chalkboard: {
113
+ boardmarkerWidth: 3,
114
+ chalkWidth: 7,
115
+ chalkEffect: 1.0,
116
+ storage: null,
117
+ src: null,
118
+ readOnly: false,
119
+ messageType: 'broadcast',
120
+ toggleChalkboardButton: { left: "30px", bottom: "30px", top: "auto", right: "auto" },
121
+ toggleNotesButton: { left: "30px", bottom: "30px", top: "auto", right: "auto" },
122
+ colorButtons: true,
123
+ boardHandle: true,
124
+ transition: 800,
125
+ theme: "chalkboard",
126
+ background: [ 'rgba(127,127,127,.1)' , path + 'img/blackboard.png' ],
127
+ grid: { color: 'rgb(50,50,10,0.5)', distance: 80, width: 2},
128
+ eraser: { src: path + 'img/sponge.png', radius: 20},
129
+ boardmarkers : [
130
+ { color: 'rgba(100,100,100,1)', cursor: 'url(' + path + 'img/boardmarker-black.png), auto'},
131
+ { color: 'rgba(30,144,255, 1)', cursor: 'url(' + path + 'img/boardmarker-blue.png), auto'},
132
+ { color: 'rgba(220,20,60,1)', cursor: 'url(' + path + 'img/boardmarker-red.png), auto'},
133
+ { color: 'rgba(50,205,50,1)', cursor: 'url(' + path + 'img/boardmarker-green.png), auto'},
134
+ { color: 'rgba(255,140,0,1)', cursor: 'url(' + path + 'img/boardmarker-orange.png), auto'},
135
+ { color: 'rgba(150,0,20150,1)', cursor: 'url(' + path + 'img/boardmarker-purple.png), auto'},
136
+ { color: 'rgba(255,220,0,1)', cursor: 'url(' + path + 'img/boardmarker-yellow.png), auto'}
137
+ ],
138
+ chalks: [
139
+ { color: 'rgba(255,255,255,0.5)', cursor: 'url(' + path + 'img/chalk-white.png), auto'},
140
+ { color: 'rgba(96, 154, 244, 0.5)', cursor: 'url(' + path + 'img/chalk-blue.png), auto'},
141
+ { color: 'rgba(237, 20, 28, 0.5)', cursor: 'url(' + path + 'img/chalk-red.png), auto'},
142
+ { color: 'rgba(20, 237, 28, 0.5)', cursor: 'url(' + path + 'img/chalk-green.png), auto'},
143
+ { color: 'rgba(220, 133, 41, 0.5)', cursor: 'url(' + path + 'img/chalk-orange.png), auto'},
144
+ { color: 'rgba(220,0,220,0.5)', cursor: 'url(' + path + 'img/chalk-purple.png), auto'},
145
+ { color: 'rgba(255,220,0,0.5)', cursor: 'url(' + path + 'img/chalk-yellow.png), auto'}
146
+ ]
147
+ },
148
+ // ...
114
149
 
115
150
  });
116
151
  ```
117
152
 
118
- **Note:** Customisation of pens has changed since version 0.5 of the plugin, it is now possible to use standard cursors, e.g. by setting ```pen: [ 'crosshair', 'pointer' ]```. Please update your parameters if migrating from an older version.
119
-
120
153
  ## License
121
154
 
122
155
  MIT licensed
123
156
 
124
- Copyright (C) 2016 Asvin Goel
157
+ Copyright (C) 2021 Asvin Goel