Skip to content

Commit 06cc95e

Browse files
authored
Merge pull request nasa#1381 from ev1stensberg/master
[DOCUMENTATION] Add linting to tutorial section
2 parents 09ebeeb + 62685cb commit 06cc95e

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

docs/src/tutorials/index.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ We will create this file in the directory tutorials/todo (we can hereafter refer
129129
to this plugin as tutorials/todo as well.) We will start with an "empty bundle",
130130
one which exposes no extensions - which looks like:
131131

132-
```diff
132+
```js
133133
define([
134134
'openmct'
135135
], function (
@@ -154,7 +154,7 @@ The tutorials will be updated with the new bundle registration mechanism once it
154154
has been finalized.
155155

156156
#### Before
157-
```diff
157+
```html
158158
<!--
159159
Open MCT, Copyright (c) 2014-2016, United States Government
160160
as represented by the Administrator of the National Aeronautics and Space
@@ -219,7 +219,7 @@ __index.html__
219219

220220
#### After
221221

222-
```diff
222+
```html
223223
<!--
224224
Open MCT, Copyright (c) 2014-2016, United States Government
225225
as represented by the Administrator of the National Aeronautics and Space
@@ -305,7 +305,7 @@ In the case of our to-do list feature, the to-do list itself is the thing we'll
305305
want users to be able to create and edit. So, we will add that as a new type in
306306
our bundle definition:
307307

308-
```diff
308+
```js
309309
define([
310310
'openmct'
311311
], function (
@@ -369,7 +369,7 @@ directory `tutorials/todo/res/templates` (`res` is, by default, the directory
369369
where bundle-related resources are kept, and `templates` is where HTML templates
370370
are stored by convention.)
371371

372-
```diff
372+
```html
373373
<div>
374374
<a href="">All</a>
375375
<a href="">Incomplete</a>
@@ -401,7 +401,7 @@ boolean `completed` flag.
401401
To expose this view in Open MCT, we need to declare it in our bundle
402402
definition:
403403

404-
```diff
404+
```js
405405
define([
406406
'openmct'
407407
], function (
@@ -458,7 +458,7 @@ the user to create these yet. As a temporary workaround to test the view, we
458458
will specify an initial state for To-do List domain object models in the
459459
definition of that type.
460460

461-
```diff
461+
```js
462462
define([
463463
'openmct'
464464
], function (
@@ -529,7 +529,7 @@ in the directory `tutorials/todo/src/controllers` (`src` is, by default, the
529529
directory where bundle-related source code is kept, and controllers is where
530530
Angular controllers are stored by convention.)
531531

532-
```diff
532+
```js
533533
define(function () {
534534
function TodoController($scope) {
535535
var showAll = true,
@@ -594,7 +594,7 @@ prior to our template being utilized.
594594
On its own, this controller merely exposes these functions; the next step is to
595595
use them from our template:
596596

597-
```diff
597+
```html
598598
+ <div ng-controller="TodoController">
599599
<div>
600600
+ <a ng-click="setVisibility(true)">All</a>
@@ -630,7 +630,7 @@ If we were to try to run at this point, we'd run into problems because the
630630
`TodoController` has not been registered with Angular. We need to first declare
631631
it in our bundle definition, as an extension of category `controllers`:
632632

633-
```diff
633+
```js
634634
define([
635635
'openmct',
636636
+ './src/controllers/TodoController'
@@ -724,7 +724,7 @@ An Editing user interface is typically handled in a tool bar associated with a
724724
view. The contents of this tool bar are defined declaratively in a view's
725725
extension definition.
726726

727-
```diff
727+
```js
728728
define([
729729
'openmct',
730730
'./src/controllers/TodoController'
@@ -813,7 +813,7 @@ all the applicable controls, which means no controls at all.
813813

814814
To support selection, we will need to make some changes to our controller:
815815

816-
```diff
816+
```js
817817
define(function () {
818818
+ // Form to display when adding new tasks
819819
+ var NEW_TASK_FORM = {
@@ -928,7 +928,7 @@ Additionally, we need to make changes to our template to select specific tasks
928928
in response to some user gesture. Here, we will select tasks when a user clicks
929929
the description.
930930

931-
```diff
931+
```html
932932
<div ng-controller="TodoController">
933933
<div>
934934
<a ng-click="setVisibility(true)">All</a>
@@ -954,7 +954,7 @@ __tutorials/todo/res/templates/todo.html__
954954
Finally, the `TodoController` uses the `dialogService` now, so we need to
955955
declare that dependency in its extension definition:
956956

957-
```diff
957+
```js
958958
define([
959959
'openmct',
960960
'./src/controllers/TodoController'
@@ -1058,7 +1058,7 @@ In this section, our goal is to:
10581058
To support the first two, we'll need to expose some methods for checking these
10591059
states in the controller:
10601060

1061-
```diff
1061+
```js
10621062
define(function () {
10631063
// Form to display when adding new tasks
10641064
var NEW_TASK_FORM = {
@@ -1175,7 +1175,7 @@ states visually, and to generally improve the appearance of our view. We add
11751175
another file to the res directory of our bundle; this time, it is `css/todo.css`
11761176
(with the `css` directory again being a convention.)
11771177

1178-
```diff
1178+
```css
11791179
.example-todo div.example-button-group {
11801180
margin-top: 12px;
11811181
margin-bottom: 12px;
@@ -1219,7 +1219,7 @@ To include this CSS file in our running instance of Open MCT, we need to
12191219
declare it in our bundle definition, this time as an extension of category
12201220
`stylesheets`:
12211221

1222-
```diff
1222+
```js
12231223
define([
12241224
'openmct',
12251225
'./src/controllers/TodoController'
@@ -1299,7 +1299,7 @@ To-Do List's type above; now To-Do Lists will start off empty.
12991299

13001300
Finally, let's utilize these changes from our view's template:
13011301

1302-
```diff
1302+
```html
13031303
+ <div ng-controller="TodoController" class="example-todo">
13041304
+ <div class="example-button-group">
13051305
+ <a ng-class="{ selected: checkVisibility(true) }"
@@ -1359,7 +1359,7 @@ We'll also be defining some custom styles, so we'll include that extension as
13591359
well. We'll be creating this plugin in `tutorials/bargraph`, so our initial
13601360
bundle definition looks like:
13611361

1362-
```diff
1362+
```js
13631363
define([
13641364
'openmct'
13651365
], function (
@@ -1406,7 +1406,7 @@ For this tutorial, we'll assume that we've sketched out our template and CSS
14061406
file ahead of time to describe the general look we want for the view. These
14071407
look like:
14081408

1409-
```diff
1409+
```html
14101410
<div class="example-bargraph">
14111411
<div class="example-tick-labels">
14121412
<div class="example-tick-label" style="bottom: 0%">High</div>
@@ -1457,7 +1457,7 @@ bar corresponds to which telemetry point. Inline `style` attributes are used
14571457
wherever dynamic positioning (handled by a script) is anticipated.
14581458
The corresponding CSS file which styles and positions these elements:
14591459

1460-
```diff
1460+
```css
14611461
.example-bargraph {
14621462
position: absolute;
14631463
top: 0;
@@ -1555,7 +1555,7 @@ Notably, we will not try to show telemetry data after this step.
15551555

15561556
To support this, we will add a new controller which supports our Bar Graph view:
15571557

1558-
```diff
1558+
```js
15591559
define(function () {
15601560
function BarGraphController($scope, telemetryHandler) {
15611561
var handle;
@@ -1607,7 +1607,7 @@ telemetry objects in view, as well as the width for each bar.
16071607

16081608
We will also utilize this from our template:
16091609

1610-
```diff
1610+
```html
16111611
+ <div class="example-bargraph" ng-controller="BarGraphController">
16121612
<div class="example-tick-labels">
16131613
+ <div ng-repeat="value in [low, middle, high] track by $index"
@@ -1660,7 +1660,7 @@ Finally, we expose our controller from our bundle definition. Note that the
16601660
depends declaration includes both `$scope` as well as the `telemetryHandler`
16611661
service we made use of.
16621662

1663-
```diff
1663+
```js
16641664
define([
16651665
'openmct',
16661666
'./src/controllers/BarGraphController'
@@ -1715,7 +1715,7 @@ First, let's add expose some more functionality from our controller. To make it
17151715
simple, we'll expose the top and bottom for a bar graph for a given
17161716
telemetry-providing domain object, as percentages.
17171717

1718-
```diff
1718+
```js
17191719
define(function () {
17201720
function BarGraphController($scope, telemetryHandler) {
17211721
var handle;
@@ -1767,7 +1767,7 @@ decide this.
17671767

17681768
Next, we utilize this functionality from the template:
17691769

1770-
```diff
1770+
```html
17711771
<div class="example-bargraph" ng-controller="BarGraphController">
17721772
<div class="example-tick-labels">
17731773
<div ng-repeat="value in [low, middle, high] track by $index"
@@ -1826,7 +1826,7 @@ when we return to our view later, those changes will be persisted.
18261826

18271827
First, let's add a tool bar for changing these three values in Edit mode:
18281828

1829-
```diff
1829+
```js
18301830
define([
18311831
'openmct',
18321832
'./src/controllers/BarGraphController'
@@ -1900,7 +1900,7 @@ a view proxy to work from. We will add this to our controller, and additionally
19001900
will start reading/writing those properties to the view's `configuration`
19011901
object.
19021902

1903-
```diff
1903+
```js
19041904
define(function () {
19051905
function BarGraphController($scope, telemetryHandler) {
19061906
var handle;
@@ -2023,7 +2023,7 @@ For purposes of this tutorial, a simple node server is provided to stand
20232023
in place of this existing telemetry system. It generates real-time data
20242024
and exposes it over a WebSocket connection.
20252025

2026-
```diff
2026+
```js
20272027
/*global require,process,console*/
20282028

20292029
var CONFIG = {
@@ -2205,7 +2205,7 @@ used by the server. It uses a custom format and, for purposes of example,
22052205
contains three "subsystems" containing a mix of numeric and string-based
22062206
telemetry.
22072207

2208-
```diff
2208+
```json
22092209
{
22102210
"name": "Example Spacecraft",
22112211
"identifier": "sc",
@@ -2432,7 +2432,7 @@ server. Our first step will be to add a service that will handle interactions
24322432
with the server; this will not be used by Open MCT directly, but will be
24332433
used by subsequent components we add.
24342434

2435-
```diff
2435+
```js
24362436
/*global define,WebSocket*/
24372437

24382438
define(
@@ -2487,7 +2487,7 @@ subsystems. This means that we need to convert the data from the dictionary
24872487
into domain object models, and expose these to Open MCT via a
24882488
`modelService`.
24892489

2490-
```diff
2490+
```js
24912491
/*global define*/
24922492

24932493
define(
@@ -2621,7 +2621,7 @@ This allows our telemetry dictionary to be expressed as domain object models
26212621
fix this, we will need another script which will add these subsystems to the
26222622
root-level object we added in Step 1.
26232623

2624-
```diff
2624+
```js
26252625
/*global define*/
26262626

26272627
define(
@@ -2686,7 +2686,7 @@ Finally, we wire in these changes by modifying our plugin's `bundle.js` to
26862686
provide metadata about how these pieces interact (both with each other, and
26872687
with the platform):
26882688

2689-
```diff
2689+
```js
26902690
define([
26912691
'openmct',
26922692
+ './src/ExampleTelemetryServerAdapter',
@@ -2834,7 +2834,7 @@ will do so for the server's historical telemetry.
28342834
Our first step will be to add a method to our server adapter which allows us to
28352835
send history requests to the server:
28362836

2837-
```diff
2837+
```js
28382838
/*global define,WebSocket*/
28392839

28402840
define(
@@ -2893,7 +2893,7 @@ identifier, the pending promise is resolved.
28932893
This `history` method will be used by a `telemetryService` provider which we
28942894
will implement:
28952895

2896-
```diff
2896+
```js
28972897
/*global define*/
28982898

28992899
define(
@@ -2979,7 +2979,7 @@ Finally, note that we also have a `subscribe` method, to satisfy the interface o
29792979

29802980
This script uses an `ExampleTelemetrySeries` class, which looks like:
29812981

2982-
```diff
2982+
```js
29832983
/*global define*/
29842984

29852985
define(
@@ -3011,7 +3011,7 @@ it with the interface expected by the platform (the methods shown.)
30113011

30123012
Finally, we expose this `telemetryService` provider declaratively:
30133013

3014-
```diff
3014+
```js
30153015
define([
30163016
'openmct',
30173017
'./src/ExampleTelemetryServerAdapter',
@@ -3126,7 +3126,7 @@ Finally, we want to utilize the server's ability to subscribe to telemetry
31263126
from Open MCT. To do this, first we want to expose some new methods for
31273127
this from our server adapter:
31283128

3129-
```diff
3129+
```js
31303130
/*global define,WebSocket*/
31313131

31323132
define(
@@ -3199,7 +3199,7 @@ with these subscriptions.
31993199

32003200
We then need only to utilize these methods from our `telemetryService`:
32013201

3202-
```diff
3202+
```js
32033203
/*global define*/
32043204

32053205
define(
@@ -3305,4 +3305,4 @@ server can handle this.)
33053305
Running Open MCT again, we can still plot our historical telemetry - but
33063306
now we also see that it updates in real-time as more data comes in from the
33073307
server.
3308-
3308+

0 commit comments

Comments
 (0)