aboutsummaryrefslogtreecommitdiff
path: root/js/index.html
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-18 17:58:24 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-18 18:27:09 -0700
commit8b1a5abc80685c1caa2ca825e468902356989aa9 (patch)
tree0d0da50dc6b81a9fc216a079eca1b1081f6412bc /js/index.html
parentefff87ae0da05a94e8416ff090fdfcd5634c36a7 (diff)
Added renderAST to js, added AST render tab to dingus.
Modified processInlines so it creates new objects instead of modifying in place. This way we can remove the extraneous fields only needed for parsing.
Diffstat (limited to 'js/index.html')
-rw-r--r--js/index.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/index.html b/js/index.html
index 05fc216..fdd6a76 100644
--- a/js/index.html
+++ b/js/index.html
@@ -28,6 +28,7 @@ $(document).ready(function() {
// $("#html").text(result);
$("#preview").html(result);
$("#html").text(result);
+ $("#ast").text(stmd.ASTRenderer(parsed));
$("#rendertime").text(renderTime);
};
var parseAndRender = function () {
@@ -78,15 +79,16 @@ $(document).ready(function() {
<div class="col-md-6">
<h1>stmd.js dingus</h1>
</div>
- <div class="col-md-3">
+ <div class="col-md-4">
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#preview" role="tab" data-toggle="tab">Preview</a></li>
<li><a href="#result" role="tab" data-toggle="tab">HTML</a></li>
+ <li><a href="#result-ast" role="tab" data-toggle="tab">AST</a></li>
</ul>
</div>
- <div class="col-md-3">
- <p class="timing">Parsed in <span class="timing" id="parsetime"></span> milliseconds.<br/>
- Rendered in <span class="timing" id="rendertime"></span> milliseconds.</p>
+ <div class="col-md-2">
+ <p class="timing">Parsed in <span class="timing" id="parsetime"></span> ms.<br>
+ Rendered in <span class="timing" id="rendertime"></span> ms.</p>
</div>
</div>
<div class="row">
@@ -101,6 +103,9 @@ $(document).ready(function() {
<div id="result" class="tab-pane">
<pre id="htmlpre"><code id="html"></code></pre>
</div>
+ <div id="result-ast" class="tab-pane">
+ <pre id="astpre"><code id="ast"></code></pre>
+ </div>
</div>
</div>
</div>