[Documentation] Code block spacing now consistent

This commit is contained in:
Alex M 2016-08-24 23:23:57 +03:00
parent 2cb636b050
commit 30750e63aa

View File

@ -130,7 +130,6 @@ to this plugin as tutorials/todo as well.) We will start with an "empty bundle",
one which exposes no extensions - which looks like: one which exposes no extensions - which looks like:
```diff ```diff
define([ define([
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
@ -144,7 +143,6 @@ define([
} }
}); });
}); });
``` ```
__tutorials/todo/bundle.js__ __tutorials/todo/bundle.js__
@ -348,6 +346,7 @@ deeper explanation of domain objects, see the Open MCT Developer Guide.)
In the case of our to-do list feature, the to-do list itself is the thing we'll In the case of our to-do list feature, the to-do list itself is the thing we'll
want users to be able to create and edit. So, we will add that as a new type in want users to be able to create and edit. So, we will add that as a new type in
our bundle definition: our bundle definition:
```diff ```diff
define([ define([
'legacyRegistry' 'legacyRegistry'
@ -370,7 +369,6 @@ define([
+ ]} + ]}
}); });
}); });
``` ```
__tutorials/todo/bundle.js__ __tutorials/todo/bundle.js__
@ -427,7 +425,6 @@ are stored by convention.)
</li> </li>
</ul> </ul>
``` ```
__tutorials/todo/res/templates/todo.html__ __tutorials/todo/res/templates/todo.html__
A summary of what's included: A summary of what's included:
@ -573,6 +570,7 @@ We will define that in an AMD module (see http://requirejs.org/docs/whyamd.html)
in the directory `tutorials/todo/src/controllers` (`src` is, by default, the in the directory `tutorials/todo/src/controllers` (`src` is, by default, the
directory where bundle-related source code is kept, and controllers is where directory where bundle-related source code is kept, and controllers is where
Angular controllers are stored by convention.) Angular controllers are stored by convention.)
```diff ```diff
define(function () { define(function () {
function TodoController($scope) { function TodoController($scope) {
@ -971,6 +969,7 @@ by the tool bar we've defined.
Additionally, we need to make changes to our template to select specific tasks Additionally, we need to make changes to our template to select specific tasks
in response to some user gesture. Here, we will select tasks when a user clicks in response to some user gesture. Here, we will select tasks when a user clicks
the description. the description.
```diff ```diff
<div ng-controller="TodoController"> <div ng-controller="TodoController">
<div> <div>
@ -996,6 +995,7 @@ __tutorials/todo/res/templates/todo.html__
Finally, the `TodoController` uses the `dialogService` now, so we need to Finally, the `TodoController` uses the `dialogService` now, so we need to
declare that dependency in its extension definition: declare that dependency in its extension definition:
```diff ```diff
define([ define([
'legacyRegistry', 'legacyRegistry',
@ -1248,7 +1248,6 @@ another file to the res directory of our bundle; this time, it is `css/todo.css`
font-style: italic; font-style: italic;
} }
``` ```
__tutorials/todo/res/css/todo.css__ __tutorials/todo/res/css/todo.css__
Here, we have defined classes and appearances for: Here, we have defined classes and appearances for:
@ -1261,6 +1260,7 @@ Here, we have defined classes and appearances for:
To include this CSS file in our running instance of Open MCT, we need to To include this CSS file in our running instance of Open MCT, we need to
declare it in our bundle definition, this time as an extension of category declare it in our bundle definition, this time as an extension of category
`stylesheets`: `stylesheets`:
```diff ```diff
define([ define([
'legacyRegistry', 'legacyRegistry',
@ -1430,7 +1430,6 @@ define([
}); });
}); });
``` ```
__tutorials/bargraph/bundle.js__ __tutorials/bargraph/bundle.js__
The view definition should look familiar after the To-Do List tutorial, with The view definition should look familiar after the To-Do List tutorial, with
@ -1499,6 +1498,7 @@ The third is for labels along the horizontal axis, which will indicate which
bar corresponds to which telemetry point. Inline `style` attributes are used bar corresponds to which telemetry point. Inline `style` attributes are used
wherever dynamic positioning (handled by a script) is anticipated. wherever dynamic positioning (handled by a script) is anticipated.
The corresponding CSS file which styles and positions these elements: The corresponding CSS file which styles and positions these elements:
```diff ```diff
.example-bargraph { .example-bargraph {
position: absolute; position: absolute;
@ -1596,6 +1596,7 @@ actual telemetry data in subsequent steps.)
Notably, we will not try to show telemetry data after this step. Notably, we will not try to show telemetry data after this step.
To support this, we will add a new controller which supports our Bar Graph view: To support this, we will add a new controller which supports our Bar Graph view:
```diff ```diff
define(function () { define(function () {
function BarGraphController($scope, telemetryHandler) { function BarGraphController($scope, telemetryHandler) {
@ -1647,6 +1648,7 @@ Whenever the telemetry handler invokes its callbacks, we update the set of
telemetry objects in view, as well as the width for each bar. telemetry objects in view, as well as the width for each bar.
We will also utilize this from our template: We will also utilize this from our template:
```diff ```diff
+ <div class="example-bargraph" ng-controller="BarGraphController"> + <div class="example-bargraph" ng-controller="BarGraphController">
<div class="example-tick-labels"> <div class="example-tick-labels">
@ -2471,7 +2473,6 @@ define([
}; };
}); });
``` ```
__main.js__ __main.js__
...we will be able to reload Open MCT and see that it is present: ...we will be able to reload Open MCT and see that it is present:
@ -2942,6 +2943,7 @@ identifier, the pending promise is resolved.
This `history` method will be used by a `telemetryService` provider which we This `history` method will be used by a `telemetryService` provider which we
will implement: will implement:
```diff ```diff
/*global define*/ /*global define*/
@ -3027,6 +3029,7 @@ Finally, note that we also have a `subscribe` method, to satisfy the interface o
`telemetryService`, but this `subscribe` method currently does nothing. `telemetryService`, but this `subscribe` method currently does nothing.
This script uses an `ExampleTelemetrySeries` class, which looks like: This script uses an `ExampleTelemetrySeries` class, which looks like:
```diff ```diff
/*global define*/ /*global define*/
@ -3058,6 +3061,7 @@ This takes the array of telemetry values (as returned by the server) and wraps
it with the interface expected by the platform (the methods shown.) it with the interface expected by the platform (the methods shown.)
Finally, we expose this `telemetryService` provider declaratively: Finally, we expose this `telemetryService` provider declaratively:
```diff ```diff
define([ define([
'legacyRegistry', 'legacyRegistry',
@ -3324,7 +3328,6 @@ define(
} }
); );
``` ```
__tutorials/telemetry/src/ExampleTelemetryProvider.js__ __tutorials/telemetry/src/ExampleTelemetryProvider.js__
A quick summary of these changes: A quick summary of these changes: