
* Replace tiny bitmaps with base64-encoded URIs
* Optimize SVGs; replace logo PNG with SVG
* Modernize favicon
* Embed CSS; a bit unorthodox, but we’re a single page so there’s no point in separate .css files and their separate HTTP requests
* Documentation is now markdown, converted to HTML on compilation
* Render the examples when we’re rendering index.html; they compile so quickly that there’s no need to pre-render them and save the intermediate .js files
* Split apart index.html into components that Cakefile assembles, so that we can add in logic to include different files for v1 versus v2
* Split building index.html and building test.html into two tasks; collapse the parts of `releaseHeader` into one compact function
* Move include logic into templates
* Get error messages tests to work in the browser
* Update output index.html
* Split body into nav and body
* Watch subtemplates
* Revert "Split body into nav and body"
This reverts commit ec9e559ec0
.
* Add marked
* Update gitignore
* Use idiomatic markdown output for code blocks (<pre><code>)
* Handle ids within the template, not in the Cakefile; remove marked’s auto-generated and conflicting ids
* Move the `codeFor` function into versioned folders, so that v1 and v2 docs can have different example code blocks/editors
* Update packages, including new highlight.js which supports our newer keywords and triple backticks (docs output is unchanged)
1.2 KiB
String Interpolation, Block Strings, and Block Comments
Ruby-style string interpolation is included in CoffeeScript. Double-quoted strings allow for interpolated values, using #{ … }
, and single-quoted strings are literal. You may even use interpolation in object keys.
codeFor('interpolation', 'sentence')
Multiline strings are allowed in CoffeeScript. Lines are joined by a single space unless they end with a backslash. Indentation is ignored.
codeFor('strings', 'mobyDick')
Block strings can be used to hold formatted or indentation-sensitive text (or, if you just don’t feel like escaping quotes and apostrophes). The indentation level that begins the block is maintained throughout, so you can keep it all aligned with the body of your code.
codeFor('heredocs', 'html')
Double-quoted block strings, like other double-quoted strings, allow interpolation.
Sometimes you’d like to pass a block comment through to the generated JavaScript. For example, when you need to embed a licensing header at the top of a file. Block comments, which mirror the syntax for block strings, are preserved in the generated code.
codeFor('block_comment')