[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
This commit is contained in:
parent
df9d4a2343
commit
63d3b699d7
51
Cakefile
51
Cakefile
|
@ -66,6 +66,27 @@ build = (callback) ->
|
|||
buildParser()
|
||||
buildExceptParser callback
|
||||
|
||||
transpile = (code) ->
|
||||
babel = require 'babel-core'
|
||||
presets = []
|
||||
# Exclude the `modules` plugin in order to not break the `}(this));`
|
||||
# at the end of the above code block.
|
||||
presets.push ['env', {modules: no}] unless process.env.TRANSFORM is 'false'
|
||||
babelOptions =
|
||||
presets: presets
|
||||
sourceType: 'script'
|
||||
{ code } = babel.transform code, babelOptions unless presets.length is 0
|
||||
# Running Babel twice due to https://github.com/babel/babili/issues/614.
|
||||
# Once that issue is fixed, move the `babili` preset back up into the
|
||||
# `presets` array and run Babel once with both presets together.
|
||||
presets = if process.env.MINIFY is 'false' then [] else ['babili']
|
||||
babelOptions =
|
||||
compact: process.env.MINIFY isnt 'false'
|
||||
presets: presets
|
||||
sourceType: 'script'
|
||||
{ code } = babel.transform code, babelOptions unless presets.length is 0
|
||||
code
|
||||
|
||||
testBuiltCode = (watch = no) ->
|
||||
csPath = './lib/coffeescript'
|
||||
csDir = path.dirname require.resolve csPath
|
||||
|
@ -141,24 +162,7 @@ task 'build:browser', 'merge the built scripts into a single file for use in a b
|
|||
}
|
||||
}(this));
|
||||
"""
|
||||
babel = require 'babel-core'
|
||||
presets = []
|
||||
# Exclude the `modules` plugin in order to not break the `}(this));`
|
||||
# at the end of the above code block.
|
||||
presets.push ['env', {modules: no}] unless process.env.TRANSFORM is 'false'
|
||||
babelOptions =
|
||||
presets: presets
|
||||
sourceType: 'script'
|
||||
{ code } = babel.transform code, babelOptions unless presets.length is 0
|
||||
# Running Babel twice due to https://github.com/babel/babili/issues/614.
|
||||
# Once that issue is fixed, move the `babili` preset back up into the
|
||||
# `presets` array and run Babel once with both presets together.
|
||||
presets = if process.env.MINIFY is 'false' then [] else ['babili']
|
||||
babelOptions =
|
||||
compact: process.env.MINIFY isnt 'false'
|
||||
presets: presets
|
||||
sourceType: 'script'
|
||||
{ code } = babel.transform code, babelOptions unless presets.length is 0
|
||||
code = transpile code
|
||||
outputFolder = "docs/v#{majorVersion}/browser-compiler"
|
||||
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
|
||||
fs.writeFileSync "#{outputFolder}/coffeescript.js", header + '\n' + code
|
||||
|
@ -236,9 +240,17 @@ buildDocs = (watch = no) ->
|
|||
codeFor: codeFor()
|
||||
releaseHeader: releaseHeader
|
||||
|
||||
includeScript = ->
|
||||
(file) ->
|
||||
file = "#{versionedSourceFolder}/#{file}" unless '/' in file
|
||||
code = fs.readFileSync file, 'utf-8'
|
||||
code = CoffeeScript.compile code
|
||||
code = transpile code
|
||||
code
|
||||
|
||||
include = ->
|
||||
(file) ->
|
||||
file = "#{versionedSourceFolder}/#{file}" if file.indexOf('/') is -1
|
||||
file = "#{versionedSourceFolder}/#{file}" unless '/' in file
|
||||
output = fs.readFileSync file, 'utf-8'
|
||||
if /\.html$/.test(file)
|
||||
render = _.template output
|
||||
|
@ -249,6 +261,7 @@ buildDocs = (watch = no) ->
|
|||
htmlFor: htmlFor()
|
||||
codeFor: codeFor()
|
||||
include: include()
|
||||
includeScript: includeScript()
|
||||
output
|
||||
|
||||
# Task
|
||||
|
|
1997
docs/v2/index.html
1997
docs/v2/index.html
File diff suppressed because it is too large
Load Diff
|
@ -3,16 +3,14 @@
|
|||
<%= include('try.html') %>
|
||||
|
||||
<div class="container-fluid" id="top">
|
||||
<div class="row row-offcanvas row-offcanvas-left">
|
||||
<nav class="sidebar sidebar-offcanvas col-xs-12 col-lg-3 bg-ribbed-light">
|
||||
<div class="row flex-nowrap">
|
||||
<nav class="sidebar col-lg-3 bg-ribbed-light">
|
||||
<%= include('sidebar.html') %>
|
||||
</nav>
|
||||
<main class="main col-lg-9 ml-auto">
|
||||
|
||||
<header class="title-logo d-none d-lg-block">
|
||||
<%= include('documentation/images/logo.svg') %>
|
||||
</header>
|
||||
|
||||
<section id="overview">
|
||||
<%= htmlFor('introduction') %>
|
||||
<%= htmlFor('overview') %>
|
||||
|
@ -197,7 +195,6 @@
|
|||
<section id="changelog">
|
||||
<%= htmlFor('changelog') %>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,47 @@
|
|||
fs = require 'fs'
|
||||
_ = require 'underscore'
|
||||
|
||||
# Use CodeMirror in Node for syntax highlighting, per
|
||||
# https://github.com/codemirror/CodeMirror/blob/master/bin/source-highlight
|
||||
CodeMirror = require 'codemirror/addon/runmode/runmode.node.js'
|
||||
require 'codemirror/mode/coffeescript/coffeescript.js'
|
||||
require 'codemirror/mode/javascript/javascript.js'
|
||||
|
||||
CoffeeScript = require '../../lib/coffeescript'
|
||||
|
||||
|
||||
module.exports = ->
|
||||
(file, run = no) ->
|
||||
cs = fs.readFileSync "documentation/examples/#{file}.coffee", 'utf-8'
|
||||
js = CoffeeScript.compile cs, bare: yes # This is just the initial JavaScript output; it is replaced by dynamic compilation on changes of the CoffeeScript pane
|
||||
js = CoffeeScript.compile cs, bare: yes # This is just the initial JavaScript output; it is replaced by dynamic compilation on changes of the CoffeeScript pane.
|
||||
render = _.template fs.readFileSync('documentation/v2/code.html', 'utf-8')
|
||||
output = render {file, cs, js, run}
|
||||
include = (file) -> fs.readFileSync("documentation/v2/#{file}", 'utf-8')
|
||||
|
||||
highlight = (language, code) ->
|
||||
# Adapted from https://github.com/codemirror/CodeMirror/blob/master/bin/source-highlight.
|
||||
html = ''
|
||||
curStyle = null
|
||||
accum = ''
|
||||
|
||||
esc = (str) ->
|
||||
str.replace /[<&]/g, (ch) ->
|
||||
if ch is '&' then '&' else '<'
|
||||
|
||||
flush = ->
|
||||
if curStyle
|
||||
html += "<span class=\"#{curStyle.replace /(^|\s+)/g, '$1cm-'}\">#{esc accum}</span>"
|
||||
else
|
||||
html += esc accum
|
||||
|
||||
CodeMirror.runMode code, {name: language}, (text, style) ->
|
||||
if style isnt curStyle
|
||||
flush()
|
||||
curStyle = style
|
||||
accum = text
|
||||
else
|
||||
accum += text
|
||||
flush()
|
||||
|
||||
html
|
||||
|
||||
output = render {file, cs, js, highlight, include, run}
|
||||
|
|
|
@ -1,41 +1,66 @@
|
|||
/* Adapted from https://github.com/FarhadG/code-mirror-themes/blob/master/themes/twilight.css */
|
||||
|
||||
.cm-s-twilight {
|
||||
.CodeMirror,
|
||||
.placeholder-code {
|
||||
letter-spacing: 0.3px;
|
||||
color: #f8f8f8;
|
||||
/* Prevent mobile Safari from zooming in on our code editors; the code is 16px naturally, but somehow being explicit about it prevents the zooming */
|
||||
font-size: 16px;
|
||||
}
|
||||
.cm-s-twilight .CodeMirror-lines {
|
||||
.CodeMirror-lines {
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
.cm-s-twilight div.CodeMirror-cursor {
|
||||
.placeholder-code {
|
||||
padding: 0.5em 4px;
|
||||
margin-bottom: 1.3rem;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
div.CodeMirror-cursor {
|
||||
border-left: 3px solid #f8f8f8;
|
||||
}
|
||||
.cm-s-twilight .CodeMirror-activeline-background {
|
||||
.CodeMirror-activeline-background {
|
||||
background: #ffffff08;
|
||||
}
|
||||
.cm-s-twilight .CodeMirror-selected {
|
||||
.CodeMirror-selected {
|
||||
background: #ddf0ff33;
|
||||
}
|
||||
.cm-s-twilight .cm-comment {
|
||||
.cm-comment,
|
||||
.placeholder-code .comment {
|
||||
font-style: italic;
|
||||
color: #5f5a60;
|
||||
}
|
||||
.cm-s-twilight .cm-keyword {
|
||||
.cm-keyword,
|
||||
.placeholder-code .keyword {
|
||||
color: #cda869;
|
||||
}
|
||||
.cm-s-twilight .cm-string {
|
||||
.cm-string,
|
||||
.placeholder-code .string {
|
||||
color: #8f9d6a;
|
||||
}
|
||||
.cm-s-twilight .cm-property {
|
||||
.cm-property,
|
||||
.placeholder-code .attribute {
|
||||
color: #dad085;
|
||||
}
|
||||
.cm-s-twilight .cm-atom {
|
||||
.cm-atom {
|
||||
color: #dad085;
|
||||
}
|
||||
.cm-s-twilight .cm-number {
|
||||
.cm-number,
|
||||
.placeholder-code .number,
|
||||
.placeholder-code .built_in,
|
||||
.placeholder-code .builtin-name,
|
||||
.placeholder-code .literal,
|
||||
.placeholder-code .type,
|
||||
/*.placeholder-code .params,*/
|
||||
.placeholder-code .meta,
|
||||
.placeholder-code .link {
|
||||
color: #dad085;
|
||||
}
|
||||
.cm-s-twilight .cm-operator {
|
||||
.cm-operator,
|
||||
.placeholder-code .punctuation,
|
||||
.placeholder-code .symbol,
|
||||
.placeholder-code .bullet,
|
||||
.placeholder-code .addition,
|
||||
.placeholder-code .operator {
|
||||
color: #cda869;
|
||||
}
|
||||
|
|
@ -2,15 +2,17 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6 coffeescript-input-column">
|
||||
<textarea class="coffeescript-input" id="<%= file %>-coffee"><%= cs %></textarea>
|
||||
<pre class="placeholder-code"><%= highlight('coffeescript', cs) %></pre>
|
||||
</div>
|
||||
<div class="col-md-6 javascript-output-column">
|
||||
<textarea class="javascript-output" id="<%= file %>-js"><%= js %></textarea>
|
||||
<pre class="placeholder-code"><%= highlight('javascript', js) %></pre>
|
||||
</div>
|
||||
</div>
|
||||
<% if (run) { %>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="<%= file %>" data-run="<%= escape(run) %>"><% if (run === true) { %>▶<% } else { %><small>▶</small> <%= run.replace(/"/g, '"') %><% } %></button>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$(document).ready ->
|
||||
# Mobile navigation
|
||||
toggleSidebar = ->
|
||||
$('.navbar-toggler, .row-offcanvas').toggleClass 'show'
|
||||
$('.navbar-toggler, .sidebar').toggleClass 'show'
|
||||
|
||||
$('[data-toggle="offcanvas"]').click toggleSidebar
|
||||
|
||||
|
@ -31,13 +31,18 @@ $(document).ready ->
|
|||
|
||||
|
||||
# Initialize CodeMirror for code examples; https://codemirror.net/doc/manual.html
|
||||
# Defer this until a code example is clicked or focused, to avoid unnecessary computation/slowness
|
||||
textareas = []
|
||||
editors = []
|
||||
lastCompilationElapsedTime = 200
|
||||
$('textarea').each (index) ->
|
||||
textareas[index] = @
|
||||
$(@).data 'index', index
|
||||
mode = if $(@).hasClass('javascript-output') then 'javascript' else 'coffeescript'
|
||||
|
||||
editors[index] = editor = CodeMirror.fromTextArea @,
|
||||
initializeEditor = ($textarea) ->
|
||||
index = $textarea.data 'index'
|
||||
mode = if $textarea.hasClass('javascript-output') then 'javascript' else 'coffeescript'
|
||||
editors[index] = editor = CodeMirror.fromTextArea $textarea[0],
|
||||
mode: mode
|
||||
theme: 'twilight'
|
||||
indentUnit: 2
|
||||
|
@ -90,17 +95,40 @@ $(document).ready ->
|
|||
cm.options.indentWithTabs = /^\t/m.test cm.getValue()
|
||||
cm.execCommand 'newlineAndIndent'
|
||||
|
||||
$('.placeholder-code').one 'mouseover', (event) ->
|
||||
$textarea = $(@).prev 'textarea'
|
||||
$(@).remove()
|
||||
initializeEditor $textarea
|
||||
# Initialize the sibling column too
|
||||
$siblingColumn = $ $textarea.parent().siblings()[0]
|
||||
$siblingColumn.children('.placeholder-code').remove()
|
||||
initializeEditor $ $siblingColumn.children('textarea')[0]
|
||||
|
||||
initializeTryEditors = ->
|
||||
initializeEditor $ '#try-coffeescript-coffee'
|
||||
initializeEditor $ '#try-coffeescript-js'
|
||||
|
||||
# Handle the code example buttons
|
||||
$('[data-action="run-code-example"]').click ->
|
||||
run = $(@).data 'run'
|
||||
index = $("##{$(@).data('example')}-js").data 'index'
|
||||
js = editors[index].getValue()
|
||||
js = if editors[index]?
|
||||
editors[index].getValue()
|
||||
else
|
||||
$(textareas[index]).val()
|
||||
js = "#{js}\nalert(#{unescape run});" unless run is yes
|
||||
eval js
|
||||
|
||||
clearHash = ->
|
||||
window.history.pushState '', document.title, window.location.pathname
|
||||
|
||||
$(window).on 'hashchange', ->
|
||||
# Get rid of dangling # in the address bar
|
||||
clearHash() if window.location.hash is ''
|
||||
|
||||
# Try CoffeeScript
|
||||
toggleTry = (checkLocalStorage = no) ->
|
||||
initializeTryEditors() if $('#try .CodeMirror').length is 0
|
||||
if checkLocalStorage and window.localStorage?
|
||||
try
|
||||
coffee = window.localStorage.getItem 'tryCoffeeScriptCode'
|
||||
|
@ -108,8 +136,10 @@ $(document).ready ->
|
|||
editors[0].setValue coffee
|
||||
catch exception
|
||||
$('#try, #try-link').toggleClass 'show'
|
||||
setTimeout clearHash, 200 unless $('#try').hasClass('show')
|
||||
closeTry = ->
|
||||
$('#try, #try-link').removeClass 'show'
|
||||
window.history.pushState '', document.title, window.location.pathname
|
||||
|
||||
$('[data-toggle="try"]').click toggleTry
|
||||
$('[data-close="try"]').click closeTry
|
||||
|
@ -120,8 +150,11 @@ $(document).ready ->
|
|||
if window.location.hash is '#try'
|
||||
toggleTry yes
|
||||
else if window.location.hash.indexOf('#try') is 0
|
||||
initializeTryEditors() if $('#try .CodeMirror').length is 0
|
||||
editors[0].setValue decodeURIComponent window.location.hash[5..]
|
||||
toggleTry()
|
||||
else if window.location.hash is ''
|
||||
clearHash()
|
||||
else
|
||||
initializeScrollspyFromHash window.location.hash
|
||||
if window.location.hash.length > 1
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* Adapted from https://v4-alpha.getbootstrap.com/examples/dashboard/dashboard.css and http://v4-alpha.getbootstrap.com/examples/offcanvas/offcanvas.css */
|
||||
|
||||
html,
|
||||
body {
|
||||
/* Prevent scroll on narrow devices */
|
||||
|
@ -51,7 +49,7 @@ button:focus, .navbar-dark .navbar-toggler:focus {
|
|||
*/
|
||||
.site-navbar {
|
||||
height: 3.5rem;
|
||||
font-family: Lato;
|
||||
font-family: 'Lato';
|
||||
font-weight: 400;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
@ -86,44 +84,39 @@ button:focus, .navbar-dark .navbar-toggler:focus {
|
|||
*/
|
||||
|
||||
.sidebar {
|
||||
background-color: #efebe9;
|
||||
border-right: 1px solid #efebe9;
|
||||
top: 3.5rem;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: block;
|
||||
padding: 0;
|
||||
}
|
||||
.sidebar .contents {
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 3.5em;
|
||||
height: calc(100% - 3.5rem);
|
||||
/* Scrollable contents if viewport is shorter than content */
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 0.5em 0 0.5em 0.3em;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000;
|
||||
padding: 0;
|
||||
background-color: #efebe9;
|
||||
border-right: 1px solid #efebe9;
|
||||
}
|
||||
.sidebar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
@media screen and (max-width: 991px) {
|
||||
.sidebar {
|
||||
left: -100%;
|
||||
transition: 0.25s left ease-in-out;
|
||||
}
|
||||
.sidebar.show {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.contents {
|
||||
padding: 0.5em 0 0.5em 0.5em;
|
||||
font-family: 'Alegreya Sans';
|
||||
font-weight: 400;
|
||||
font-size: 1.2em;
|
||||
align-items: normal;
|
||||
}
|
||||
.sidebar .contents::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
@media screen and (max-width: 991px) {
|
||||
.sidebar .contents {
|
||||
position: fixed;
|
||||
height: calc(100% - 3.5rem);
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 992px) {
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
}
|
||||
}
|
||||
|
||||
.contents-column {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.contents .nav .nav {
|
||||
margin-left: 1em;
|
||||
|
@ -141,44 +134,6 @@ button:focus, .navbar-dark .navbar-toggler:focus {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Off Canvas
|
||||
*/
|
||||
@media screen and (max-width: 991px) {
|
||||
.row-offcanvas {
|
||||
position: relative;
|
||||
transition: all .25s ease-in-out;
|
||||
}
|
||||
.row-offcanvas-left {
|
||||
left: 0;
|
||||
}
|
||||
.sidebar-offcanvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 767px) {
|
||||
.row-offcanvas-left .sidebar-offcanvas {
|
||||
left: -100%;
|
||||
}
|
||||
.row-offcanvas-left.show {
|
||||
left: calc(100% + 30px)
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 768px) and (max-width: 991px) {
|
||||
.row-offcanvas-left .sidebar-offcanvas {
|
||||
left: calc(-66.667% - 15px);
|
||||
width: 66.667%;
|
||||
}
|
||||
.row-offcanvas-left.show {
|
||||
left: calc(66.667% + 30px);
|
||||
}
|
||||
.row-offcanvas-left .sidebar-offcanvas .contents {
|
||||
width: 66.667%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Main content
|
||||
*/
|
||||
|
@ -311,7 +266,12 @@ textarea {
|
|||
outline: 0;
|
||||
}
|
||||
|
||||
.CodeMirror {
|
||||
.play-button {
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
.CodeMirror,
|
||||
.placeholder-code {
|
||||
/* https://codemirror.net/demo/resize.html */
|
||||
height: auto;
|
||||
background: transparent;
|
||||
|
@ -321,7 +281,8 @@ textarea {
|
|||
font-size: 0.9em;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.CodeMirror {
|
||||
.CodeMirror,
|
||||
.placeholder-code {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<svg class="play-button" viewBox="0 0 24 24">
|
||||
<path d="M2.56-0.01v24.02L21.44 11.98 2.56-0.01z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 107 B |
|
@ -6,6 +6,6 @@
|
|||
<script src="https://cdn.jsdelivr.net/combine/npm/codemirror@5.29.0/lib/codemirror.js,npm/codemirror@5.29.0/mode/coffeescript/coffeescript.js,npm/codemirror@5.29.0/addon/lint/coffeescript-lint.js,npm/codemirror@5.29.0/mode/javascript/javascript.js"></script>
|
||||
|
||||
<script src="browser-compiler/coffeescript.js"></script>
|
||||
<script type="text/coffeescript">
|
||||
<%= include('docs.coffee') %>
|
||||
<script>
|
||||
<%= includeScript('docs.coffee') %>
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<nav id="contents" class="navbar contents">
|
||||
<nav class="nav flex-column contents-column">
|
||||
<nav class="nav flex-column">
|
||||
<a href="#try" class="nav-link d-md-none" data-action="sidebar-nav" data-toggle="try">Try CoffeeScript</a>
|
||||
<a href="#top" class="nav-link" data-action="sidebar-nav">Overview</a>
|
||||
<a href="#coffeescript-2" class="nav-link" data-action="sidebar-nav">CoffeeScript 2</a>
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/codemirror/4.5.0/codemirror.css" crossorigin="anonymous">
|
||||
<style>
|
||||
<%= include('docs.css') %>
|
||||
<%= include('twilight.css') %>
|
||||
<%= include('code.css') %>
|
||||
</style>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right try-buttons">
|
||||
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="try-coffeescript" data-run="true">▶</button> 
|
||||
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="try-coffeescript" data-run="true"><%= include('play.svg') %></button> 
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* parser generated by jison 0.4.17 */
|
||||
/* parser generated by jison 0.4.18 */
|
||||
/*
|
||||
Returns a Parser object of the following structure:
|
||||
|
||||
|
@ -906,13 +906,9 @@ parseError: function parseError(str, hash) {
|
|||
if (hash.recoverable) {
|
||||
this.trace(str);
|
||||
} else {
|
||||
function _parseError (msg, hash) {
|
||||
this.message = msg;
|
||||
this.hash = hash;
|
||||
}
|
||||
_parseError.prototype = Error;
|
||||
|
||||
throw new _parseError(str, hash);
|
||||
var error = new Error(str);
|
||||
error.hash = hash;
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
parse: function parse(input) {
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"acorn": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz",
|
||||
"integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz",
|
||||
"integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-dynamic-import": {
|
||||
|
@ -1247,16 +1247,17 @@
|
|||
"dev": true
|
||||
},
|
||||
"browserify-aes": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz",
|
||||
"integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.8.tgz",
|
||||
"integrity": "sha512-WYCMOT/PtGTlpOKFht0YJFYcPy6pLCR98CtWfzK13zoynLlBMvAdEMSRGmgnJCw2M2j/5qxBkinZQFobieM8dQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-xor": "1.0.3",
|
||||
"cipher-base": "1.0.4",
|
||||
"create-hash": "1.1.3",
|
||||
"evp_bytestokey": "1.0.2",
|
||||
"inherits": "2.0.3"
|
||||
"evp_bytestokey": "1.0.3",
|
||||
"inherits": "2.0.3",
|
||||
"safe-buffer": "5.1.1"
|
||||
}
|
||||
},
|
||||
"browserify-cipher": {
|
||||
|
@ -1265,9 +1266,9 @@
|
|||
"integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browserify-aes": "1.0.6",
|
||||
"browserify-aes": "1.0.8",
|
||||
"browserify-des": "1.0.0",
|
||||
"evp_bytestokey": "1.0.2"
|
||||
"evp_bytestokey": "1.0.3"
|
||||
}
|
||||
},
|
||||
"browserify-des": {
|
||||
|
@ -1448,6 +1449,12 @@
|
|||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
||||
"dev": true
|
||||
},
|
||||
"codemirror": {
|
||||
"version": "5.29.0",
|
||||
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.29.0.tgz",
|
||||
"integrity": "sha512-nlG9m0YQ0gFhdEdnKDG+XJRB/bW+K6M9Axs01+LScjVamWtd4dEwgyohf/r4voW1efnGi6U6hHHvDQ9tt9BtoA==",
|
||||
"dev": true
|
||||
},
|
||||
"colors": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz",
|
||||
|
@ -1891,9 +1898,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"evp_bytestokey": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.2.tgz",
|
||||
"integrity": "sha512-ni0r0lrm7AOzsh2qC5mi9sj8S0gmj5fLNjfFpxN05FB4tAVZEKotbkjOtLPqTCX/CXT7NsUr6juZb4IFJeNNdA==",
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
|
||||
"integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"md5.js": "1.3.4",
|
||||
|
@ -3338,9 +3345,9 @@
|
|||
}
|
||||
},
|
||||
"jison": {
|
||||
"version": "0.4.17",
|
||||
"resolved": "https://registry.npmjs.org/jison/-/jison-0.4.17.tgz",
|
||||
"integrity": "sha1-vBLUbFhF5v7onM81vSqMxz66F/M=",
|
||||
"version": "0.4.18",
|
||||
"resolved": "https://registry.npmjs.org/jison/-/jison-0.4.18.tgz",
|
||||
"integrity": "sha512-FKkCiJvozgC7VTHhMJ00a0/IApSxhlGsFIshLW6trWJ8ONX2TQJBBz6DlcO1Gffy4w9LT+uL+PA+CVnUSJMF7w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"JSONSelect": "0.4.0",
|
||||
|
@ -3892,9 +3899,9 @@
|
|||
"dev": true,
|
||||
"requires": {
|
||||
"asn1.js": "4.9.1",
|
||||
"browserify-aes": "1.0.6",
|
||||
"browserify-aes": "1.0.8",
|
||||
"create-hash": "1.1.3",
|
||||
"evp_bytestokey": "1.0.2",
|
||||
"evp_bytestokey": "1.0.3",
|
||||
"pbkdf2": "3.0.13"
|
||||
}
|
||||
},
|
||||
|
@ -4654,12 +4661,12 @@
|
|||
}
|
||||
},
|
||||
"webpack": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-3.5.5.tgz",
|
||||
"integrity": "sha512-qeUx4nIbeLL53qqNTs3kObPBMkUVDrOjEfp/hTvMlx21qL2MsGNr8/tXCoX/lS12dLl9qtZaXv2qfBEctPScDg==",
|
||||
"version": "3.5.6",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-3.5.6.tgz",
|
||||
"integrity": "sha512-sXnxfx6KoZVrFAGLjdhCCwDtDwkYMfwm8mJjkQv3thr5pjTlbxopVlr/kJwc9Bz317gL+gNjvz++ir9TgG1MDg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "5.1.1",
|
||||
"acorn": "5.1.2",
|
||||
"acorn-dynamic-import": "2.0.2",
|
||||
"ajv": "5.2.2",
|
||||
"ajv-keywords": "2.1.0",
|
||||
|
|
|
@ -43,12 +43,13 @@
|
|||
"babel-preset-babili": "~0.1.4",
|
||||
"babel-preset-env": "~1.6.0",
|
||||
"babili": "^0.1.4",
|
||||
"codemirror": "^5.29.0",
|
||||
"docco": "~0.7.0",
|
||||
"highlight.js": "~9.12.0",
|
||||
"jison": ">=0.4.17",
|
||||
"jison": ">=0.4.18",
|
||||
"markdown-it": "~8.4.0",
|
||||
"underscore": "~1.8.3",
|
||||
"webpack": "~3.5.5"
|
||||
"webpack": "~3.5.6"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue