Refactor docs resources section; reorganize outline; other minor corrections

This commit is contained in:
Geoffrey Booth 2016-12-18 18:13:59 -08:00
parent 78b21c2483
commit ea269104bd
8 changed files with 94 additions and 49 deletions

View File

@ -0,0 +1,16 @@
## Annotated Source
You can browse the CoffeeScript <%= fullVersion %> source in readable, annotated form [here](http://coffeescript.org/v<%= majorVersion %>/annotated-source/). You can also jump directly to a particular source file:
- [Grammar Rules — src/grammar](http://coffeescript.org/v<%= majorVersion %>/annotated-source/grammar.html)
- [Lexing Tokens — src/lexer](http://coffeescript.org/v<%= majorVersion %>/annotated-source/lexer.html)
- [The Rewriter — src/rewriter](http://coffeescript.org/v<%= majorVersion %>/annotated-source/rewriter.html)
- [The Syntax Tree — src/nodes](http://coffeescript.org/v<%= majorVersion %>/annotated-source/nodes.html)
- [Lexical Scope — src/scope](http://coffeescript.org/v<%= majorVersion %>/annotated-source/scope.html)
- [Helpers &amp; Utility Functions — src/helpers](http://coffeescript.org/v<%= majorVersion %>/annotated-source/helpers.html)
- [The CoffeeScript Module — src/coffee-script](http://coffeescript.org/v<%= majorVersion %>/annotated-source/coffee-script.html)
- [Cake &amp; Cakefiles — src/cake](http://coffeescript.org/v<%= majorVersion %>/annotated-source/cake.html)
- [“coffee” Command-Line Utility — src/command](http://coffeescript.org/v<%= majorVersion %>/annotated-source/command.html)
- [Option Parsing — src/optparse](http://coffeescript.org/v<%= majorVersion %>/annotated-source/optparse.html)
- [Interactive REPL — src/repl](http://coffeescript.org/v<%= majorVersion %>/annotated-source/repl.html)
- [Source Maps — src/sourcemap](http://coffeescript.org/v<%= majorVersion %>/annotated-source/sourcemap.html)

View File

@ -1,5 +1,3 @@
## Web Chat (IRC)
Quick help and advice can usually be found in the CoffeeScript IRC room. Join `#coffeescript` on `irc.freenode.net`, or click the button below to open a webchat session on this page.
<button id="open_webchat">click to open #coffeescript</button>
Quick help and advice can often be found in the CoffeeScript IRC room `#coffeescript` on `irc.freenode.net`, which you can [join via your web browser](http://webchat.freenode.net/?channels=coffeescript).

View File

@ -6,7 +6,7 @@ Functions are defined by an optional list of parameters in parentheses, an arrow
codeFor('functions', 'cube(5)')
```
Functions may also have default values for arguments, which will be used if the incoming argument is missing (`null` or `undefined`).
Functions may also have default values for arguments, which will be used if the incoming argument is missing (`undefined`).
```
codeFor('default_args', 'fill("cup")')

View File

@ -1,14 +1,6 @@
## Resources
* [Source Code](http://github.com/jashkenas/coffeescript/)<br>
Use `bin/coffee` to test your changes,<br>
`bin/cake test` to run the test suite,<br>
`bin/cake build` to rebuild the CoffeeScript compiler, and<br>
`bin/cake build:parser` to regenerate the Jison parser if youre working on the grammar.
`git checkout lib && bin/cake build:full` is a good command to run when youre working on the core language. Itll refresh the lib directory (in case you broke something), build your altered compiler, use that to rebuild itself (a good sanity test) and then run all of the tests. If they pass, theres a good chance youve made a successful change.
* [Browser Tests](v<%= majorVersion %>/test.html)<br>
Run CoffeeScripts test suite in your current browser.
* [CoffeeScript on GitHub](http://github.com/jashkenas/coffeescript/)
* [CoffeeScript Issues](http://github.com/jashkenas/coffeescript/issues)<br>
Bug reports, feature proposals, and ideas for changes to the language belong here.
* [CoffeeScript Google Group](https://groups.google.com/forum/#!forum/coffeescript)<br>
@ -17,7 +9,7 @@
If youve ever learned a neat CoffeeScript tip or trick, or ran into a gotcha — share it on the wiki. The wiki also serves as a directory of handy [text editor extensions](http://github.com/jashkenas/coffeescript/wiki/Text-editor-plugins), [web framework plugins](http://github.com/jashkenas/coffeescript/wiki/Web-framework-plugins), and general [CoffeeScript build tools](http://github.com/jashkenas/coffeescript/wiki/Build-tools).
* [The FAQ](http://github.com/jashkenas/coffeescript/wiki/FAQ)<br>
Perhaps your CoffeeScript-related question has been asked before. Check the FAQ first.
* [JS2Coffee](http://js2coffee.org)<br>
* [JS2Coffee](http://js2.coffee/)<br>
Is a very well done reverse JavaScript-to-CoffeeScript compiler. Its not going to be perfect (infer what your JavaScript classes are, when you need bound functions, and so on…) — but its a great starting point for converting simple scripts.
* [High-Rez Logo](https://github.com/jashkenas/coffeescript/tree/master/documentation/images)<br>
The CoffeeScript logo is available in SVG for use in presentations.

View File

@ -1,4 +1,4 @@
## "text/coffeescript" Script Tags
## `"text/coffeescript"` Script Tags
While its not recommended for serious use, CoffeeScripts may be included directly within the browser using `<script type="text/coffeescript">` tags. The source includes a compressed and minified version of the compiler ([Download current version here, 51k when gzipped](v<%= majorVersion %>/browser-compiler/coffee-script.js)) as `v<%= majorVersion %>/browser-compiler/coffee-script.js`. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.

View File

@ -0,0 +1,7 @@
## Browser-based Tests
CoffeeScript includes an extensive test suite, which verifies that the compiler generates JavaScript that behaves as it should. The tests canonically run via the Node runtime, and must all pass there before we consider publishing a new release of CoffeeScript; but you can also run the tests in a web browser. This can be a good way to determine which features of CoffeeScript your current browser may not support. In general, the latest version of [Google Chrome Canary](https://www.google.com/chrome/browser/canary.html) should pass all the tests.
Note that since no JavaScript runtime yet supports ES2015 modules, the tests for module support verify only that the CoffeeScript compilers output is the correct syntax; the tests dont verify that the modules resolve properly.
[Run the tests in your browser.](http://coffeescript.dev/v<%= majorVersion %>/test.html)

View File

@ -31,17 +31,20 @@
<section id="usage">
<%= htmlFor('usage') %>
</section>
<section id="literate">
<%= htmlFor('literate') %>
</section>
<section id="language">
<%= htmlFor('language') %>
<section id="literals">
<section id="functions">
<%= htmlFor('functions') %>
</section>
<section id="strings">
<%= htmlFor('strings') %>
</section>
<section id="objects-and-arrays">
<%= htmlFor('objects_and_arrays') %>
</section>
<section id="comments">
<%= htmlFor('comments') %>
</section>
<section id="lexical-scope">
<%= htmlFor('lexical_scope') %>
</section>
@ -87,42 +90,45 @@
<section id="comparisons">
<%= htmlFor('comparisons') %>
</section>
<section id="strings">
<%= htmlFor('strings') %>
<section id="regexes">
<%= htmlFor('heregexes') %>
</section>
<section id="tagged-template-literals">
<%= htmlFor('tagged_template_literals') %>
</section>
<section id="regexes">
<%= htmlFor('heregexes') %>
</section>
<section id="modules">
<%= htmlFor('modules') %>
</section>
</section>
<section id="cake">
<%= htmlFor('cake') %>
<section id="literate">
<%= htmlFor('literate') %>
</section>
<section id="source-maps">
<%= htmlFor('source_maps') %>
</section>
<section id="cake">
<%= htmlFor('cake') %>
</section>
<section id="scripts">
<%= htmlFor('scripts') %>
</section>
<section id="resources">
<%= htmlFor('books') %>
</section>
<section id="screencasts">
<%= htmlFor('screencasts') %>
</section>
<section id="examples">
<%= htmlFor('examples') %>
</section>
<section id="additional-resources">
<%= htmlFor('resources') %>
</section>
<section id="chat">
<%= htmlFor('chat') %>
<section id="books">
<%= htmlFor('books') %>
</section>
<section id="screencasts">
<%= htmlFor('screencasts') %>
</section>
<section id="examples">
<%= htmlFor('examples') %>
</section>
<section id="chat">
<%= htmlFor('chat') %>
</section>
<section id="annotated-source">
<%= htmlFor('annotated-source') %>
</section>
</section>
<section id="changelog">
<%= htmlFor('changelog') %>

View File

@ -9,14 +9,20 @@
<li class="nav-item">
<a href="#usage" class="nav-link">Usage</a>
</li>
<li class="nav-item">
<a href="#literate" class="nav-link">Literate CoffeeScript</a>
</li>
<li class="nav-item">
<a href="#language" class="nav-link">Language Reference</a>
<ul class="nav">
<li class="nav-item">
<a href="#literals" class="nav-link">Literals: Functions, Objects and Arrays</a>
<a href="#functions" class="nav-link">Functions</a>
</li>
<li class="nav-item">
<a href="#strings" class="nav-link">Strings</a>
</li>
<li class="nav-item">
<a href="#objects-and-arrays" class="nav-link">Objects and Arrays</a>
</li>
<li class="nav-item">
<a href="#comments" class="nav-link">Comments</a>
</li>
<li class="nav-item">
<a href="#lexical-scope" class="nav-link">Lexical Scoping and Variable Safety</a>
@ -61,30 +67,50 @@
<a href="#comparisons" class="nav-link">Chained Comparisons</a>
</li>
<li class="nav-item">
<a href="#strings" class="nav-link">String Interpolation, Block Strings, and Block Comments</a>
<a href="#regexes" class="nav-link">Block Regular Expressions</a>
</li>
<li class="nav-item">
<a href="#tagged-template-literals" class="nav-link">Tagged Template Literals</a>
</li>
<li class="nav-item">
<a href="#regexes" class="nav-link">Block Regular Expressions</a>
</li>
<li class="nav-item">
<a href="#modules" class="nav-link">Modules</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#cake" class="nav-link">Cake, and Cakefiles</a>
<a href="#literate" class="nav-link">Literate CoffeeScript</a>
</li>
<li class="nav-item">
<a href="#source-maps" class="nav-link">Source Maps</a>
</li>
<li class="nav-item">
<a href="#scripts" class="nav-link">"text/coffeescript" Script Tags</a>
<a href="#cake" class="nav-link">Cake, and Cakefiles</a>
</li>
<li class="nav-item">
<a href="#resources" class="nav-link">Books, Screencasts, Examples and Resources</a>
<a href="#scripts" class="nav-link"><code>"text/coffeescript"</code> Script Tags</a>
</li>
<li class="nav-item">
<a href="#test" class="nav-link">Browser-Based Tests</a>
</li>
<li class="nav-item">
<a href="#resources" class="nav-link">Resources</a>
<ul class="nav">
<li class="nav-item">
<a href="#books">Books</a>
</li>
<li class="nav-item">
<a href="#screencasts">Screencasts</a>
</li>
<li class="nav-item">
<a href="#examples">Examples</a>
</li>
<li class="nav-item">
<a href="#chat">Chat</a>
</li>
<li class="nav-item">
<a href="#annotated-source">Annotated Source</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#changelog" class="nav-link">Change Log</a>