From 31940a4d5f6c7372ffbfac1d5146e9bd47e51114 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sun, 13 May 2018 17:16:32 -0700 Subject: [PATCH 1/5] Changelog sub-sections should use h3, not h2; no need for hack anchor tag anymore --- Cakefile | 5 +- docs/v2/index.html | 430 ++++++++++++++++++--------------------------- 2 files changed, 174 insertions(+), 261 deletions(-) diff --git a/Cakefile b/Cakefile index b168f159d5..ff9f091b2f 100644 --- a/Cakefile +++ b/Cakefile @@ -189,11 +189,10 @@ buildDocs = (watch = no) -> "#{monthNames[$2 - 1]} #{+$3}, #{$1}" """ -
-

+

#{prevVersion and "#{version}" or version} -

+ """ codeFor = require "./documentation/site/code.coffee" diff --git a/docs/v2/index.html b/docs/v2/index.html index 688a7770c3..548ada16bc 100644 --- a/docs/v2/index.html +++ b/docs/v2/index.html @@ -5519,54 +5519,48 @@

Argument parsing and shebang (#!) lines

Changelog

-
-

+

2.3.0 -

From e06d9fc7d16f8b4ce96534f55f93d73b50d3209a Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sun, 13 May 2018 17:38:25 -0700 Subject: [PATCH 2/5] =?UTF-8?q?Internationalize=20dates=20to=20user?= =?UTF-8?q?=E2=80=99s=20locale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cakefile | 8 +- docs/v2/index.html | 174 ++++++++++++++++----------------- documentation/site/docs.coffee | 10 ++ 3 files changed, 98 insertions(+), 94 deletions(-) diff --git a/Cakefile b/Cakefile index ff9f091b2f..6d3557b67d 100644 --- a/Cakefile +++ b/Cakefile @@ -182,16 +182,10 @@ buildDocs = (watch = no) -> # Helpers releaseHeader = (date, version, prevVersion) -> - monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] - - formatDate = (date) -> - date.replace /^(\d\d\d\d)-(\d\d)-(\d\d)$/, (match, $1, $2, $3) -> - "#{monthNames[$2 - 1]} #{+$3}, #{$1}" - """

#{prevVersion and "#{version}" or version} - +

""" diff --git a/docs/v2/index.html b/docs/v2/index.html index 548ada16bc..0d478a7a6f 100644 --- a/docs/v2/index.html +++ b/docs/v2/index.html @@ -5521,7 +5521,7 @@

Argument parsing and shebang (#!) lines

Changelog

2.3.0 - +

2.2.4 - +

2.2.3 - +

2.2.2 - +

2.2.1 - +

2.2.0 - +

2.1.1 - +

2.1.0 - +

2.0.3 - +

2.0.2 - +

2.0.1 - +

2.0.0 - +

2.0.0-beta5 - +

2.0.0-beta4 - +

1.12.7 - +

2.0.0-beta3 - +

2.0.0-beta2 - +

1.12.6 - +

2.0.0-beta1 - +

1.12.5 - +

2.0.0-alpha1 - +

1.12.4 - +

1.12.3 - +

1.12.2 - +

1.12.1 - +

1.12.0 - +

1.11.1 - +

1.11.0 - +

1.10.0 - +

1.9.3 - +

1.9.2 - +

1.9.1 - +

1.9.0 - +

1.8.0 - +

1.7.1 - +

1.7.0 - +

1.6.3 - +

1.6.2 - +

1.6.1 - +

1.5.0 - +

1.4.0 - +

1.3.3 - +

1.3.1 - +

1.2.0 - +

1.1.3 - +

1.1.2 - +

Fixes for block comment formatting, ?= compilation, implicit calls against control structures, implicit invocation of a try/catch block, variadic arguments leaking from local scope, line numbers in syntax errors following heregexes, property access on parenthesized number literals, bound class methods and super with reserved names, a REPL overhaul, consecutive compiled semicolons, block comments in implicitly called objects, and a Chrome bug.

1.1.1 - +

Bugfix release for classes with external constructor functions, see issue #1182.

1.1.0 - +

When running via the coffee executable, process.argv and friends now report coffee instead of node. Better compatibility with Node.js 0.4.x module lookup changes. The output in the REPL is now colorized, like Node’s is. Giving your concatenated CoffeeScripts a name when using --join is now mandatory. Fix for lexing compound division /= as a regex accidentally. All text/coffeescript tags should now execute in the order they’re included. Fixed an issue with extended subclasses using external constructor functions. Fixed an edge-case infinite loop in addImplicitParentheses. Fixed exponential slowdown with long chains of function calls. Globals no longer leak into the CoffeeScript REPL. Splatted parameters are declared local to the function.

1.0.1 - +

Fixed a lexer bug with Unicode identifiers. Updated REPL for compatibility with Node.js 0.3.7. Fixed requiring relative paths in the REPL. Trailing return and return undefined are now optimized away. Stopped requiring the core Node.js util module for back-compatibility with Node.js 0.2.5. Fixed a case where a conditional return would cause fallthrough in a switch statement. Optimized empty objects in destructuring assignment.

1.0.0 - +

CoffeeScript loops no longer try to preserve block scope when functions are being generated within the loop body. Instead, you can use the do keyword to create a convenient closure wrapper. Added a --nodejs flag for passing through options directly to the node executable. Better behavior around the use of pure statements within expressions. Fixed inclusive slicing through -1, for all browsers, and splicing with arbitrary expressions as endpoints.

0.9.6 - +

The REPL now properly formats stacktraces, and stays alive through asynchronous exceptions. Using --watch now prints timestamps as files are compiled. Fixed some accidentally-leaking variables within plucked closure-loops. Constructors now maintain their declaration location within a class body. Dynamic object keys were removed. Nested classes are now supported. Fixes execution context for naked splatted functions. Bugfix for inversion of chained comparisons. Chained class instantiation now works properly with splats.

0.9.5 - +

0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from satyr’s Coco dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. undefined now works like null, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: result = i for i in list used to parse as result = (i for i in list) by default … it now parses as (result = i) for i in list.

0.9.4 - +

CoffeeScript now uses appropriately-named temporary variables, and recycles their references after use. Added require.extensions support for Node.js 0.3. Loading CoffeeScript in the browser now adds just a single CoffeeScript object to global scope. Fixes for implicit object and block comment edge cases.

0.9.3 - +

CoffeeScript switch statements now compile into JS switch statements — they previously compiled into if/else chains for JavaScript 1.3 compatibility. Soaking a function invocation is now supported. Users of the RubyMine editor should now be able to use --watch mode.

0.9.2 - +

Specifying the start and end of a range literal is now optional, eg. array[3..]. You can now say a not instanceof b. Fixed important bugs with nested significant and non-significant indentation (Issue #637). Added a --require flag that allows you to hook into the coffee command. Added a custom jsl.conf file for our preferred JavaScriptLint setup. Sped up Jison grammar compilation time by flattening rules for operations. Block comments can now be used with JavaScript-minifier-friendly syntax. Added JavaScript’s compound assignment bitwise operators. Bugfixes to implicit object literals with leading number and string keys, as the subject of implicit calls, and as part of compound assignment.

0.9.1 - +

Bugfix release for 0.9.1. Greatly improves the handling of mixed implicit objects, implicit function calls, and implicit indentation. String and regex interpolation is now strictly #{ … } (Ruby style). The compiler now takes a --require flag, which specifies scripts to run before compilation.

0.9.0 - +

The CoffeeScript 0.9 series is considered to be a release candidate for 1.0; let’s give her a shakedown cruise. 0.9.0 introduces a massive backwards-incompatible change: Assignment now uses =, and object literals use :, as in JavaScript. This allows us to have implicit object literals, and YAML-style object definitions. Half assignments are removed, in favor of +=, or=, and friends. Interpolation now uses a hash mark # instead of the dollar sign $ — because dollar signs may be part of a valid JS identifier. Downwards range comprehensions are now safe again, and are optimized to straight for loops when created with integer endpoints. A fast, unguarded form of object comprehension was added: for all key, value of object. Mentioning the super keyword with no arguments now forwards all arguments passed to the function, as in Ruby. If you extend class B from parent class A, if A has an extended method defined, it will be called, passing in B — this enables static inheritance, among other things. Cleaner output for functions bound with the fat arrow. @variables can now be used in parameter lists, with the parameter being automatically set as a property on the object — useful in constructors and setter functions. Constructor functions can now take splats.

0.7.2 - +

Quick bugfix (right after 0.7.1) for a problem that prevented coffee command-line options from being parsed in some circumstances.

0.7.1 - +

Block-style comments are now passed through and printed as JavaScript block comments – making them useful for licenses and copyright headers. Better support for running coffee scripts standalone via hashbangs. Improved syntax errors for tokens that are not in the grammar.

0.7.0 - +

Official CoffeeScript variable style is now camelCase, as in JavaScript. Reserved words are now allowed as object keys, and will be quoted for you. Range comprehensions now generate cleaner code, but you have to specify by -1 if you’d like to iterate downward. Reporting of syntax errors is greatly improved from the previous release. Running coffee with no arguments now launches the REPL, with Readline support. The <- bind operator has been removed from CoffeeScript. The loop keyword was added, which is equivalent to a while true loop. Comprehensions that contain closures will now close over their variables, like the semantics of a forEach. You can now use bound function in class definitions (bound to the instance). For consistency, a in b is now an array presence check, and a of b is an object-key check. Comments are no longer passed through to the generated JavaScript.

0.6.2 - +

The coffee command will now preserve directory structure when compiling a directory full of scripts. Fixed two omissions that were preventing the CoffeeScript compiler from running live within Internet Explorer. There’s now a syntax for block comments, similar in spirit to CoffeeScript’s heredocs. ECMA Harmony DRY-style pattern matching is now supported, where the name of the property is the same as the name of the value: {name, length}: func. Pattern matching is now allowed within comprehension variables. unless is now allowed in block form. until loops were added, as the inverse of while loops. switch statements are now allowed without switch object clauses. Compatible with Node.js v0.1.95.

0.6.1 - +

Upgraded CoffeeScript for compatibility with the new Node.js v0.1.90 series.

0.6.0 - +

Trailing commas are now allowed, a-la Python. Static properties may be assigned directly within class definitions, using @property notation.

0.5.6 - +

Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the <- bind operator. Allowing assignment to half-expressions instead of special ||=-style operators. The arguments object is no longer automatically converted into an array. After requiring coffeescript, Node.js can now directly load .coffee files, thanks to registerExtension. Multiple splats can now be used in function calls, arrays, and pattern matching.

0.5.5 - +

String interpolation, contributed by Stan Angeloff. Since --run has been the default since 0.5.3, updating --stdio and --eval to run by default, pass --compile as well if you’d like to print the result.

0.5.4 - +

Bugfix that corrects the Node.js global constants __filename and __dirname. Tweaks for more flexible parsing of nested function literals and improperly-indented comments. Updates for the latest Node.js API.

0.5.3 - +

CoffeeScript now has a syntax for defining classes. Many of the core components (Nodes, Lexer, Rewriter, Scope, Optparse) are using them. Cakefiles can use optparse.coffee to define options for tasks. --run is now the default flag for the coffee command, use --compile to save JavaScripts. Bugfix for an ambiguity between RegExp literals and chained divisions.

0.5.2 - +

Added a compressed version of the compiler for inclusion in web pages as /v2/browser-compiler/coffeescript.js. It’ll automatically run any script tags with type text/coffeescript for you. Added a --stdio option to the coffee command, for piped-in compiles.

0.5.1 - +

Improvements to null soaking with the existential operator, including soaks on indexed properties. Added conditions to while loops, so you can use them as filters with when, in the same manner as comprehensions.

0.5.0 - +

CoffeeScript 0.5.0 is a major release, While there are no language changes, the Ruby compiler has been removed in favor of a self-hosting compiler written in pure CoffeeScript.

0.3.2 - +

@property is now a shorthand for this.property. Switched the default JavaScript engine from Narwhal to Node.js. Pass the --narwhal flag if you’d like to continue using it.

0.3.0 - +

CoffeeScript 0.3 includes major syntax changes: The function symbol was changed to ->, and the bound function symbol is now =>. Parameter lists in function definitions must now be wrapped in parentheses. @@ -6140,23 +6140,23 @@

Removed the obsolete block literal syntax.

0.2.6 - +

Added Python-style chained comparisons, the conditional existence operator ?=, and some examples from Beautiful Code. Bugfixes relating to statement-to-expression conversion, arguments-to-array conversion, and the TextMate syntax highlighter.

0.2.5 - +

The conditions in switch statements can now take multiple values at once — If any of them are true, the case will run. Added the long arrow ==>, which defines and immediately binds a function to this. While loops can now be used as expressions, in the same way that comprehensions can. Splats can be used within pattern matches to soak up the rest of an array.

0.2.4 - +

Added ECMAScript Harmony style destructuring assignment, for dealing with extracting values from nested arrays and objects. Added indentation-sensitive heredocs for nicely formatted strings or chunks of code.

0.2.3 - +

Axed the unsatisfactory ino keyword, replacing it with of for object comprehensions. They now look like: for prop, value of object.

0.2.2 - +

When performing a comprehension over an object, use ino, instead of in, which helps us generate smaller, more efficient code at compile time. Added :: as a shorthand for saying .prototype. The “splat” symbol has been changed from a prefix asterisk *, to a postfix ellipsis ... @@ -6165,39 +6165,39 @@

The extends keyword now functions identically to goog.inherits in Google’s Closure Library.

0.2.1 - +

Arguments objects are now converted into real arrays when referenced.

0.2.0 - +

Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to Liam O’Connor-Davis for whitespace and expression help.

0.1.6 - +

Bugfix for running coffee --interactive and --run from outside of the CoffeeScript directory. Bugfix for nested function/if-statements.

0.1.5 - +

Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use \ to escape newlines. The coffeescript command is now called coffee.

0.1.4 - +

The official CoffeeScript extension is now .coffee instead of .cs, which properly belongs to C#. Due to popular demand, you can now also use = to assign. Unlike JavaScript, = can also be used within object literals, interchangeably with :. Made a grammatical fix for chained function calls like func(1)(2)(3)(4). Inheritance and super no longer use __proto__, so they should be IE-compatible now.

0.1.3 - +

The coffee command now includes --interactive, which launches an interactive CoffeeScript session, and --run, which directly compiles and executes a script. Both options depend on a working installation of Narwhal. The aint keyword has been replaced by isnt, which goes together a little smoother with is. Quoted strings are now allowed as identifiers within object literals: eg. {"5+5": 10}. All assignment operators now use a colon: +:, -:, *:, etc.

0.1.2 - +

Fixed a bug with calling super() through more than one level of inheritance, with the re-addition of the extends keyword. Added experimental Narwhal support (as a Tusk package), contributed by Tom Robinson, including bin/cs as a CoffeeScript REPL and interpreter. New --no-wrap option to suppress the safety function wrapper.

0.1.1 - +

Added instanceof and typeof as operators.

0.1.0 - +

Initial CoffeeScript release.

@@ -6212,7 +6212,7 @@

diff --git a/documentation/site/docs.coffee b/documentation/site/docs.coffee index 7456733d1e..14c915fa32 100644 --- a/documentation/site/docs.coffee +++ b/documentation/site/docs.coffee @@ -14,6 +14,16 @@ window.gtag 'config', window.GA_TRACKING_ID # Initialize the CoffeeScript docs interactions $(document).ready -> + # Format dates for the user’s locale, e.g. 'December 24, 2009' or '24 décembre 2009' + $('time').each (index, el) -> + date = el.dateTime or $(el).text() + formattedDate = new Date(date).toLocaleDateString undefined, # undefined to use browser locale + year: 'numeric' + month: 'long' + day: 'numeric' + $(el).text formattedDate.toString() + + # Mobile navigation toggleSidebar = -> $('.navbar-toggler, .sidebar').toggleClass 'show' From 8482502e899951bd7e34cbde6539baaf78becd45 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sun, 13 May 2018 17:59:21 -0700 Subject: [PATCH 3/5] Consistent names --- docs/v2/index.html | 4 ++-- ...king_change_fat_arrow.md => breaking_changes_fat_arrow.md} | 0 documentation/site/body.html | 4 ++-- documentation/site/sidebar.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename documentation/sections/{breaking_change_fat_arrow.md => breaking_changes_fat_arrow.md} (100%) diff --git a/docs/v2/index.html b/docs/v2/index.html index 0d478a7a6f..1e00aed9f1 100644 --- a/docs/v2/index.html +++ b/docs/v2/index.html @@ -661,7 +661,7 @@ Breaking Changes From 1.x Breaking Changes From 1.x