-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs shorthand object notation #4356
Docs shorthand object notation #4356
Conversation
CoffeeScript has a shortcut for creating objects when you want the key | ||
to be set with a variable of the same name. | ||
</p> | ||
<%= code_for('objects_shorthand') %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file (documentation/index.html.erb) was renamed almost three years ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, my local commit didn't even have this in the commit, as I had just done git fetch origin pull/1808/head:docs-shorthand-object-notation
@danielbayley I think it’s easiest to start over from the latest master :) |
@lydell You're right 😄 So much for trying to do it the “proper” way… Fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spelling is Michelangelo.
@@ -0,0 +1,6 @@ | |||
pizzas = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for pizzas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best comment ever.
weapon: weapon | ||
}; | ||
|
||
output = turtle.name + " wears an " + turtle.mask + " mask."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please compile this file from objects_shorthand.coffee. Currently, it is out-of-sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lydell Hmm, the watch feature of cake doc:site
doesn't seem to be working properly for some reason…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lydell Hold on… so it watches the documentation/index.html.js
… shouldn't it [also] watch documentation/coffee/*.coffee
?
mask = "Orange" | ||
weapon = "Nunchuks" | ||
turtle = {name, mask, weapon} | ||
output = "#{turtle.name} wears an #{turtle.mask} mask." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "Michelangelo"
mask = "orange"
weapon = "nunchuks"
turtle = {name, mask, weapon}
output = "#{turtle.name} wears an #{turtle.mask} mask. Look out for his #{turtle.weapon}!"
better?
A simple but slightly more imaginative example of shorthand object notation. Closes #1808. Signed-off-by: Daniel Bayley <daniel.bayley@me.com>
@danielbayley You’re right, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A simple but slightly more imaginative example of shorthand object notation.
Closes #1808.