Skip to content

Commit 3edaad4

Browse files
authored
Merge pull request halfnelson#76 from luizbills/docs
More docs improvements
2 parents abbed63 + 27ce086 commit 3edaad4

File tree

8 files changed

+120
-88
lines changed

8 files changed

+120
-88
lines changed

docs_src/content/docs/00-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Introduction
44

55
#### What is NativeScript?
66

7-
[NativeScript](https://www.nativescript.org/) is an open-source framework to develop apps on the Apple iOS and Android platforms. It is open source and can be found on [github](https://github.com/nativescript/nativescript)
7+
[NativeScript](https://www.nativescript.org/) is an open-source framework to develop apps on the Apple iOS and Android platforms. It is open source and can be found on [github](https://github.com/nativescript/nativescript).
88

99
#### What is Svelte?
1010

docs_src/content/docs/01-getting-started.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Svelte-Native works on top of NativeScript. To install NativeScript:
1212
$ npm install -g nativescript
1313
```
1414

15-
Check it worked by running `tns`
15+
Check it worked by running `tns`:
1616

1717
![Success](/media/tns-success.png)
1818

@@ -42,7 +42,7 @@ $ cd myapp
4242
$ tns preview
4343
```
4444

45-
You will need to scan the ascii art QR code using the "Playground" app you installed previously.
45+
You will need to scan the QR Code using the "Playground" app you installed previously.
4646

4747
<img src="/media/quick-start-screenshot.png" width=200 alt="Running App" >
4848

@@ -69,4 +69,3 @@ or
6969
```bash
7070
$ tns run ios
7171
```
72-

docs_src/content/docs/10-routing.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ navigate({
6363
```
6464

6565
The value for the `frame` option can be one of the following:
66+
6667
* the `id` of the `<frame>` component (for example: `<frame id="main-frame">`)
6768
* a reference to the `<frame>` (for example: `<frame bind:this="{mainFrame}">`)
6869
* a NativeScript `Frame` instance.
@@ -110,10 +111,10 @@ To show a page or component modally use the `showModal` function. Specify the pa
110111
```html
111112
<!--{ filename: 'App.svelte'} -->
112113
<page>
113-
<actionBar title="Master" />
114-
<stackLayout>
115-
<button text="Open Modal" on:tap="{launchModal}" />
116-
</stackLayout>
114+
<actionBar title="Master" />
115+
<stackLayout>
116+
<button text="Open Modal" on:tap="{launchModal}" />
117+
</stackLayout>
117118
</page>
118119

119120
<script>
@@ -129,7 +130,7 @@ To show a page or component modally use the `showModal` function. Specify the pa
129130
<!--{filename: "DetailPage.svelte" }-->
130131
<frame id="detail-page-frame">
131132
<page>
132-
133+
<label text="Detail Page" />
133134
</page>
134135
</frame>
135136
```
@@ -153,6 +154,7 @@ The `closeModal` function closes the current modal view and optionally returns a
153154
<label text="{modalResult}" />
154155
</stackLayout>
155156
</page>
157+
156158
<script>
157159
import DetailPage from './DetailPage.svelte'
158160
import { showModal } from 'svelte-native'
@@ -172,6 +174,7 @@ The `closeModal` function closes the current modal view and optionally returns a
172174
<button text="Close me" on:tap="{ () => closeModal('hi from modal') }" />
173175
</page>
174176
</frame>
177+
175178
<script>
176179
import { closeModal } from 'svelte-native'
177180
</script>

docs_src/content/docs/30-layouts.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The following example creates a simple grid. For more information about creating
2626
<label text="120,120" left="120" top="120" width="100" height="100" backgroundColor="#4383b8"/>
2727
</absoluteLayout>
2828
```
29+
2930
<img width=320 src="/media/docs/layouts/absolute_layout_grid.svg" />
3031

3132
#### Overlapping elements
@@ -38,6 +39,7 @@ The following example creates a group of overlapping items.
3839
<label text="30,40" left="30" top="40" width="100" height="100" backgroundColor="#4383b8"/>
3940
</absoluteLayout>
4041
```
42+
4143
<img width=320 src="/media/docs/layouts/absolute_layout_overlap.svg" />
4244

4345
#### Additional children props
@@ -202,6 +204,7 @@ The following example creates four items with enabled line wrapping. When the ro
202204
<label text="fourth" width="30%" backgroundColor="#286290"/>
203205
</flexboxLayout>
204206
```
207+
205208
<img width=320 src="/media/docs/layouts/flexbox_layout_wrap.svg" />
206209

207210
#### Column flex layout with reverse order and items with a different `alignSelf`
@@ -289,6 +292,7 @@ The following example creates a grid with responsive design, where space is alot
289292
<Label text="1,1" row="1" col="1" backgroundColor="#4383b8"/>
290293
</gridLayout>
291294
```
295+
292296
<img width=320 src="/media/docs/layouts/grid_layout_star_sizing.svg" />
293297

294298
#### Grid layout with fixed and auto sizing
@@ -303,6 +307,7 @@ The following example create a grid with one auto-sized column and one column wi
303307
<label text="1,1" row="1" col="1" backgroundColor="#4383b8"/>
304308
</gridLayout>
305309
```
310+
306311
<img width=320 src="/media/docs/layouts/grid_layout_fixed_auto.svg" />
307312

308313
#### Grid layout with mixed sizing and merged cells
@@ -320,6 +325,7 @@ The following example creates a complex grid with responsive design, mixed width
320325
<label text="2,2" row="2" col="2" backgroundColor="#4383b8"/>
321326
</gridLayout>
322327
```
328+
323329
<img width=320 src="/media/docs/layouts/grid_layout_complex.svg" />
324330

325331
#### Props
@@ -371,6 +377,7 @@ The following example creates a horizontal stack of 3 equally-sized elements. It
371377
<label text="third" width="70" backgroundColor="#1c486b"/>
372378
</stackLayout>
373379
```
380+
374381
<img width=320 src="/media/docs/layouts/stack_layout_horizontal.svg" />
375382

376383
#### Stack layout with horizontally aligned children

docs_src/content/docs/35-action-bars.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: ActionBars
66

77
<div class="nsref"><a title="NativeScript Documentation" href="https://docs.nativescript.org/api-reference/classes/_ui_action_bar_.actionbar">Class Docs</a></div>
88

9-
`<actionBar>` is a UI component that provides a toolbar at the top of the activity window.
9+
`<actionBar>` is a UI component that provides a toolbar at the top of the activity window.
1010

1111
This component is the NativeScript abstraction for the Android [app bar](https://developer.android.com/training/appbar/) and the iOS [navigation bar](https://developer.apple.com/design/human-interface-guidelines/ios/bars/navigation-bars/).
1212

@@ -134,4 +134,4 @@ Extends [`<actionItem>`](docs#actionitem).
134134

135135
| Android | iOS |
136136
|---------|-----|
137-
| [`android.widget.Toolbar`](https://developer.android.com/reference/android/widget/Toolbar.html) | [`UINavigationItem`](https://developer.apple.com/documentation/uikit/uinavigationitem)
137+
| [`android.widget.Toolbar`](https://developer.android.com/reference/android/widget/Toolbar.html) | [`UINavigationItem`](https://developer.apple.com/documentation/uikit/uinavigationitem)

docs_src/content/docs/37-tab-navigation.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ The TabStrip component is only valid within [`BottomNavigation`](docs#bottom-nav
1111
```html
1212
<tabStrip>
1313
<tabStripItem>
14-
<label text="Home"></Label>
15-
<image src="font://&#xf015;" class="fas t-36"></image>
14+
<label text="Home" />
15+
<image src="font://&#xf015;" class="fas t-36" />
1616
</tabStripItem>
1717
<tabStripItem>
18-
<label text="Account"></Label>
19-
<image src="font://&#xf007;" class="fas t-36"></image>
18+
<label text="Account" />
19+
<image src="font://&#xf007;" class="fas t-36" />
2020
</tabStripItem>
2121
</tabStrip>
2222
```
@@ -43,8 +43,8 @@ Tab strip items define the display of a tab selector within a [`TabStrip`](docs#
4343
```html
4444
<tabStrip>
4545
<tabStripItem>
46-
<label text="Home"></Label>
47-
<image src="font://&#xf015;" class="fas t-36"></image>
46+
<label text="Home" />
47+
<image src="font://&#xf015;" class="fas t-36" />
4848
</tabStripItem>
4949
...
5050
</tabStrip>
@@ -74,7 +74,7 @@ A `TabContentItem` contains the view to be displayed when the corresponding TabS
7474
```html
7575
<tabContentitem>
7676
<stackLayout>
77-
<label>Hello From This Tab</label>
77+
<label text="Hello From This Tab" />
7878
</stackLayout>
7979
</tabContentItem>
8080
```
@@ -101,33 +101,33 @@ It can contain a single [`TabStrip`](docs#tabstrip) child (which contains multip
101101
<!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
102102
<tabStrip>
103103
<tabStripItem>
104-
<label text="Home"></label>
105-
<image src="font://&#xf015;" class="fas t-36"></image>
104+
<label text="Home" />
105+
<image src="font://&#xf015;" class="fas t-36" />
106106
</tabStripItem>
107107
<tabStripItem class="special">
108-
<label text="Account"></label>
109-
<image src="font://&#xf007;" class="fas t-36"></image>
108+
<label text="Account" />
109+
<image src="font://&#xf007;" class="fas t-36" />
110110
</tabStripItem>
111111
<tabStripItem class="special">
112-
<label text="Search"></label>
113-
<image src="font://&#xf00e;" class="fas t-36"></image>
112+
<label text="Search" />
113+
<image src="font://&#xf00e;" class="fas t-36" />
114114
</tabStripItem>
115115
</tabStrip>
116116

117117
<!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
118118
<tabContentItem>
119119
<gridLayout>
120-
<label text="Home Page" class="h2 text-center"></label>
120+
<label text="Home Page" class="h2 text-center" />
121121
</gridLayout>
122122
</tabContentItem>
123123
<tabContentItem>
124124
<gridLayout>
125-
<label text="Account Page" class="h2 text-center"></label>
125+
<label text="Account Page" class="h2 text-center" />
126126
</gridLayout>
127127
</tabContentItem>
128128
<tabContentItem>
129129
<gridLayout>
130-
<label text="Search Page" class="h2 text-center"></label>
130+
<label text="Search Page" class="h2 text-center" />
131131
</gridLayout>
132132
</tabContentItem>
133133

@@ -171,33 +171,33 @@ Unlike the [`Bottom Navigation`](docs#bottom-navigation) component, The tabs com
171171
<!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
172172
<tabStrip>
173173
<tabStripItem>
174-
<label text="Home"></label>
175-
<image src="font://&#xf015;" class="fas t-36"></image>
174+
<label text="Home" />
175+
<image src="font://&#xf015;" class="fas t-36" />
176176
</tabStripItem>
177177
<tabStripItem class="special">
178-
<label text="Account"></label>
179-
<image src="font://&#xf007;" class="fas t-36"></image>
178+
<label text="Account" />
179+
<image src="font://&#xf007;" class="fas t-36" />
180180
</tabStripItem>
181181
<tabStripItem class="special">
182-
<label text="Search"></label>
183-
<image src="font://&#xf00e;" class="fas t-36"></image>
182+
<label text="Search" />
183+
<image src="font://&#xf00e;" class="fas t-36" />
184184
</tabStripItem>
185185
</tabStrip>
186186

187187
<!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
188188
<tabContentItem>
189189
<gridLayout>
190-
<label text="Home Page" class="h2 text-center"></label>
190+
<label text="Home Page" class="h2 text-center" />
191191
</gridLayout>
192192
</tabContentItem>
193193
<tabContentItem>
194194
<gridLayout>
195-
<label text="Account Page" class="h2 text-center"></label>
195+
<label text="Account Page" class="h2 text-center" />
196196
</gridLayout>
197197
</tabContentItem>
198198
<tabContentItem>
199199
<gridLayout>
200-
<label text="Search Page" class="h2 text-center"></label>
200+
<label text="Search Page" class="h2 text-center" />
201201
</gridLayout>
202202
</tabContentItem>
203203

0 commit comments

Comments
 (0)