Revisions
-
Digitalsabre revised this gist
Feb 24, 2012 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,9 +18,11 @@ So the idea is you're operating in an HTML environment but a few shortcuts would ## This is a level two header (h2) * This is a list item (li) inside an unordered list (ul) * This is a list item inside the same unordered list. It contains an anchor tag (a) here --> [Some Link](http://www.example.com/) * This is another list item inside the same unordered list. 1. This list item is inside another list, this time ordered (ol), nested inside the previous list item, nested inside the previous unordered list. > Here's a blockquote with some **“stylistically offset” text.** </section> -
Digitalsabre revised this gist
Feb 24, 2012 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,12 +15,12 @@ So the idea is you're operating in an HTML environment but a few shortcuts would ``` <div class="slide"> <section class="hbox" data-markdown> ## This is a level two header (h2) * This is a list item (li) inside an unordered list (ul) * This is a list item inside the same unordered list. It contains an anchor tag (a) here --> [Some Link](http://www.example.com/) * This is another list item inside the same unordered list. 1. This list item is inside another list, this time ordered (ol), nested inside the previous list item, nested inside the previous unordered list. > Here's a blockquote with some **“stylistically offset” text.** </section> -
Digitalsabre revised this gist
Nov 9, 2011 . 2 changed files with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ==UserScript== // @name *[data-markdown] // @version 2.0.2 // @description Use Markdown, sometimes, in your HTML. // @author Paul Irish <http://paulirish.com/> and others // @include * This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,4 +30,6 @@ So the idea is you're operating in an HTML environment but a few shortcuts would _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ Editorial: PageDown is a more reliable Markdown parser outside of Github than Github Flavored Markdown. Revision 2: Changed PageDown URL to https to fix "insecure content" notifications in secure pages. Hope it works... -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ var el; el = document.createElement("script"); el.type = "application/javascript"; el.src = "https://pagedown.googlecode.com/hg/Markdown.Converter.js"; document.body.appendChild(el); el = null; -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 0 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +0,0 @@ -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,8 @@ So the idea is you're operating in an HTML environment but a few shortcuts would * It automatically adds [PageDown's Markdown Converter](http://pagedown.googlecode.com/hg/Markdown.Converter.js) to every page. 2. Add `data-markdown` attributes to any tags where you're gonna use markdown within, like so: ``` <div class="slide"> <section class="hbox" data-markdown> ## This is an H2 -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 15 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,21 @@ So the idea is you're operating in an HTML environment but a few shortcuts would 1. Install this userscript (click the [`raw`](https://gist.github.com/raw/1350130/data-markdown.user.js) link for the user.js file below). * It automatically adds [PageDown's Markdown Converter](http://pagedown.googlecode.com/hg/Markdown.Converter.js) to every page. 2. Add `data-markdown` attributes to any tags where you're gonna use markdown within, like so: ```<div class="slide"> <section class="hbox" data-markdown> ## This is an H2 * This is an LI inside a UL * This is an LI inside the same UL. It contains an A here --> [Some Link](http://www.example.com/) * This is another LI inside the same UL. * This LI is inside another UL, nested inside the previous LI, nested inside the previous UL. > Here's a blockquote with some **“stylistically offset” text.** </section> </div> ``` _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ -
Digitalsabre revised this gist
Nov 9, 2011 . 3 changed files with 14 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ // Thaddee Tyl <http://espadrine.github.com/> // Digitalsabre <https://github.com/Digitalsabre> // Félix Saparelli <http://passcod.net/> // The guys at StackExchange function X0() { if (!window.Markdown) { This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,12 @@ <div class="slide"> <section class="hbox" data-markdown> ## This is an H2 * This is an LI inside a UL * This is an LI inside the same UL. It contains an A here --> [Some Link](http://www.example.com/) * This is another LI inside the same UL. * This LI is inside another UL, nested inside the previous LI, nested inside the previous UL. > Here's a blockquote with some **“stylistically offset” text.** </section> </div> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,11 @@ So the idea is you're operating in an HTML environment but a few shortcuts would ### To use: 1. Install this userscript (click the [`raw`](https://gist.github.com/raw/1350130/data-markdown.user.js) link for the user.js file below). * It automatically adds [PageDown's Markdown Converter](http://pagedown.googlecode.com/hg/Markdown.Converter.js) to every page. 2. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example) _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ Editorial: PageDown is a more reliable Markdown parser outside of Github than Github Flavored Markdown. -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,12 +12,12 @@ // Félix Saparelli <http://passcod.net/> function X0() { if (!window.Markdown) { setTimeout(X0, 200); } else { [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code html = (new Markdown.Converter()).makeHtml(elem.textContent); // here, have sum HTML elem.innerHTML = html; @@ -29,7 +29,7 @@ var el; el = document.createElement("script"); el.type = "application/javascript"; el.src = "http://pagedown.googlecode.com/hg/Markdown.Converter.js"; document.body.appendChild(el); el = null; -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function X0() { } else { [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code html = (new Showdown.converter()).makeHtml(elem.textContent); // here, have sum HTML elem.innerHTML = html; -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function X0() { } else { [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code html = (new Showdown.converter()).makeHtml(elem.textcontent); // here, have sum HTML elem.innerHTML = html; -
Digitalsabre revised this gist
Nov 9, 2011 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,8 +17,7 @@ function X0() { } else { [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code html = (new Showdown.converter()).makeHtml(md); // here, have sum HTML elem.innerHTML = html; -
Félix Saparelli revised this gist
Nov 9, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ So the idea is you're operating in an HTML environment but a few shortcuts would ### To use: 1. Install this userscript (click [the 'raw' link for the user.js file below](https://gist.github.com/raw/1349945/data-markdown.user.js)). * It automatically adds [github flavored markdown's](https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js) to every page. 2. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example) -
Félix Saparelli revised this gist
Nov 9, 2011 . 2 changed files with 35 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,41 @@ // ==UserScript== // @name *[data-markdown] // @version 2.0 // @description Use Markdown, sometimes, in your HTML. // @author Paul Irish <http://paulirish.com/> and others // @include * // ==/UserScript== // Contribs: // Thaddee Tyl <http://espadrine.github.com/> // Digitalsabre <https://github.com/Digitalsabre> // Félix Saparelli <http://passcod.net/> function X0() { if (!window.Showdown) { setTimeout(X0, 200); } else { [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code var md = elem.textContent.replace(/(^\s+)|(\n\s+)/g,'\n') , html = (new Showdown.converter()).makeHtml(md); // here, have sum HTML elem.innerHTML = html; }); } } var el; el = document.createElement("script"); el.type = "application/javascript"; el.src = "https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js"; document.body.appendChild(el); el = null; el = document.createElement("script"); el.type = "application/javascript"; el.innerHTML = "(" + X0.toString() + ")();"; document.body.appendChild(el); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # *[data-markdown] userscript ## I just put some markdown in ur HTML @@ -8,13 +8,9 @@ So the idea is you're operating in an HTML environment but a few shortcuts would ### To use: 1. Install this userscript * It automatically adds [github flavored markdown's](https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js) if it's not already in. 2. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example) _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ -
paulirish revised this gist
Nov 7, 2011 . 2 changed files with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ // ==/UserScript== // If you're not using this as a userscript just delete from this line up. It's cool, homey. [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,9 @@ So the idea is you're operating in an HTML environment but a few shortcuts would * It automatically adds [github flavored markdown's](https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js) if it's not already in. 1. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example) #### Userscript or script-script This script works fine in your page and can also be used as a userscript. Just click the `raw` link right below to install. _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ -
paulirish revised this gist
Nov 7, 2011 . 3 changed files with 27 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ // ==UserScript== // @name Use Markdown, sometimes, in your HTML. // @author Paul Irish <http://paulirish.com/> // @link http://git.io/data-markdown // @match * // ==/UserScript== // this functions well [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ if (!window.Showdown) document.write('<script src="https://raw.github.com/github/' + 'github-flavored-markdown/gh-pages/scripts/showdown.js">\x3C/script>'); // strip leading whitespace so it isn't evaluated as code var md = elem.textContent.replace(/(^\s+)|(\n\s+)/g,'\n') , html = (new Showdown.converter()).makeHtml(md); // here, have sum HTML elem.innerHTML = html; }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,10 @@ So the idea is you're operating in an HTML environment but a few shortcuts would ### To use: 1. Add the following script into your HTML after the content, before other scripts * It automatically adds [github flavored markdown's](https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js) if it's not already in. 1. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example) * This script works fine in your page and can also be used as a userscript. Just click the `raw` link right below to install. _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ -
paulirish revised this gist
Nov 6, 2011 . 2 changed files with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,12 +2,15 @@ ## I just put some markdown in ur HTML In prototypes and HTML-based slide decks, it's pleasant to write in markdown sometimes and avoid all those angle brackets. So the idea is you're operating in an HTML environment but a few shortcuts would help so use markdown here and there. ### To use: 1. Drop in [github flavored markdown's](https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js) port of showdown.js into the page (after the content, before other scripts). 1. Add the following script after that. 1. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example) _(As this requires some clientside js and can trigger FOUC, this is not for production use)_ -
paulirish created this gist
Nov 6, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <div class="slide"> <section class="hbox" data-markdown> ## Who Am I? * Lead developer of [Modernizr](//modernizr.com) * Project lead of [HTML5 Boilerplate](//h5bp.com) * I curate that [page of polyfills](//bit.ly/polyfills) * Member of jQuery Team * Developer Relations on Google Chrome team </section> </div> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ [].forEach.call( document.querySelectorAll('[data-markdown]'), function(elem){ // strip leading whitespace so it isn't evaluated as code var md = elem.textContent.replace(/(^\s+)|(\n\s+)/g,'\n') , html = (new Showdown.converter()).makeHtml(md); // here, have sum HTML elem.innerHTML = html; }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ # *[data-markdown] ## I just put some markdown in ur HTML In prototypes and HTML-based slide decks, it's pleasant to write in markdown sometimes. (This is not for production use.) So the idea is you're operating in an HTML environment but a few shortcuts would help so use markdown here and there. ### To use: 1. Drop in [github flavored markdown's](https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js) port of showdown.js into the page (after the content, before other scripts). 1. Add the following script after that. 1. Add `data-markdown` attributes to any tags where you're gonna use markdown within. (see example)