scholdoc-0.1.3: tryscholdoc/index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dingus | ScholarlyMarkdown</title>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript">
(function($) { // http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values
$.QueryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
return b;
})(window.location.search.substr(1).split('&'))
})(jQuery);
function newpage() {
var from = "markdown_scholarly";
var input = $("#text").val();
var to = $("#to").val();
var href = window.location.href;
window.location.href = href.replace(/([?].*)?$/,"?" + $.param({text: input, from: from, to: to}));
};
function process(res) {
$("#results").text(res.result);
$("#version").text(res.version);
}
$(document).ready(function() {
var from = "markdown_scholarly";
var text = $.QueryString["text"];
$("#text").val(text);
var to = $.QueryString["to"] || "html5";
$("#to").val(to);
if (text && text != "") {
$.getJSON("http://scholarlymarkdown.com/cgi-bin/tryscholdoc", { from: from, to: to, text: text }, process);
};
$("#convert").click(newpage);
});
</script>
<style type="text/css">
h1 { margin-bottom: 1em; }
body { margin: auto; }
textarea { height: auto; width: 100%; font-family: monospace; margin-top: 15px; }
div.alert { margin: 1em; }
h3 { margin-top: 0; margin-bottom: 0; padding: 0; font-size: 100%; }
pre#results { width: 100%; margin-top: 15px; }
footer { color: #555; text-align: center; margin: 1em; }
p.version { color: #555; }
button#convert { vertical-align: bottom; }
</style>
</head>
<body>
<div class="container">
<div class="row">
<h1>ScholarlyMarkdown Dingus</h1>
</div>
<div class="row">
<div class="col-md-6">
<label for="from">
ScholarlyMarkdown source
</label>
<br/>
<textarea id="text" maxlength="3000" rows="15" placeholder="Type ScholarlyMarkdown here, then press the Convert button on the right"></textarea>
</div>
<div class="col-md-6">
<label for="to">
to
</label>
<select id="to">
<option value="html5" selected>HTML 5</option>
<option value="latex">LaTeX</option>
<option value="beamer">LaTeX Beamer</option>
</select>
<button class="btn btn-primary btn-xs" id="convert">Convert</button>
<br/>
<pre id="results"></pre>
</div>
</div>
</div>
<footer>
<p class="version">Using scholdoc <span id="version"></span></p>
<p>© 2014 <a href="https://github.com/timtylin/">Tim T.Y. Lin</a></p>
based on trypandoc <p>© 2013–2014 <a href="http://johnmacfarlane.net">John MacFarlane</a></p>
</footer>
</body>
</html>