Skip to content

Commit 8c31cfb

Browse files
authored
Merge pull request NativeScript#2419 from NativeScript/hdeshev/doc-snippets-fixes
Fix unclosed snippet tags and duplicate snippets.
2 parents a497429 + 846bafc commit 8c31cfb

Some content is hidden

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

61 files changed

+349
-349
lines changed

tests/app/application-settings.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ previous_url: /ApiReference/application-settings/HOW-TO
77
---
88
# Application Settings
99
Using application settings methods requires to load "application settings" module.
10-
<snippet id='application-settings-require'/>
10+
{%snippet application-settings-require%}
1111

1212
## Working with string, number and boolean values
1313
### Set and get boolean value and provide default value in case it is not set
14-
<snippet id='application-settings-boolean'/>
14+
{%snippet application-settings-boolean%}
1515

1616
### Set and get string value
17-
<snippet id='application-settings-string'/>
17+
{%snippet application-settings-string%}
1818

1919
### Set and get numeric value.
2020
We use `toFixed()` here in order to avoid floating point errors - ex: `54.321` becoming `54.320999999537`.
2121
Beware the result of `toFixed()` is a string not a number therefore you cannot use `===` or `!==` when comparing with a number.
22-
<snippet id='application-settings-number'/>
22+
{%snippet application-settings-number%}
2323

2424
### Reading values that are not set before while providing default value
25-
<snippet id='application-settings-notset'/>
25+
{%snippet application-settings-notset%}
2626

2727
### Reading values that are not set before not providing default value
28-
<snippet id='application-settings-nodefault'/>
28+
{%snippet application-settings-nodefault%}
2929

3030
## Other functions
3131
### Checking for existence of value for key
32-
<snippet id='application-settings-haskey'/>
32+
{%snippet application-settings-haskey%}
3333

3434
### Removing value for key
35-
<snippet id='application-settings-removekey'/>
35+
{%snippet application-settings-removekey%}
3636

3737
### Removing all values
38-
<snippet id='application-settings-clear'/>
38+
{%snippet application-settings-clear%}

tests/app/application.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ previous_url: /ApiReference/application/HOW-TO
99
The Application module provides abstraction over the platform-specific Application implementations.
1010
It is the main BCL module and is required for other BCL modules to work properly.
1111
The default bootstrap.js implementation for each platform loads and initializes this module.
12-
<snippet id='application-require'/>
12+
{%snippet application-require%}
1313

1414
The pre-required `app` module is used throughout the following code snippets.
1515
### Checking the target platform
1616
Use the following code in case you need to check somewhere in your code the platform you are running against:
17-
<snippet id='application-app-check'/>
17+
{%snippet application-app-check%}
1818

1919
### Using the Android-specific implementation
2020
Accessing the Android-specific object instance (will be undefined if running on iOS)
2121

22-
<snippet id='application-app-android'/>
22+
{%snippet application-app-android%}
2323

2424
### Using the Android Application context
25-
<snippet id='application-app-android-context'/>
25+
{%snippet application-app-android-context%}
2626

2727
### Tracking the current Activity
28-
<snippet id='application-app-android-current'/>
28+
{%snippet application-app-android-current%}
2929

3030
### Registering a Broadcast Receiver (Android)
31-
<snippet id='application-app-android-broadcast'/>
31+
{%snippet application-app-android-broadcast%}
3232

3333
### Adding a Notification Observer (iOS)
34-
<snippet id='application-ios-observer'/>
34+
{%snippet application-ios-observer%}

tests/app/camera.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ previous_url: /ApiReference/camera/HOW-TO
77
---
88
# Camera module
99
Using a camera requires the camera module.
10-
<snippet id='camera-require'/>
10+
{%snippet camera-require%}
1111

1212
### Taking a picture.
13-
<snippet id='camera-take-picture'/>
13+
{%snippet camera-take-picture%}
1414

1515
### Check for availability
16-
<snippet id='camera-is-availabile'/>
16+
{%snippet camera-is-availabile%}

tests/app/color.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ previous_url: /ApiReference/color/HOW-TO
77
---
88
# Color
99
Using Colors requires the "color" module.
10-
<snippet id='color-require'/>
10+
{%snippet color-require%}
1111

1212
### Creating a Color from a hex value.
13-
<snippet id='color-hex'/>
13+
{%snippet color-hex%}
1414

1515
### Creating a Color from a short hex value.
16-
<snippet id='color-hex-short'/>
16+
{%snippet color-hex-short%}
1717

1818
### Creating a Color from four ARGB values
19-
<snippet id='color-rgb'/>
19+
{%snippet color-rgb%}
2020

2121
### Creating a Color from a single ARGB value
22-
<snippet id='color-rgb-single'/>
22+
{%snippet color-rgb-single%}

tests/app/connectivity.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ previous_url: /ApiReference/connectivity/HOW-TO
77
---
88
# Connectivity
99
Obtaining connectivity information requires the "connectivity" module.
10-
<snippet id='connectivity-require'/>
10+
{%snippet connectivity-require%}
1111

1212
### Getting connection type
13-
<snippet id='connectivity-type'/>
13+
{%snippet connectivity-type%}
1414

1515
### Monitoring connection type.
16-
<snippet id='connectivity-monitoring'/>
16+
{%snippet connectivity-monitoring%}

tests/app/console.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ previous_url: /ApiReference/console/HOW-TO
99
### Logging
1010
Logging to the console does not require the "console" module since the console variable is global. It can be used anywhere within your code.
1111
You can log your message in several different categories.
12-
<snippet id='console-log'/>
12+
{%snippet console-log%}
1313

1414
### Time
1515
Begins counting a time span for a given name (key).
16-
<snippet id='console-time'/>
16+
{%snippet console-time%}
1717

1818
Ends a previously started time span through the time method.
19-
<snippet id='console-timeend'/>
19+
{%snippet console-timeend%}
2020

2121
### Assert
2222
Asserts a boolean condition and prints a message in case the assert fails.
23-
<snippet id='console-assert'/>
23+
{%snippet console-assert%}
2424

2525
### Dir
2626
Prints the state of the specified object to the console.
27-
<snippet id='console-dir'/>
27+
{%snippet console-dir%}
2828

2929
### Dump
3030
Prints the state of the specified object to the console.
31-
<snippet id='console-dump'/>
31+
{%snippet console-dump%}
3232

3333
### Trace
3434
Prints the current stack trace in the console.
35-
<snippet id='console-trace'/>
35+
{%snippet console-trace%}

tests/app/data/observable-array-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export var test_ObservableArray_joinShouldReturnStringWithAllItemsSeparatedWithC
9898
// >> observable-array-join
9999
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
100100
var result = array.join();
101-
// >> observable-array-join
101+
// << observable-array-join
102102
TKUnit.assert(result === "1,2,3", "ObservableArray join() should return string with all items separated with comma!");
103103
};
104104

tests/app/data/observable-array.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,109 +6,109 @@ description: "Examples for using observable-array"
66
previous_url: /ApiReference/data/observable-array/HOW-TO
77
---
88
# Observable Array module
9-
<snippet id='observable-array-require'/>
9+
{%snippet observable-array-require%}
1010

1111
### Create ObservableArray from array.
12-
<snippet id='observable-array-create'/>
12+
{%snippet observable-array-create%}
1313

1414
### Create ObservableArray from arguments.
15-
<snippet id='observable-array-arguments'/>
15+
{%snippet observable-array-arguments%}
1616

1717
### Create ObservableArray with specific length.
18-
<snippet id='observable-array-length'/>
18+
{%snippet observable-array-length%}
1919

2020
### Set ObservableArray length to new value.
21-
<snippet id='observable-array-newvalue'/>
21+
{%snippet observable-array-newvalue%}
2222

2323
### Get item at specified index using getItem(index) method.
24-
<snippet id='observable-array-getitem'/>
24+
{%snippet observable-array-getitem%}
2525

2626
### Set item at specified index using setItem(index, item) method.
27-
<snippet id='observable-array-setitem'/>
27+
{%snippet observable-array-setitem%}
2828

2929
### Set item at specified index using setItem(index, item) method and observe change event data.
30-
<snippet id='observable-array-eventdata'/>
30+
{%snippet observable-array-eventdata%}
3131

3232
### Use concat() method to combine ObservableArray with array.
33-
<snippet id='observable-array-combine'/>
33+
{%snippet observable-array-combine%}
3434

3535
### Use join() method to convert ObservableArray to comma separated string.
36-
<snippet id='observable-array-join'/>
36+
{%snippet observable-array-join%}
3737

3838
### Use join(separator) method to convert ObservableArray to string separated with specified separator.
39-
<snippet id='observable-array-join-separator'/>
39+
{%snippet observable-array-join-separator%}
4040

4141
### Use pop() method to remove the last element.
42-
<snippet id='observable-array-join-pop'/>
42+
{%snippet observable-array-join-pop%}
4343

4444
### Handle "change" event to know more info about the change after calling pop() method.
45-
<snippet id='observable-array-join-change'/>
45+
{%snippet observable-array-join-change%}
4646

4747
### Use push() method to add single element to the array.
48-
<snippet id='observable-array-push'/>
48+
{%snippet observable-array-push%}
4949

5050
### Handle "change" event to know more info about the change after calling push() method with single element.
51-
<snippet id='observable-array-change-push'/>
51+
{%snippet observable-array-change-push%}
5252

5353
### Use push() method to add multiple elements to the array.
54-
<snippet id='observable-array-push-multiple'/>
54+
{%snippet observable-array-push-multiple%}
5555

5656
### Handle "change" event to know more info about the change after calling push() method with multiple elements.
57-
<snippet id='observable-array-push-multiple-info'/>
57+
{%snippet observable-array-push-multiple-info%}
5858

5959
### Use push() method to add multiple elements from source array to the ObservableArray.
60-
<snippet id='observable-array-push-source'/>
60+
{%snippet observable-array-push-source%}
6161

6262
### Handle "change" event to know more info about the change after calling push() method with multiple elements from source array.
63-
<snippet id='observable-array-push-source-info'/>
63+
{%snippet observable-array-push-source-info%}
6464

6565
### Use reverse() method to reverse the elements order of the ObservableArray.
66-
<snippet id='observable-array-reverse'/>
66+
{%snippet observable-array-reverse%}
6767

6868
### Use shift() method to remove the first element of the array.
69-
<snippet id='observable-array-shift'/>
69+
{%snippet observable-array-shift%}
7070

7171
### Handle "change" event to know more info about the change after calling shift() method.
72-
<snippet id='observable-array-shift-change'/>
72+
{%snippet observable-array-shift-change%}
7373

7474
### Use slice() method to return array with all ObservableArray elements.
75-
<snippet id='observable-array-slice'/>
75+
{%snippet observable-array-slice%}
7676

7777
### Use slice(star, end) method to return section of the array.
78-
<snippet id='observable-array-slice-args'/>
78+
{%snippet observable-array-slice-args%}
7979

8080
### Use sort() method to sort the array.
81-
<snippet id='observable-array-sort'/>
81+
{%snippet observable-array-sort%}
8282

8383
### Use sort(compareFunction) method to sort the array with your own comparing logic.
84-
<snippet id='observable-array-sort-comparer'/>
84+
{%snippet observable-array-sort-comparer%}
8585

8686
### Use splice(start, deleteCount) method to delete elements in the array.
87-
<snippet id='observable-array-splice'/>
87+
{%snippet observable-array-splice%}
8888

8989
### Handle "change" event to know more info about the change after calling splice(start, deleteCount) method.
90-
<snippet id='observable-array-splice-change'/>
90+
{%snippet observable-array-splice-change%}
9191

9292
### Use splice(start, deleteCount, ...arguments) method to remove and insert elements in the array.
93-
<snippet id='observable-array-splice-args'/>
93+
{%snippet observable-array-splice-args%}
9494

9595
### Handle "change" event to know more info about the change after calling splice(start, deleteCount, ...arguments) method.
96-
<snippet id='observable-array-splice-args-change'/>
96+
{%snippet observable-array-splice-args-change%}
9797

9898
### Use unshift(item1, item2... itemN) method to insert elements from the start of the array.
99-
<snippet id='observable-array-unshift'/>
99+
{%snippet observable-array-unshift%}
100100

101101
### Handle "change" event to know more info about the change after calling unshift(item1, item2... itemN) method.
102-
<snippet id='observable-array-unshift-change'/>
102+
{%snippet observable-array-unshift-change%}
103103

104104
### Use indexOf(item) method to get the index of the desired item in the array.
105-
<snippet id='observable-array-indexof'/>
105+
{%snippet observable-array-indexof%}
106106

107107
### Use indexOf(item, fromIndex) method to get the index of the desired item in the array starting from specified index.
108-
<snippet id='observable-array-indexof-args'/>
108+
{%snippet observable-array-indexof-args%}
109109

110110
### Use lastIndexOf(item) method to get the last index of the desired item in the array.
111-
<snippet id='observable-array-lastindexof'/>
111+
{%snippet observable-array-lastindexof%}
112112

113113
### Use lastIndexOf(item, fromIndex) method to get the last index of the desired item in the array starting from specified index.
114-
<snippet id='observable-array-lastindexof-args'/>
114+
{%snippet observable-array-lastindexof-args%}

tests/app/data/observable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ previous_url: /ApiReference/data/observable/HOW-TO
77
---
88
# Observable
99
Using Observable objects requires the "data/observable" module.
10-
<snippet id='observable-require'/>
10+
{%snippet observable-require%}
1111

1212
### Creating an Observable
13-
<snippet id='observable-creating'/>
13+
{%snippet observable-creating%}
1414

1515
### Responding to property changes
16-
<snippet id='observable-property-change'/>
16+
{%snippet observable-property-change%}

tests/app/data/virtual-array.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ description: "Examples for using virtual-array"
66
previous_url: /ApiReference/data/virtual-array/HOW-TO
77
---
88
# Virtual Array module
9-
<snippet id='virtual-array-require'/>
9+
{%snippet virtual-array-require%}
1010

1111
### Handle "itemsLoading" event to load items on demand using load() method.
1212
Use "length" property set via VirtualArray constructor to specify total number of items,
1313
"loadSize" to specify number of items to be requested in a single request,
1414
"itemsLoading" event to handle items request and "load()" method to copy items into the array.
1515
All already loaded items are cached in -memory and when "getItem()" method is called
1616
the array will raise "itemsLoading" event for still not loaded items.
17-
<snippet id='virtual-array-itemsloading'/>
17+
{%snippet virtual-array-itemsloading%}
1818

1919
### Handle "change" event when you load items using load() method.
20-
<snippet id='virtual-array-change'/>
20+
{%snippet virtual-array-change%}
2121

2222
### Handle "change" event when you increase "length" property.
23-
<snippet id='virtual-array-lenght'/>
23+
{%snippet virtual-array-lenght%}
2424

tests/app/fetch.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ description: "Examples for using fetch"
66
previous_url: /ApiReference/fetch/HOW-TO
77
---
88
### Get Response from URL
9-
<snippet id='fetch-response'/>
9+
{%snippet fetch-response%}
1010

1111
### Get string from URL
12-
<snippet id='fetch-string'/>
12+
{%snippet fetch-string%}
1313

1414
### Get JSON from URL
15-
<snippet id='fetch-json'/>
15+
{%snippet fetch-json%}
1616

1717
### Get FormData from URL
18-
<snippet id='fetch-formdata'/>
18+
{%snippet fetch-formdata%}
1919

2020
### Get Response status
21-
<snippet id='fetch-status-response'/>
21+
{%snippet fetch-status-response%}
2222

2323
### Get response headers
24-
<snippet id='fetch-headers-response'/>
24+
{%snippet fetch-headers-response%}
2525

2626
### Post JSON
27-
<snippet id='fetch-post-json'/>
27+
{%snippet fetch-post-json%}

0 commit comments

Comments
 (0)