Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
142 lines (102 sloc) 2.9 KB
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>Kramdown Demo</title>
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/github.min.css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/github-markdown.css">
</head>
<body>
<div id="input">
<div id="editor"># Please Note:
This is an unofficial kramdown sandbox, the official complete documentation for [kramdown](https://github.com/gettalong/kramdown/) is [here](http://kramdown.rubyforge.org/).
-----
### Code
This demo uses [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) to enable client-side syntax highlighting
`inline` or as a block (auto detect language):
~~~
def ruby
puts "ruby"
end
~~~
~~~
def hello():
print "python"
~~~
Force language:
~~~ javascript
function hello() {
alert("Javascript");
}
~~~
----
### Lists
1. One
2. Two
3. Three
* Lorem
* Ipsum
* Dolar
* Etc.
* Dolar
Example
: Meep
: Meep
----
### LaTeX
Using [MathJax](http://www.mathjax.org/).
Inline: $$ \varphi = \frac{1+\sqrt{5}}{2} = 1.61803\,39887\ldots. $$
Block:
$$
\int_0^{2\pi}\sin{x}\ dx=0
$$
----
### Tables
| Header1 | Header2 | Header3 |
|:--------|:-------:|--------:|
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
|----
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
|=====
| Foot1 | Foot2 | Foot3
{: rules="groups"}
etc.
</div>
</div>
<div id="output">
</div>
<script language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="/js/lib/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
<script>
$(function() {
var editor = ace.edit("editor"), editorSession = editor.getSession();
editor.setTheme("ace/theme/monokai");
editorSession.setMode("ace/mode/markdown");
editorSession.setTabSize(4);
editorSession.setUseSoftTabs(true);
editorSession.setUseWrapMode(true);
editor.setShowPrintMargin(false);
editor.setShowFoldWidgets(false);
editor.setFontSize(14);
var editorChangeEvent = function() {
$.post('/', { text: editor.getValue() }, function(data) {
$('#output').html(data);
$('pre code').each(function(i, e) { hljs.highlightBlock(e) });
MathJax.Hub.Queue(['Typeset', MathJax.Hub, document.getElementById('output')]);
});
}
editorSession.on('change', editorChangeEvent);
editorChangeEvent();
editorSession.on('changeScrollTop', function(scrollTop) {
$("#output").scrollTop(scrollTop);
});
});
</script>
</body>
</html>
Something went wrong with that request. Please try again.