update syntax highlight after editing (#210), move markdown and highlight scripts from lib to plugin
This commit is contained in:
		| @@ -356,14 +356,15 @@ function linkify( selector ) { | |||||||
|  |  | ||||||
| 				// Optional libraries used to extend on reveal.js | 				// Optional libraries used to extend on reveal.js | ||||||
| 				dependencies: [ | 				dependencies: [ | ||||||
| 					{ src: 'lib/js/highlight.js', async: true, callback: function() { window.hljs.initHighlightingOnLoad(); } }, |  | ||||||
| 					{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, | 					{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, | ||||||
| 					{ src: 'lib/js/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, | 					{ src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, | ||||||
| 					{ src: 'lib/js/data-markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, | 					{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, | ||||||
|  | 					{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, | ||||||
| 					{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, | 					{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, | ||||||
| 					{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } | 					{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } | ||||||
| 				] | 				] | ||||||
| 			}); | 			}); | ||||||
|  |  | ||||||
| 		</script> | 		</script> | ||||||
|  |  | ||||||
| 	</body> | 	</body> | ||||||
|   | |||||||
| @@ -1,3 +1,12 @@ | |||||||
|  | // START CUSTOM REVEAL.JS INTEGRATION
 | ||||||
|  | [].slice.call( document.querySelectorAll( 'pre code' ) ).forEach( function( element ) { | ||||||
|  | 	element.addEventListener( 'focusout', function( event ) { | ||||||
|  | 		hljs.highlightBlock( event.currentTarget ); | ||||||
|  | 	}, false ); | ||||||
|  | } ); | ||||||
|  | // END CUSTOM REVEAL.JS INTEGRATION
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| /* | /* | ||||||
| Syntax highlighting with language autodetection. | Syntax highlighting with language autodetection. | ||||||
| http://softwaremaniacs.org/soft/highlight/
 | http://softwaremaniacs.org/soft/highlight/
 | ||||||
| @@ -2,6 +2,10 @@ | |||||||
| // Modified by Hakim to handle Markdown indented with tabs
 | // Modified by Hakim to handle Markdown indented with tabs
 | ||||||
| (function(){ | (function(){ | ||||||
| 
 | 
 | ||||||
|  |     if( typeof Showdown === 'undefined' ) { | ||||||
|  |         throw 'The reveal.js Markdown plugin requires Showdown to be loaded'; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     var sections = document.querySelectorAll( '[data-markdown]' ); |     var sections = document.querySelectorAll( '[data-markdown]' ); | ||||||
| 
 | 
 | ||||||
|     for( var i = 0, len = sections.length; i < len; i++ ) { |     for( var i = 0, len = sections.length; i < len; i++ ) { | ||||||
		Reference in New Issue
	
	Block a user