From 1ed79b9df6e210868a017cb64db22ba7ad583c37 Mon Sep 17 00:00:00 2001
From: Hakim El Hattab
Date: Fri, 28 Sep 2012 09:28:06 -0400
Subject: minified version of showdown
---
lib/js/data-markdown.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib/js/data-markdown.js')
diff --git a/lib/js/data-markdown.js b/lib/js/data-markdown.js
index b10592a..84398a0 100644
--- a/lib/js/data-markdown.js
+++ b/lib/js/data-markdown.js
@@ -1,5 +1,5 @@
// From https://gist.github.com/1343518
-// Modified by Hakim to handle markdown indented with tabs
+// Modified by Hakim to handle Markdown indented with tabs
(function(){
var slides = document.querySelectorAll('[data-markdown]');
--
cgit v1.2.3
From 25efef8c4f1275db62925ed18bab7282a5b767b2 Mon Sep 17 00:00:00 2001
From: Hakim El Hattab
Date: Mon, 8 Oct 2012 09:15:36 -0400
Subject: wrap markdown in script text/template to fix parsing errors (closes
#146 #155 #162)
---
README.md | 12 +++++++-----
index.html | 21 ++++++++++++---------
lib/js/data-markdown.js | 13 +++++++------
3 files changed, 26 insertions(+), 20 deletions(-)
(limited to 'lib/js/data-markdown.js')
diff --git a/README.md b/README.md
index 5ad4a8a..8511f90 100644
--- a/README.md
+++ b/README.md
@@ -35,15 +35,17 @@ Markup heirarchy needs to be ``
``` elements and reveal.js will automatically load the JavaScript parser.
+It's possible to write your slides using Markdown. To enable Markdown simply add the ```data-markdown``` attribute to your `````` elements and reveal.js will automatically load the JavaScript parser. Additionally, you should wrap the contents in a ```
```
diff --git a/index.html b/index.html
index b5625c9..ce10815 100644
--- a/index.html
+++ b/index.html
@@ -36,6 +36,7 @@
+
Reveal.js
HTML Presentations Made Easy
@@ -129,17 +130,18 @@
- ## Markdown support
-
- For those of you who like that sort of thing. Instructions and a bit more info available [here](https://github.com/hakimel/reveal.js#markdown).
+
@@ -314,6 +316,7 @@ function linkify( selector ) {
THE END
BY Hakim El Hattab / hakim.se
+
diff --git a/lib/js/data-markdown.js b/lib/js/data-markdown.js
index 84398a0..80f8eb0 100644
--- a/lib/js/data-markdown.js
+++ b/lib/js/data-markdown.js
@@ -2,13 +2,15 @@
// Modified by Hakim to handle Markdown indented with tabs
(function(){
- var slides = document.querySelectorAll('[data-markdown]');
+ var sections = document.querySelectorAll( '[data-markdown]' );
- for( var i = 0, len = slides.length; i < len; i++ ) {
- var elem = slides[i];
+ for( var i = 0, len = sections.length; i < len; i++ ) {
+ var section = sections[i];
+
+ var template = section.querySelector( 'script' );
// strip leading whitespace so it isn't evaluated as code
- var text = elem.innerHTML;
+ var text = ( template || section ).innerHTML;
var leadingWs = text.match(/^\n?(\s*)/)[1].length,
leadingTabs = text.match(/^\n?(\t*)/)[1].length;
@@ -20,8 +22,7 @@
text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' );
}
- // here, have sum HTML
- elem.innerHTML = (new Showdown.converter()).makeHtml(text);
+ section.innerHTML = (new Showdown.converter()).makeHtml(text);
}
})();
\ No newline at end of file
--
cgit v1.2.3
From e693717f2aa2d65f8f0cf6412a01084280fc2c9a Mon Sep 17 00:00:00 2001
From: Hakim El Hattab
Date: Sun, 28 Oct 2012 18:09:54 -0400
Subject: update syntax highlight after editing (#210), move markdown and
highlight scripts from lib to plugin
---
index.html | 7 ++---
lib/js/data-markdown.js | 28 -------------------
lib/js/highlight.js | 5 ----
lib/js/showdown.js | 62 -------------------------------------------
plugin/highlight/highlight.js | 14 ++++++++++
plugin/markdown/markdown.js | 32 ++++++++++++++++++++++
plugin/markdown/showdown.js | 62 +++++++++++++++++++++++++++++++++++++++++++
7 files changed, 112 insertions(+), 98 deletions(-)
delete mode 100644 lib/js/data-markdown.js
delete mode 100644 lib/js/highlight.js
delete mode 100644 lib/js/showdown.js
create mode 100644 plugin/highlight/highlight.js
create mode 100644 plugin/markdown/markdown.js
create mode 100644 plugin/markdown/showdown.js
(limited to 'lib/js/data-markdown.js')
diff --git a/index.html b/index.html
index 45029b5..89398c1 100644
--- a/index.html
+++ b/index.html
@@ -356,14 +356,15 @@ function linkify( selector ) {
// Optional libraries used to extend on reveal.js
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/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/showdown.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/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
+