scateu.me-jekyll-theme 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/css/main.scss +56 -0
  3. data/feed.xml +30 -0
  4. data/index.html +22 -0
  5. data/js/.DS_Store +0 -0
  6. data/js/flowchart-latest.js +991 -0
  7. data/js/jquery-3.1.1.min.js +4 -0
  8. data/js/qrcode.min.js +1 -0
  9. data/js/raphael-min.js +11 -0
  10. data/js/reveal.js/.gitignore +13 -0
  11. data/js/reveal.js/.travis.yml +5 -0
  12. data/js/reveal.js/CONTRIBUTING.md +23 -0
  13. data/js/reveal.js/Gruntfile.js +176 -0
  14. data/js/reveal.js/LICENSE +19 -0
  15. data/js/reveal.js/README.md +1148 -0
  16. data/js/reveal.js/bower.json +27 -0
  17. data/js/reveal.js/css/print/paper.css +202 -0
  18. data/js/reveal.js/css/print/pdf.css +160 -0
  19. data/js/reveal.js/css/reveal.css +1344 -0
  20. data/js/reveal.js/css/reveal.scss +1412 -0
  21. data/js/reveal.js/css/theme/README.md +21 -0
  22. data/js/reveal.js/css/theme/beige.css +291 -0
  23. data/js/reveal.js/css/theme/black.css +287 -0
  24. data/js/reveal.js/css/theme/blood.css +310 -0
  25. data/js/reveal.js/css/theme/league.css +293 -0
  26. data/js/reveal.js/css/theme/moon.css +291 -0
  27. data/js/reveal.js/css/theme/night.css +285 -0
  28. data/js/reveal.js/css/theme/serif.css +287 -0
  29. data/js/reveal.js/css/theme/simple.css +287 -0
  30. data/js/reveal.js/css/theme/sky.css +294 -0
  31. data/js/reveal.js/css/theme/solarized.css +291 -0
  32. data/js/reveal.js/css/theme/source/beige.scss +39 -0
  33. data/js/reveal.js/css/theme/source/black.scss +49 -0
  34. data/js/reveal.js/css/theme/source/blood.scss +79 -0
  35. data/js/reveal.js/css/theme/source/league.scss +34 -0
  36. data/js/reveal.js/css/theme/source/moon.scss +57 -0
  37. data/js/reveal.js/css/theme/source/night.scss +35 -0
  38. data/js/reveal.js/css/theme/source/serif.scss +35 -0
  39. data/js/reveal.js/css/theme/source/simple.scss +38 -0
  40. data/js/reveal.js/css/theme/source/sky.scss +46 -0
  41. data/js/reveal.js/css/theme/source/solarized.scss +63 -0
  42. data/js/reveal.js/css/theme/source/white.scss +49 -0
  43. data/js/reveal.js/css/theme/template/mixins.scss +29 -0
  44. data/js/reveal.js/css/theme/template/settings.scss +43 -0
  45. data/js/reveal.js/css/theme/template/theme.scss +346 -0
  46. data/js/reveal.js/css/theme/white.css +287 -0
  47. data/js/reveal.js/demo.html +410 -0
  48. data/js/reveal.js/index.html +50 -0
  49. data/js/reveal.js/js/reveal.js +4744 -0
  50. data/js/reveal.js/lib/css/zenburn.css +80 -0
  51. data/js/reveal.js/lib/font/league-gothic/LICENSE +2 -0
  52. data/js/reveal.js/lib/font/league-gothic/league-gothic.css +10 -0
  53. data/js/reveal.js/lib/font/league-gothic/league-gothic.eot +0 -0
  54. data/js/reveal.js/lib/font/league-gothic/league-gothic.ttf +0 -0
  55. data/js/reveal.js/lib/font/league-gothic/league-gothic.woff +0 -0
  56. data/js/reveal.js/lib/font/source-sans-pro/LICENSE +45 -0
  57. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
  58. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
  59. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
  60. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
  61. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
  62. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
  63. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
  64. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
  65. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  66. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
  67. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
  68. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
  69. data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro.css +39 -0
  70. data/js/reveal.js/lib/js/classList.js +2 -0
  71. data/js/reveal.js/lib/js/head.min.js +9 -0
  72. data/js/reveal.js/lib/js/html5shiv.js +7 -0
  73. data/js/reveal.js/package.json +44 -0
  74. data/js/reveal.js/plugin/highlight/highlight.js +31 -0
  75. data/js/reveal.js/plugin/markdown/example.html +129 -0
  76. data/js/reveal.js/plugin/markdown/markdown.js +405 -0
  77. data/js/reveal.js/plugin/markdown/marked.js +6 -0
  78. data/js/reveal.js/plugin/math/math.js +67 -0
  79. data/js/reveal.js/plugin/multiplex/client.js +13 -0
  80. data/js/reveal.js/plugin/multiplex/index.js +64 -0
  81. data/js/reveal.js/plugin/multiplex/master.js +31 -0
  82. data/js/reveal.js/plugin/multiplex/package.json +19 -0
  83. data/js/reveal.js/plugin/notes-server/client.js +65 -0
  84. data/js/reveal.js/plugin/notes-server/index.js +69 -0
  85. data/js/reveal.js/plugin/notes-server/notes.html +407 -0
  86. data/js/reveal.js/plugin/notes/notes.html +414 -0
  87. data/js/reveal.js/plugin/notes/notes.js +136 -0
  88. data/js/reveal.js/plugin/print-pdf/print-pdf.js +48 -0
  89. data/js/reveal.js/plugin/search/search.js +196 -0
  90. data/js/reveal.js/plugin/zoom-js/zoom.js +278 -0
  91. data/js/reveal.js/test/examples/assets/image1.png +0 -0
  92. data/js/reveal.js/test/examples/assets/image2.png +0 -0
  93. data/js/reveal.js/test/examples/barebones.html +41 -0
  94. data/js/reveal.js/test/examples/embedded-media.html +49 -0
  95. data/js/reveal.js/test/examples/math.html +185 -0
  96. data/js/reveal.js/test/examples/slide-backgrounds.html +144 -0
  97. data/js/reveal.js/test/examples/slide-transitions.html +101 -0
  98. data/js/reveal.js/test/qunit-1.12.0.css +244 -0
  99. data/js/reveal.js/test/qunit-1.12.0.js +2212 -0
  100. data/js/reveal.js/test/test-markdown-element-attributes.html +134 -0
  101. data/js/reveal.js/test/test-markdown-element-attributes.js +46 -0
  102. data/js/reveal.js/test/test-markdown-slide-attributes.html +128 -0
  103. data/js/reveal.js/test/test-markdown-slide-attributes.js +47 -0
  104. data/js/reveal.js/test/test-markdown.html +52 -0
  105. data/js/reveal.js/test/test-markdown.js +15 -0
  106. data/js/reveal.js/test/test-pdf.html +83 -0
  107. data/js/reveal.js/test/test-pdf.js +15 -0
  108. data/js/reveal.js/test/test.html +86 -0
  109. data/js/reveal.js/test/test.js +597 -0
  110. data/js/sequence-diagram-min.js +8 -0
  111. data/js/underscore-min.js +1 -0
  112. metadata +111 -1
@@ -0,0 +1,405 @@
1
+ /**
2
+ * The reveal.js markdown plugin. Handles parsing of
3
+ * markdown inside of presentations as well as loading
4
+ * of external markdown documents.
5
+ */
6
+ (function( root, factory ) {
7
+ if (typeof define === 'function' && define.amd) {
8
+ root.marked = require( './marked' );
9
+ root.RevealMarkdown = factory( root.marked );
10
+ root.RevealMarkdown.initialize();
11
+ } else if( typeof exports === 'object' ) {
12
+ module.exports = factory( require( './marked' ) );
13
+ } else {
14
+ // Browser globals (root is window)
15
+ root.RevealMarkdown = factory( root.marked );
16
+ root.RevealMarkdown.initialize();
17
+ }
18
+ }( this, function( marked ) {
19
+
20
+ if( typeof marked === 'undefined' ) {
21
+ throw 'The reveal.js Markdown plugin requires marked to be loaded';
22
+ }
23
+
24
+ if( typeof hljs !== 'undefined' ) {
25
+ marked.setOptions({
26
+ highlight: function( lang, code ) {
27
+ return hljs.highlightAuto( lang, code ).value;
28
+ }
29
+ });
30
+ }
31
+
32
+ var DEFAULT_SLIDE_SEPARATOR = '^\r?\n---\r?\n$',
33
+ DEFAULT_NOTES_SEPARATOR = 'note:',
34
+ DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR = '\\\.element\\\s*?(.+?)$',
35
+ DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR = '\\\.slide:\\\s*?(\\\S.+?)$';
36
+
37
+ var SCRIPT_END_PLACEHOLDER = '__SCRIPT_END__';
38
+
39
+
40
+ /**
41
+ * Retrieves the markdown contents of a slide section
42
+ * element. Normalizes leading tabs/whitespace.
43
+ */
44
+ function getMarkdownFromSlide( section ) {
45
+
46
+ var template = section.querySelector( 'script' );
47
+
48
+ // strip leading whitespace so it isn't evaluated as code
49
+ var text = ( template || section ).textContent;
50
+
51
+ // restore script end tags
52
+ text = text.replace( new RegExp( SCRIPT_END_PLACEHOLDER, 'g' ), '</script>' );
53
+
54
+ var leadingWs = text.match( /^\n?(\s*)/ )[1].length,
55
+ leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
56
+
57
+ if( leadingTabs > 0 ) {
58
+ text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
59
+ }
60
+ else if( leadingWs > 1 ) {
61
+ text = text.replace( new RegExp('\\n? {' + leadingWs + '}', 'g'), '\n' );
62
+ }
63
+
64
+ return text;
65
+
66
+ }
67
+
68
+ /**
69
+ * Given a markdown slide section element, this will
70
+ * return all arguments that aren't related to markdown
71
+ * parsing. Used to forward any other user-defined arguments
72
+ * to the output markdown slide.
73
+ */
74
+ function getForwardedAttributes( section ) {
75
+
76
+ var attributes = section.attributes;
77
+ var result = [];
78
+
79
+ for( var i = 0, len = attributes.length; i < len; i++ ) {
80
+ var name = attributes[i].name,
81
+ value = attributes[i].value;
82
+
83
+ // disregard attributes that are used for markdown loading/parsing
84
+ if( /data\-(markdown|separator|vertical|notes)/gi.test( name ) ) continue;
85
+
86
+ if( value ) {
87
+ result.push( name + '="' + value + '"' );
88
+ }
89
+ else {
90
+ result.push( name );
91
+ }
92
+ }
93
+
94
+ return result.join( ' ' );
95
+
96
+ }
97
+
98
+ /**
99
+ * Inspects the given options and fills out default
100
+ * values for what's not defined.
101
+ */
102
+ function getSlidifyOptions( options ) {
103
+
104
+ options = options || {};
105
+ options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR;
106
+ options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR;
107
+ options.attributes = options.attributes || '';
108
+
109
+ return options;
110
+
111
+ }
112
+
113
+ /**
114
+ * Helper function for constructing a markdown slide.
115
+ */
116
+ function createMarkdownSlide( content, options ) {
117
+
118
+ options = getSlidifyOptions( options );
119
+
120
+ var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) );
121
+
122
+ if( notesMatch.length === 2 ) {
123
+ content = notesMatch[0] + '<aside class="notes">' + marked(notesMatch[1].trim()) + '</aside>';
124
+ }
125
+
126
+ // prevent script end tags in the content from interfering
127
+ // with parsing
128
+ content = content.replace( /<\/script>/g, SCRIPT_END_PLACEHOLDER );
129
+
130
+ return '<script type="text/template">' + content + '</script>';
131
+
132
+ }
133
+
134
+ /**
135
+ * Parses a data string into multiple slides based
136
+ * on the passed in separator arguments.
137
+ */
138
+ function slidify( markdown, options ) {
139
+
140
+ options = getSlidifyOptions( options );
141
+
142
+ var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ),
143
+ horizontalSeparatorRegex = new RegExp( options.separator );
144
+
145
+ var matches,
146
+ lastIndex = 0,
147
+ isHorizontal,
148
+ wasHorizontal = true,
149
+ content,
150
+ sectionStack = [];
151
+
152
+ // iterate until all blocks between separators are stacked up
153
+ while( matches = separatorRegex.exec( markdown ) ) {
154
+ notes = null;
155
+
156
+ // determine direction (horizontal by default)
157
+ isHorizontal = horizontalSeparatorRegex.test( matches[0] );
158
+
159
+ if( !isHorizontal && wasHorizontal ) {
160
+ // create vertical stack
161
+ sectionStack.push( [] );
162
+ }
163
+
164
+ // pluck slide content from markdown input
165
+ content = markdown.substring( lastIndex, matches.index );
166
+
167
+ if( isHorizontal && wasHorizontal ) {
168
+ // add to horizontal stack
169
+ sectionStack.push( content );
170
+ }
171
+ else {
172
+ // add to vertical stack
173
+ sectionStack[sectionStack.length-1].push( content );
174
+ }
175
+
176
+ lastIndex = separatorRegex.lastIndex;
177
+ wasHorizontal = isHorizontal;
178
+ }
179
+
180
+ // add the remaining slide
181
+ ( wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1] ).push( markdown.substring( lastIndex ) );
182
+
183
+ var markdownSections = '';
184
+
185
+ // flatten the hierarchical stack, and insert <section data-markdown> tags
186
+ for( var i = 0, len = sectionStack.length; i < len; i++ ) {
187
+ // vertical
188
+ if( sectionStack[i] instanceof Array ) {
189
+ markdownSections += '<section '+ options.attributes +'>';
190
+
191
+ sectionStack[i].forEach( function( child ) {
192
+ markdownSections += '<section data-markdown>' + createMarkdownSlide( child, options ) + '</section>';
193
+ } );
194
+
195
+ markdownSections += '</section>';
196
+ }
197
+ else {
198
+ markdownSections += '<section '+ options.attributes +' data-markdown>' + createMarkdownSlide( sectionStack[i], options ) + '</section>';
199
+ }
200
+ }
201
+
202
+ return markdownSections;
203
+
204
+ }
205
+
206
+ /**
207
+ * Parses any current data-markdown slides, splits
208
+ * multi-slide markdown into separate sections and
209
+ * handles loading of external markdown.
210
+ */
211
+ function processSlides() {
212
+
213
+ var sections = document.querySelectorAll( '[data-markdown]'),
214
+ section;
215
+
216
+ for( var i = 0, len = sections.length; i < len; i++ ) {
217
+
218
+ section = sections[i];
219
+
220
+ if( section.getAttribute( 'data-markdown' ).length ) {
221
+
222
+ var xhr = new XMLHttpRequest(),
223
+ url = section.getAttribute( 'data-markdown' );
224
+
225
+ datacharset = section.getAttribute( 'data-charset' );
226
+
227
+ // see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes
228
+ if( datacharset != null && datacharset != '' ) {
229
+ xhr.overrideMimeType( 'text/html; charset=' + datacharset );
230
+ }
231
+
232
+ xhr.onreadystatechange = function() {
233
+ if( xhr.readyState === 4 ) {
234
+ // file protocol yields status code 0 (useful for local debug, mobile applications etc.)
235
+ if ( ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status === 0 ) {
236
+
237
+ section.outerHTML = slidify( xhr.responseText, {
238
+ separator: section.getAttribute( 'data-separator' ),
239
+ verticalSeparator: section.getAttribute( 'data-separator-vertical' ),
240
+ notesSeparator: section.getAttribute( 'data-separator-notes' ),
241
+ attributes: getForwardedAttributes( section )
242
+ });
243
+
244
+ }
245
+ else {
246
+
247
+ section.outerHTML = '<section data-state="alert">' +
248
+ 'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' +
249
+ 'Check your browser\'s JavaScript console for more details.' +
250
+ '<p>Remember that you need to serve the presentation HTML from a HTTP server.</p>' +
251
+ '</section>';
252
+
253
+ }
254
+ }
255
+ };
256
+
257
+ xhr.open( 'GET', url, false );
258
+
259
+ try {
260
+ xhr.send();
261
+ }
262
+ catch ( e ) {
263
+ alert( 'Failed to get the Markdown file ' + url + '. Make sure that the presentation and the file are served by a HTTP server and the file can be found there. ' + e );
264
+ }
265
+
266
+ }
267
+ else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-separator-vertical' ) || section.getAttribute( 'data-separator-notes' ) ) {
268
+
269
+ section.outerHTML = slidify( getMarkdownFromSlide( section ), {
270
+ separator: section.getAttribute( 'data-separator' ),
271
+ verticalSeparator: section.getAttribute( 'data-separator-vertical' ),
272
+ notesSeparator: section.getAttribute( 'data-separator-notes' ),
273
+ attributes: getForwardedAttributes( section )
274
+ });
275
+
276
+ }
277
+ else {
278
+ section.innerHTML = createMarkdownSlide( getMarkdownFromSlide( section ) );
279
+ }
280
+ }
281
+
282
+ }
283
+
284
+ /**
285
+ * Check if a node value has the attributes pattern.
286
+ * If yes, extract it and add that value as one or several attributes
287
+ * the the terget element.
288
+ *
289
+ * You need Cache Killer on Chrome to see the effect on any FOM transformation
290
+ * directly on refresh (F5)
291
+ * http://stackoverflow.com/questions/5690269/disabling-chrome-cache-for-website-development/7000899#answer-11786277
292
+ */
293
+ function addAttributeInElement( node, elementTarget, separator ) {
294
+
295
+ var mardownClassesInElementsRegex = new RegExp( separator, 'mg' );
296
+ var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"=]+?)\"", 'mg' );
297
+ var nodeValue = node.nodeValue;
298
+ if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) {
299
+
300
+ var classes = matches[1];
301
+ nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( mardownClassesInElementsRegex.lastIndex );
302
+ node.nodeValue = nodeValue;
303
+ while( matchesClass = mardownClassRegex.exec( classes ) ) {
304
+ elementTarget.setAttribute( matchesClass[1], matchesClass[2] );
305
+ }
306
+ return true;
307
+ }
308
+ return false;
309
+ }
310
+
311
+ /**
312
+ * Add attributes to the parent element of a text node,
313
+ * or the element of an attribute node.
314
+ */
315
+ function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) {
316
+
317
+ if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) {
318
+ previousParentElement = element;
319
+ for( var i = 0; i < element.childNodes.length; i++ ) {
320
+ childElement = element.childNodes[i];
321
+ if ( i > 0 ) {
322
+ j = i - 1;
323
+ while ( j >= 0 ) {
324
+ aPreviousChildElement = element.childNodes[j];
325
+ if ( typeof aPreviousChildElement.setAttribute == 'function' && aPreviousChildElement.tagName != "BR" ) {
326
+ previousParentElement = aPreviousChildElement;
327
+ break;
328
+ }
329
+ j = j - 1;
330
+ }
331
+ }
332
+ parentSection = section;
333
+ if( childElement.nodeName == "section" ) {
334
+ parentSection = childElement ;
335
+ previousParentElement = childElement ;
336
+ }
337
+ if ( typeof childElement.setAttribute == 'function' || childElement.nodeType == Node.COMMENT_NODE ) {
338
+ addAttributes( parentSection, childElement, previousParentElement, separatorElementAttributes, separatorSectionAttributes );
339
+ }
340
+ }
341
+ }
342
+
343
+ if ( element.nodeType == Node.COMMENT_NODE ) {
344
+ if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) == false ) {
345
+ addAttributeInElement( element, section, separatorSectionAttributes );
346
+ }
347
+ }
348
+ }
349
+
350
+ /**
351
+ * Converts any current data-markdown slides in the
352
+ * DOM to HTML.
353
+ */
354
+ function convertSlides() {
355
+
356
+ var sections = document.querySelectorAll( '[data-markdown]');
357
+
358
+ for( var i = 0, len = sections.length; i < len; i++ ) {
359
+
360
+ var section = sections[i];
361
+
362
+ // Only parse the same slide once
363
+ if( !section.getAttribute( 'data-markdown-parsed' ) ) {
364
+
365
+ section.setAttribute( 'data-markdown-parsed', true )
366
+
367
+ var notes = section.querySelector( 'aside.notes' );
368
+ var markdown = getMarkdownFromSlide( section );
369
+
370
+ section.innerHTML = marked( markdown );
371
+ addAttributes( section, section, null, section.getAttribute( 'data-element-attributes' ) ||
372
+ section.parentNode.getAttribute( 'data-element-attributes' ) ||
373
+ DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR,
374
+ section.getAttribute( 'data-attributes' ) ||
375
+ section.parentNode.getAttribute( 'data-attributes' ) ||
376
+ DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR);
377
+
378
+ // If there were notes, we need to re-add them after
379
+ // having overwritten the section's HTML
380
+ if( notes ) {
381
+ section.appendChild( notes );
382
+ }
383
+
384
+ }
385
+
386
+ }
387
+
388
+ }
389
+
390
+ // API
391
+ return {
392
+
393
+ initialize: function() {
394
+ processSlides();
395
+ convertSlides();
396
+ },
397
+
398
+ // TODO: Do these belong in the API?
399
+ processSlides: processSlides,
400
+ convertSlides: convertSlides,
401
+ slidify: slidify
402
+
403
+ };
404
+
405
+ }));
@@ -0,0 +1,6 @@
1
+ /**
2
+ * marked - a markdown parser
3
+ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
4
+ * https://github.com/chjj/marked
5
+ */
6
+ (function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.rules=this.options.tables?p.tables:p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?u.breaks:u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?String.fromCharCode("x"===t.charAt(1)?parseInt(t.substring(2),16):+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function a(t,n,i){if(i||"function"==typeof n){i||(i=n,n=null),n=h({},a.defaults,n||{});var l,o,p=n.highlight,u=0;try{l=e.lex(t,n)}catch(c){return i(c)}o=l.length;var g=function(e){if(e)return n.highlight=p,i(e);var t;try{t=r.parse(l,n)}catch(s){e=s}return n.highlight=p,e?i(e):i(null,t)};if(!p||p.length<3)return g();if(delete n.highlight,!o)return g();for(;u<l.length;u++)!function(e){return"code"!==e.type?--o||g():p(e.text,e.lang,function(t,n){return t?g(t):null==n||n===e.text?--o||g():(e.text=n,e.escaped=!0,void(--o||g()))})}(l[u])}else try{return n&&(n=h({},a.defaults,n)),r.parse(e.lex(t,n),n)}catch(c){if(c.message+="\nPlease report this to https://github.com/chjj/marked.",(n||a.defaults).silent)return"<p>An error occured:</p><pre>"+s(c.message+"",!0)+"</pre>";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<h.align.length;u++)h.align[u]=/^ *-+: *$/.test(h.align[u])?"right":/^ *:-+: *$/.test(h.align[u])?"center":/^ *:-+ *$/.test(h.align[u])?"left":null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].split(/ *\| */);this.tokens.push(h)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===i[1]||"script"===i[1]||"style"===i[1],text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<h.align.length;u++)h.align[u]=/^ *-+: *$/.test(h.align[u])?"right":/^ *:-+: *$/.test(h.align[u])?"center":/^ *:-+ *$/.test(h.align[u])?"left":null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(h)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var u={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};u._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,u._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=this.mangle(":"===i[1].charAt(6)?i[1].substring(7):i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=s(this.smartypants(i[0]));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+s(t,!0)+'">'+(n?e:s(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:s(e,!0))+"\n</code></pre>"},n.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},n.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},n.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},n.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},n.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},n.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},n.prototype.strong=function(e){return"<strong>"+e+"</strong>"},n.prototype.em=function(e){return"<em>"+e+"</em>"},n.prototype.codespan=function(e){return"<code>"+e+"</code>"},n.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.prototype.del=function(e){return"<del>"+e+"</del>"},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='<a href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"},n.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",s=0;s<t.length;s++)n+=this.renderer.tablecell(this.inline.output(t[s]),{header:!1,align:this.token.align[s]});l+=this.renderer.tablerow(n)}return this.renderer.table(i,l);case"blockquote_start":for(var l="";"blockquote_end"!==this.next().type;)l+=this.tok();return this.renderer.blockquote(l);case"list_start":for(var l="",o=this.token.ordered;"list_end"!==this.next().type;)l+=this.tok();return this.renderer.list(l,o);case"list_item_start":for(var l="";"list_item_end"!==this.next().type;)l+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(l);case"loose_item_start":for(var l="";"list_item_end"!==this.next().type;)l+=this.tok();return this.renderer.listitem(l);case"html":var h=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(h);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},o.exec=o,a.options=a.setOptions=function(e){return h(a.defaults,e),a},a.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new n,xhtml:!1},a.Parser=r,a.parser=r.parse,a.Renderer=n,a.Lexer=e,a.lexer=e.lex,a.InlineLexer=t,a.inlineLexer=t.output,a.parse=a,"undefined"!=typeof module&&"object"==typeof exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):this.marked=a}).call(function(){return this||("undefined"!=typeof window?window:global)}());
@@ -0,0 +1,67 @@
1
+ /**
2
+ * A plugin which enables rendering of math equations inside
3
+ * of reveal.js slides. Essentially a thin wrapper for MathJax.
4
+ *
5
+ * @author Hakim El Hattab
6
+ */
7
+ var RevealMath = window.RevealMath || (function(){
8
+
9
+ var options = Reveal.getConfig().math || {};
10
+ options.mathjax = options.mathjax || 'https://cdn.mathjax.org/mathjax/latest/MathJax.js';
11
+ options.config = options.config || 'TeX-AMS_HTML-full';
12
+
13
+ loadScript( options.mathjax + '?config=' + options.config, function() {
14
+
15
+ MathJax.Hub.Config({
16
+ messageStyle: 'none',
17
+ tex2jax: {
18
+ inlineMath: [['$','$'],['\\(','\\)']] ,
19
+ skipTags: ['script','noscript','style','textarea','pre']
20
+ },
21
+ skipStartupTypeset: true
22
+ });
23
+
24
+ // Typeset followed by an immediate reveal.js layout since
25
+ // the typesetting process could affect slide height
26
+ MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] );
27
+ MathJax.Hub.Queue( Reveal.layout );
28
+
29
+ // Reprocess equations in slides when they turn visible
30
+ Reveal.addEventListener( 'slidechanged', function( event ) {
31
+
32
+ MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] );
33
+
34
+ } );
35
+
36
+ } );
37
+
38
+ function loadScript( url, callback ) {
39
+
40
+ var head = document.querySelector( 'head' );
41
+ var script = document.createElement( 'script' );
42
+ script.type = 'text/javascript';
43
+ script.src = url;
44
+
45
+ // Wrapper for callback to make sure it only fires once
46
+ var finish = function() {
47
+ if( typeof callback === 'function' ) {
48
+ callback.call();
49
+ callback = null;
50
+ }
51
+ }
52
+
53
+ script.onload = finish;
54
+
55
+ // IE
56
+ script.onreadystatechange = function() {
57
+ if ( this.readyState === 'loaded' ) {
58
+ finish();
59
+ }
60
+ }
61
+
62
+ // Normal browsers
63
+ head.appendChild( script );
64
+
65
+ }
66
+
67
+ })();