GithubHelp home page GithubHelp logo

githubpages-multimarkdown-jquery's Introduction

githubpages-multimarkdown-jquery

github pages converted with multimarkdown using javascript

demo: https://bbirdiman.github.io/githubpages-multimarkdown-javascript.html

github pages is a great place to store light-markup text-files, because you get version-control, and (mainly) it's cost-free.

i've looked around quite a bit, and as far as i can tell, multimarkdown is the best markdown flavor around.

its biggest problem is that multimarkdown doesn't have a converter-routine written in javascript.

fortunately, the ever-clever brett terpstra created "marky" -- http://heckyesmarkdown.com -- a webservice geared to back-converting existing .html into markdown.

even better, though, marky can also convert markdown into .html, and it uses multimarkdown to do that conversion.

and, because brett is really smart, marky has an a.p.i.

so you can use javascript to send your .mmd text to marky, and have it returned as multimarkdown-converted .html.

so all you kids making markdown editors these days should be using marky (and multimarkdown) to do your conversions.

appended is a sample .html file, with the code boiled down to a simple minimum. let's not bother with a "license", and just call it good old plain old public domain, dedicated to making the world a better place.

obviously, i have taken this idea much further, so if you would like me to post more, send me some of that star love.

<!doctype html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>
githubpages-multimarkdown-javascript skeleton
</title>
<script src=http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js>&lt;/script>
</head>
<body style=margin:0;padding:0>
<button onclick=dogetgithub() id=getgithub style=width:20%;height:60px>get github</button>
<button onclick=domarky() id=marky style=width:20%;height:60px>do marky</button><br>
<textarea id=thetext style=position:absolute;left:20px;top:66px;width:47%;bottom:0>http://fletcher.github.io/peg-multimarkdown/index.txt
</textarea>
<div id=thehtml style=position:absolute;margin:0;padding:0;padding-right:20px;left:54%;top:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto>
</div>
<script type=text/javascript>
function dogetgithub(){
var theurl=$("#thetext").val().trim()
if (theurl.substring(0,4) != "http"){theurl="http://fletcher.github.io/peg-multimarkdown/index.txt"}
$.ajaxSetup({cache:false})
$.ajax({
url: theurl,
dataType: 'text',
fail: function(data){$("#thetext").val(" fail! ");document.title=" fail! "},
success: function(data){$("#thetext").val(data)}
})
}</script>
<script type=text/javascript>
function domarky(){
$("#thehtml").html("calling marky...")
var result=""
var convertthis=$("#thetext").val() convertthis=convertthis.replace(/\c/g,"ZZZZ") convertthis=convertthis.replace("TextMate-prefs.png","https://bbirdiman.github.io/TextMate-prefs.png") $.ajaxSetup({cache:false})
$.post("http://heckyesmarkdown.com/go/",{domarkdown:1,text:convertthis,},function(result){
result=result.replace(/ZZZZ/g,"\c") $("#thehtml").html(result)
})
}</script>
</body>
</html>

that is all.

githubpages-multimarkdown-jquery's People

Contributors

bbirdiman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.