Skip to content

Commit

Permalink
Use runtime renderer in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Jul 8, 2015
1 parent 7bde2c7 commit 8213e30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ var ContentKitDemo = exports.ContentKitDemo = {
var codePaneJSON = document.getElementById('serialized-mobiledoc');
var json = editor.serialize();
codePaneJSON.innerHTML = this.syntaxHighlight(json);

var renderer = new ContentKit.Runtime.DOMRenderer();
var rendered = renderer.render(json);

$('#rendered-mobiledoc').empty();
$('#rendered-mobiledoc')[0].appendChild(rendered);
},

syntaxHighlight: function(json) {
Expand Down
3 changes: 3 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ <h2>mobiledoc to load</h2>
[
[],
[
[1, "H2", [
[[], 0, "hello world"]
]],
[1, "P", [
[[], 0, "hello world"]
]]
Expand Down
4 changes: 3 additions & 1 deletion src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
EmbedModel,
Compiler,
HTMLParser,
HTMLRenderer
HTMLRenderer,
Runtime
} from 'content-kit-compiler';

import Editor from './editor/editor';
Expand All @@ -16,6 +17,7 @@ const ContentKit = {
Compiler,
HTMLParser,
HTMLRenderer,
Runtime,
Editor
};

Expand Down

0 comments on commit 8213e30

Please sign in to comment.