I am trying to load a Markdown editor like the one StackExchange uses on it's site into the Forrst.com site with a Bookmarklet or Browser Extension.
Basically it looks like I need...
Load the CSS file into the Page
https://raw.github.com/ujifgc/pagedown/master/demo/browser/demo.cssLoad these 3 Javascript files into the page
https://raw.github.com/ujifgc/pagedown/master/Markdown.Converter.js
https://raw.github.com/ujifgc/pagedown/master/Markdown.Editor.js
https://raw.github.com/ujifgc/pagedown/master/Markdown.Sanitizer.jsLoad this Javascript into the page to make it all run...
//Load and run this code in the page...
// Find and replace the curent textarea with the HTML we
// need for our markdown editor to work
var htmlToReplace = ' \
<div class="wmd-panel"> \
<div id="wmd-button-bar"></div> \
<textarea class="wmd-input" id="wmd-input" name="description"></textarea> \
</div> \
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>';
$("#description").replaceWith(htmlToReplace)
//Run the markdown editor scripts
(function () {
var converter1 = Markdown.getSanitizingConverter();
var editor1 = new Markdown.Editor(converter1);
editor1.run();
})();
If anyone could point me in the right direction on how to accomplish something like this, I believe it's possible I would really appreciate the help