2016-12-20 00:29:03 -05:00
|
|
|
<aside class="code-example container-fluid bg-ribbed-dark" data-example="<%= file %>">
|
2016-12-14 02:13:38 -05:00
|
|
|
<div class="row">
|
2016-12-27 21:35:43 -05:00
|
|
|
<div class="col-md-6 coffeescript-input-column">
|
|
|
|
<textarea class="coffeescript-input" id="<%= file %>-coffee"><%= cs %></textarea>
|
[CS2] Fix CS2 docs mobile issues, improve performance (#4688)
* Get rid of offcanvas slide-in; fix sidebar
* We need to transpile docs.coffee, since Safari 9 throws an error on it and that’s too new a browser not to support; but this should also speed things up
* Fix some tabs
* Fix scrollbar
* Use Highlight.js to format placeholder code (during compilation, not rendering) before CodeMirror loads; match Highlight.js styles to CodeMirror styles as best we can
* Improve hash management
* Initialize CodeMirror on demand, on mouseover a particular code example, rather than all examples on startup
* Replace highlight.js with Prism for placeholder syntax highlighting
* Scratch Prism, use CodeMirror itself to do Node-based syntax highlighting, so that on CodeMirror initialization there’s no flash from mismatched highlighting
* Update packages; there’s a new version of Jison! (doesn’t change much)
* Fix mobile issues: use SVG play button icon, to avoid iOS blue square play button; make the code editor text 16px size explicit, to avoid unwanted mobile zoom; make the ‘code play’ buttons work even if the code examples are in placeholder (non-editable) mode, in case a user hasn’t moused over/tapped them
* Update docs output
* Whoops, CodeMirror is only a devDependency
2017-09-07 11:01:12 -04:00
|
|
|
<pre class="placeholder-code"><%= highlight('coffeescript', cs) %></pre>
|
2016-12-14 02:13:38 -05:00
|
|
|
</div>
|
2016-12-18 06:45:35 -05:00
|
|
|
<div class="col-md-6 javascript-output-column">
|
2016-12-14 02:13:38 -05:00
|
|
|
<textarea class="javascript-output" id="<%= file %>-js"><%= js %></textarea>
|
[CS2] Fix CS2 docs mobile issues, improve performance (#4688)
* Get rid of offcanvas slide-in; fix sidebar
* We need to transpile docs.coffee, since Safari 9 throws an error on it and that’s too new a browser not to support; but this should also speed things up
* Fix some tabs
* Fix scrollbar
* Use Highlight.js to format placeholder code (during compilation, not rendering) before CodeMirror loads; match Highlight.js styles to CodeMirror styles as best we can
* Improve hash management
* Initialize CodeMirror on demand, on mouseover a particular code example, rather than all examples on startup
* Replace highlight.js with Prism for placeholder syntax highlighting
* Scratch Prism, use CodeMirror itself to do Node-based syntax highlighting, so that on CodeMirror initialization there’s no flash from mismatched highlighting
* Update packages; there’s a new version of Jison! (doesn’t change much)
* Fix mobile issues: use SVG play button icon, to avoid iOS blue square play button; make the code editor text 16px size explicit, to avoid unwanted mobile zoom; make the ‘code play’ buttons work even if the code examples are in placeholder (non-editable) mode, in case a user hasn’t moused over/tapped them
* Update docs output
* Whoops, CodeMirror is only a devDependency
2017-09-07 11:01:12 -04:00
|
|
|
<pre class="placeholder-code"><%= highlight('javascript', js) %></pre>
|
2016-12-14 02:13:38 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% if (run) { %>
|
|
|
|
<div class="row">
|
2017-09-02 15:48:38 -04:00
|
|
|
<div class="col text-right">
|
[CS2] Fix CS2 docs mobile issues, improve performance (#4688)
* Get rid of offcanvas slide-in; fix sidebar
* We need to transpile docs.coffee, since Safari 9 throws an error on it and that’s too new a browser not to support; but this should also speed things up
* Fix some tabs
* Fix scrollbar
* Use Highlight.js to format placeholder code (during compilation, not rendering) before CodeMirror loads; match Highlight.js styles to CodeMirror styles as best we can
* Improve hash management
* Initialize CodeMirror on demand, on mouseover a particular code example, rather than all examples on startup
* Replace highlight.js with Prism for placeholder syntax highlighting
* Scratch Prism, use CodeMirror itself to do Node-based syntax highlighting, so that on CodeMirror initialization there’s no flash from mismatched highlighting
* Update packages; there’s a new version of Jison! (doesn’t change much)
* Fix mobile issues: use SVG play button icon, to avoid iOS blue square play button; make the code editor text 16px size explicit, to avoid unwanted mobile zoom; make the ‘code play’ buttons work even if the code examples are in placeholder (non-editable) mode, in case a user hasn’t moused over/tapped them
* Update docs output
* Whoops, CodeMirror is only a devDependency
2017-09-07 11:01:12 -04:00
|
|
|
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="<%= file %>" data-run="<%= escape(run) %>"><% if (run === true) { include('play.svg') } else { %><small><%= include('play.svg') %></small><%= run.replace(/"/g, '"') %><% } %></button>
|
2016-12-14 02:13:38 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% } %>
|
|
|
|
</aside>
|