Skip to content

Instantly share code, notes, and snippets.

@jmyrland
Forked from jdkanani/notepad.html
Last active December 18, 2015 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmyrland/5713349 to your computer and use it in GitHub Desktop.
Save jmyrland/5713349 to your computer and use it in GitHub Desktop.
Real-time markdown editor/converter, with basic twitter bootstrap styles.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
CoffeeScript -> `ace/mode/coffee`
and
css, html, php, latex,
tex, sh, sql, lua, clojure, dart, typescript, go, groovy, json, jsp, less, lisp,
lucene, perl, powershell, scss, textile, xml, yaml, xquery, liquid, diff and many more...
---------------------------------------------------------------------------------------
For other theme: Instead of `ace/theme/monokai`, Use
Eclipse -> ace/theme/eclipse
GitHub -> ace/theme/github
TextMate -> ace/theme/textmate
and
ambiance, dawn, chaos, chrome, dreamweaver, xcode, vibrant_ink, solarized_dark, solarized_light, tomorrow, tomorrow_night, tomorrow_night_blue,
twilight, tomorrow_night_eighties, pastel_on_dark and many more..
-->
<!-- If you want a *real time* markdown converter use this : !-->
data:text/html,<style type="text/css">@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css'); .e{position:absolute;top:0;right:50%;bottom:0;left:0;} .c{position:absolute;overflow:auto;top:0;right:0;bottom:0;left:50%; padding: 30px;}</style><div class="e" id="editor"></div><div class="c"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script><script>function showResult(e) { consoleEl.innerHTML = e } var e = ace.edit("editor"); e.setTheme("ace/theme/monokai"); e.getSession().setMode("ace/mode/markdown"); e.setShowPrintMargin(false); var consoleEl = document.getElementsByClassName("c")[0]; var converter = new Showdown.converter; document.onkeyup = function() { showResult(converter.makeHtml(e.getValue())) }</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment