Skip to content

Commit 5787272

Browse files
sivakumar-kailasamJen Weber
authored and
Jen Weber
committed
Standardize docs code block declarations (#37)
* Replace file names starting with /tests/ with tests/ * change filename from `/app/` to `app/` * fix language name for js code blocks * Correct codeblocks language from apache to apacheconf * Correct codeblock language name from hbs to handlebars * correct language from `js` to `javascript` in code blocks * change `shell` and `sh` to `bash in languages * Correct `sh` to `bash` in language * Fix filepaths for config path * Remove whitespace between ``` and language * fix codeblocks for .jshintrc files * Fix codeblocks for acceptance tests * Fix typo in guides * Fix syntatic mistakes * Add language to codeblock * Fix codeblocks * Fix code block backticks * Fix filename extension * Standardise codeblock languages. Some fenced blocks don't have languages mentioned & some don't use the data-diff format for diff. this fixes it
1 parent 2ac0ee8 commit 5787272

File tree

474 files changed

+1778
-1780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

474 files changed

+1778
-1780
lines changed

guides/v1.10.0/components/handling-user-interaction-with-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To make a reusable control useful, however, you first need to allow
66
users of your application to interact with it.
77

88
You can make elements in your component interactive by using the
9-
`{{action}}` helper. This is the [same `{{action}}` helper you use in
9+
`{{action}}` helper. This is the same `{{action}}` helper you use in
1010
[application templates](../../templates/actions/), but it has an
1111
important difference when used inside a component.
1212

guides/v1.10.0/components/passing-properties-to-a-component.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ App.IndexRoute = Ember.Route.extend({
2727
```
2828

2929
```handlebars
30-
{{! index.handlebars }}
30+
{{!-- index.handlebars --}}
3131
<h1>Template: {{title}}</h1>
3232
{{blog-post}}
3333
```
@@ -54,7 +54,7 @@ available inside the component's template using the same name, `title`.
5454
If, in the above example, the model's `title` property was instead
5555
called `name`, we would change the component usage to:
5656

57-
```
57+
```handlebars
5858
{{blog-post title=name}}
5959
```
6060

guides/v1.10.0/components/sending-actions-from-components-to-your-application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ App.IndexRoute = Ember.Route.extend({
9494
```
9595

9696
```handlebars
97-
{{! index.handlebars }}
97+
{{!-- index.handlebars --}}
9898
9999
{{#each todo in todos}}
100100
<p>{{todo.title}} <button {{action "deleteTodo" todo}}>Delete</button></p>
@@ -138,7 +138,7 @@ Now we can update our initial template and replace the `{{action}}`
138138
helper with our new component:
139139

140140
```handlebars
141-
{{! index.handlebars }}
141+
{{!-- index.handlebars --}}
142142
143143
{{#each todo in todos}}
144144
<p>{{todo.title}} {{confirm-button title="Delete" action="deleteTodo" param=todo}}</p>

guides/v1.10.0/configuring-ember/disabling-prototype-extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ EmberENV.EXTEND_PROTOTYPES = false;
3535
```
3636

3737
Or you can choose class which you want to disable prototype extension.
38-
``` javascript
38+
```javascript
3939
EmberENV.EXTEND_PROTOTYPES = {
4040
String: false,
4141
Array: true

guides/v1.10.0/models/defining-models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ attribute types, and new types can be registered as transforms. See the
110110

111111
Example
112112

113-
```JavaScript
113+
```javascript
114114
var attr = DS.attr;
115115

116116
App.User = DS.Model.extend({

guides/v1.10.0/models/the-fixture-adapter.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Using the fixture adapter entails three very simple setup steps:
1616
Simply attach it as the `ApplicationAdapter` property on your instance
1717
of `Ember.Application`:
1818

19-
```JavaScript
19+
```javascript
2020
var App = Ember.Application.create();
2121
App.ApplicationAdapter = DS.FixtureAdapter;
2222
```
@@ -27,7 +27,7 @@ You should refer to [Defining a Model][1] for a more in-depth guide on using
2727
Ember Data Models, but for the purposes of demonstration we'll use an example
2828
modeling people who document Ember.js.
2929

30-
```JavaScript
30+
```javascript
3131
App.Documenter = DS.Model.extend({
3232
firstName: DS.attr( 'string' ),
3333
lastName: DS.attr( 'string' )
@@ -39,7 +39,7 @@ App.Documenter = DS.Model.extend({
3939
In order to attach fixtures to your model, you have to use `reopenClass` method and define
4040
fixtures:
4141

42-
```JavaScript
42+
```javascript
4343
App.Documenter.reopenClass({
4444
FIXTURES: [
4545
{ id: 1, firstName: 'Trek', lastName: 'Glowacki' },
@@ -51,7 +51,7 @@ App.Documenter.reopenClass({
5151
That's it! You can now use all of methods for [Finding Records][2] in your
5252
application. For example:
5353

54-
```JavaScript
54+
```javascript
5555
App.DocumenterRoute = Ember.Route.extend({
5656
model: function() {
5757
return this.store.find('documenter', 1); // returns a promise that will resolve

guides/v1.10.0/routing/specifying-a-routes-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ For example, if you transitioned to the `photo` route with a model whose
158158
`id` property was `47`, the URL in the user's browser would be updated
159159
to:
160160

161-
```shell
161+
```bash
162162
/photos/47
163163
```
164164

guides/v1.10.0/testing/testing-xhr.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ When a promise runs, it schedules fulfillment/rejection to be executed by the ru
1010

1111
Getting the results of a promise requires you to use the `then` method. Calling the `then` function on an existing promise:
1212

13-
``` javascript
13+
```javascript
1414
// let's call the existing promise promise1, so you'd write:
1515
promise1.then(fulfillmentCallback, rejectionCallback);
1616

@@ -27,7 +27,7 @@ In the case that `promise1` succeeds, then the `fulfillmentCallback` function wi
2727

2828
If you pass in a function to `then` it casts the function into a promise and returns the promise. The results of that promise will be what's returned from the function.
2929

30-
``` javascript
30+
```javascript
3131
// let's call the existing promise promise1 and will have the result `3`, so you'd write:
3232
var promise2 = promise1.then(function(results){
3333
return results + 2;
@@ -57,7 +57,7 @@ var promise4 = promise1.then(function(results){
5757

5858
If you pass a promise into `then` it will return the results of that promise.
5959

60-
``` javascript
60+
```javascript
6161
// let's call the existing promises promise1 and promise2, so you'd write:
6262
var promise3 = promise1.then(promise2);
6363

@@ -100,7 +100,7 @@ promise3.then(function(result){
100100
6. Run loop: run "fulfill the promise" task (which includes notifying all chained promises/observers of fulfillment)
101101
7. Run loop is off since there are no more tasks
102102

103-
``` javascript
103+
```javascript
104104
new Ember.RSVP.Promise(function(resolve){
105105
// resolve will run ~10 ms after the then has been called and is observing
106106
Ember.run.later(this, resolve, 'hello', 10);
@@ -121,7 +121,7 @@ new Ember.RSVP.Promise(function(resolve){
121121
8. Code: Observe Promise1 (since the promise has already fulfilled, schedule an async task to notify this observer of fulfillment)
122122
9. Uncaught Error: Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run
123123

124-
``` javascript
124+
```javascript
125125
var promise = new Ember.RSVP.Promise(function(resolve){
126126
// this will run before the then has happened below
127127
// and finish the triggered run loop

guides/v1.10.0/understanding-ember/dependency-injection-and-service-lookup.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Dependency injection and service lookup are two important framework concepts. The first, **dependency injection**, refers to a dependent object being injected onto another object during instantiation. For example, all route objects have the property `router` set on them during instantiation. We say that the dependency of the router has been injected onto the route object.
22

3-
```JavaScript
3+
```javascript
44
App.IndexRoute = Ember.Route.extend({
55
actions: {
66
showPath: function(){
@@ -13,7 +13,7 @@ App.IndexRoute = Ember.Route.extend({
1313

1414
Sometimes an Ember.js library will use dependency injection to expose its API to developers. An example of this is Ember-Data, which injects its store into all routes and controllers.
1515

16-
```JavaScript
16+
```javascript
1717
App.IndexController = Ember.ObjectController.extend({
1818
actions: {
1919
findItems: function(){
@@ -149,7 +149,7 @@ Instead of accessing the container directly, Ember provides an API for registeri
149149

150150
There are two ways to access this API. Many Ember applications can access this API directly on the application instance:
151151

152-
```JavaScript
152+
```javascript
153153
App = Ember.Application.create();
154154

155155
App.register('logger:main', {
@@ -163,7 +163,7 @@ App.inject('route', 'logger', 'logger:main');
163163

164164
But ember-cli applications (and libraries) will need to use a more flexible hook, an initializer:
165165

166-
```JavaScript
166+
```javascript
167167
Ember.Application.initializer({
168168
name: 'logger',
169169

@@ -184,7 +184,7 @@ Initializers can be declared at any time before an application is instantiated,
184184

185185
Any dependency injection is comprised of two parts. The first is the **factory registration**:
186186

187-
```JavaScript
187+
```javascript
188188
var logger = {
189189
log: function(m) {
190190
console.log(m);
@@ -198,7 +198,7 @@ The `register` function adds the factory (`logger`) into the container. It adds
198198

199199
Often, it is preferable to register a factory that can be instantiated:
200200

201-
```JavaScript
201+
```javascript
202202
var Logger = Ember.Object.extend({
203203
log: function(m) {
204204
console.log(m);
@@ -212,13 +212,13 @@ This class will be instantiated before it is used by the container. This gives i
212212

213213
The second part of dependency injection is, you guessed it, the **dependency injection**:
214214

215-
```JavaScript
215+
```javascript
216216
application.inject('route', 'logger', 'logger:main');
217217
```
218218

219219
This is an example of a *type injection*. Onto all factories of the type `route` the property, `logger` will be injected with the factory named `logger:main`. Routes in this example application can now access the logger:
220220

221-
```JavaScript
221+
```javascript
222222
App = Ember.Application.extend();
223223

224224
App.Logger = Ember.Object.extend({
@@ -248,7 +248,7 @@ App.create();
248248

249249
Injections can also be made on a specific factory by using its full name:
250250

251-
```JavaScript
251+
```javascript
252252
application.inject('route:index', 'logger', 'logger:main');
253253
```
254254

@@ -257,7 +257,7 @@ Injections can be made onto all of Ember's major framework classes, including vi
257257
**Note:** For injections into models (if not using ember-cli), you need to enable the `MODEL_FACTORY_INJECTIONS`
258258
flag before you initialize your application. You can do this like so:
259259

260-
```JavaScript
260+
```javascript
261261
Ember.MODEL_FACTORY_INJECTIONS = true;
262262

263263
var App = Ember.Application.create({

guides/v1.10.0/understanding-ember/the-view-layer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ And here's the Handlebars template that uses them:
336336
If you clicked on the `<h1>`, you'd see the following output in your
337337
browser's console:
338338

339-
```shell
339+
```bash
340340
Child!
341341
Parent!
342342
```

guides/v1.10.0/views/handling-events.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,37 @@ documentation below.
3131

3232
To have the click event from `App.ClickableView` affect the state of your application, simply send an event to the view's controller:
3333

34-
````javascript
34+
```javascript
3535
App.ClickableView = Ember.View.extend({
3636
click: function(evt) {
3737
this.get('controller').send('turnItUp', 11);
3838
}
3939
});
40-
````
40+
```
4141

4242
If the controller has an action handler called `turnItUp`, it will be called:
4343

44-
45-
````javascript
44+
```javascript
4645
App.PlaybackController = Ember.ObjectController.extend({
4746
actions: {
4847
turnItUp: function(level){
4948
//Do your thing
5049
}
5150
}
5251
});
53-
````
52+
```
5453

5554
If it doesn't, the message will be passed to the current route:
5655

57-
````javascript
56+
```javascript
5857
App.PlaybackRoute = Ember.Route.extend({
5958
actions: {
6059
turnItUp: function(level){
6160
//This won't be called if it's defined on App.PlaybackController
6261
}
6362
}
6463
});
65-
````
64+
```
6665

6766
To see a full listing of the `Ember.View` built-in events, see the
6867
documentation section on [Event Names](http://emberjs.com/api/classes/Ember.View.html#toc_event-names).

guides/v1.11.0/components/handling-user-interaction-with-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To make a reusable control useful, however, you first need to allow
66
users of your application to interact with it.
77

88
You can make elements in your component interactive by using the
9-
`{{action}}` helper. This is the [same `{{action}}` helper you use in
9+
`{{action}}` helper. This is the same `{{action}}` helper you use in
1010
[application templates](../../templates/actions/), but it has an
1111
important difference when used inside a component.
1212

guides/v1.11.0/models/defining-models.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ attribute types, and new types can be registered as transforms. See the
106106

107107
Example
108108

109-
```app/models/user.js
109+
```javascript {data-filename="app/models/user.js"}
110110
export default DS.Model.extend({
111111
username: DS.attr('string'),
112112
email: DS.attr('string'),
@@ -166,6 +166,7 @@ To declare a many-to-many relationship between two models, use
166166
export default DS.Model.extend({
167167
tags: DS.hasMany('tag')
168168
});
169+
```
169170

170171
```javascript {data-filename=app/models/tag.js}
171172
export default DS.Model.extend({

guides/v1.11.0/models/the-fixture-adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Using the fixture adapter entails three very simple setup steps:
1616
Simply attach it as the `ApplicationAdapter` property on your instance
1717
of `Ember.Application`:
1818

19-
```JavaScript
19+
```javascript
2020
var App = Ember.Application.create();
2121
App.ApplicationAdapter = DS.FixtureAdapter;
2222
```

guides/v1.11.0/routing/loading-and-error-substates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Router.map(function() {
2323
});
2424
```
2525

26-
```app/routes/foo/slow-model.s
26+
```javascript {data-filename="app/routes/foo/slow-model.js"}
2727
export default Ember.Route.extend({
2828
model: function() {
2929
return somePromiseThatTakesAWhileToResolve();

guides/v1.11.0/routing/specifying-a-routes-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ For example, if you transitioned to the `photo` route with a model whose
158158
`id` property was `47`, the URL in the user's browser would be updated
159159
to:
160160

161-
```shell
161+
```bash
162162
/photos/47
163163
```
164164

guides/v1.11.0/testing/test-helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Finally, don't forget to add your helpers in `tests/.jshintrc` and in
173173
`tests/helpers/start-app.js`. In `tests/.jshintrc` you need to add it in the
174174
`predef` section, otherwise you will get failing jshint tests:
175175

176-
```tests/.jshintc
176+
```json {data-filename="tests/.jshintrc"}
177177
{
178178
"predef": [
179179
"document",

guides/v1.11.0/understanding-ember/dependency-injection-and-service-lookup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ App.IndexRoute = Ember.Route.extend({
215215

216216
Injections can also be made on a specific factory by using its full name:
217217

218-
```JavaScript
218+
```javascript
219219
application.inject('route:index', 'logger', 'logger:main');
220220
```
221221

guides/v1.11.0/understanding-ember/the-view-layer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ And here's the Handlebars template that uses them:
336336
If you clicked on the `<h1>`, you'd see the following output in your
337337
browser's console:
338338

339-
```shell
339+
```bash
340340
Child!
341341
Parent!
342342
```

0 commit comments

Comments
 (0)