18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
37 |
38 |
39 |
55 |
56 |
57 |
70 |
71 |
72 |
78 |
79 |
80 |
87 |
88 |
89 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/plugin/markdown/example.md:
--------------------------------------------------------------------------------
1 | # Markdown Demo
2 |
3 |
4 |
5 | ## External 1.1
6 |
7 | Content 1.1
8 |
9 | Note: This will only appear in the speaker notes window.
10 |
11 |
12 | ## External 1.2
13 |
14 | Content 1.2
15 |
16 |
17 |
18 | ## External 2
19 |
20 | Content 2.1
21 |
22 |
23 |
24 | ## External 3.1
25 |
26 | Content 3.1
27 |
28 |
29 | ## External 3.2
30 |
31 | Content 3.2
32 |
--------------------------------------------------------------------------------
/plugin/math/math.js:
--------------------------------------------------------------------------------
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://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/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 | })();
68 |
--------------------------------------------------------------------------------
/plugin/multiplex/client.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var multiplex = Reveal.getConfig().multiplex;
3 | var socketId = multiplex.id;
4 | var socket = io.connect(multiplex.url);
5 |
6 | socket.on(multiplex.id, function(data) {
7 | // ignore data from sockets that aren't ours
8 | if (data.socketId !== socketId) { return; }
9 | if( window.location.host === 'localhost:1947' ) return;
10 |
11 | Reveal.setState(data.state);
12 | });
13 | }());
14 |
--------------------------------------------------------------------------------
/plugin/multiplex/index.js:
--------------------------------------------------------------------------------
1 | var http = require('http');
2 | var express = require('express');
3 | var fs = require('fs');
4 | var io = require('socket.io');
5 | var crypto = require('crypto');
6 |
7 | var app = express();
8 | var staticDir = express.static;
9 | var server = http.createServer(app);
10 |
11 | io = io(server);
12 |
13 | var opts = {
14 | port: process.env.PORT || 1948,
15 | baseDir : __dirname + '/../../'
16 | };
17 |
18 | io.on( 'connection', function( socket ) {
19 | socket.on('multiplex-statechanged', function(data) {
20 | if (typeof data.secret == 'undefined' || data.secret == null || data.secret === '') return;
21 | if (createHash(data.secret) === data.socketId) {
22 | data.secret = null;
23 | socket.broadcast.emit(data.socketId, data);
24 | };
25 | });
26 | });
27 |
28 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) {
29 | app.use('/' + dir, staticDir(opts.baseDir + dir));
30 | });
31 |
32 | app.get("/", function(req, res) {
33 | res.writeHead(200, {'Content-Type': 'text/html'});
34 |
35 | var stream = fs.createReadStream(opts.baseDir + '/index.html');
36 | stream.on('error', function( error ) {
37 | res.write('