diff --git a/apps/tests/layouts/absolute-layout-tests.ts b/apps/tests/layouts/absolute-layout-tests.ts
index 8fe0ca5f5..df28a37a2 100644
--- a/apps/tests/layouts/absolute-layout-tests.ts
+++ b/apps/tests/layouts/absolute-layout-tests.ts
@@ -5,23 +5,9 @@ import colorModule = require("color");
import layoutHelper = require("./layout-helper");
import commonTests = require("./common-layout-tests");
-//
-// # AbsoluteLayout
-// Using a AbsoluteLayout requires the AbsoluteLayout module.
-// ``` JavaScript
+// >> absolute-layout-require
import absoluteLayoutModule = require("ui/layouts/absolute-layout");
-// ```
-//
-
-// ### Declaring a AbsoluteLayout.
-//``` XML
-//
-//
-//
-//
-//
-//```
-//
+// << absolute-layout-require
export class AbsoluteLayoutTest extends testModule.UITest {
@@ -31,9 +17,7 @@ export class AbsoluteLayoutTest extends testModule.UITest
- // ## Creating and populating a AbsoluteLayout with children
- // ``` JavaScript
+ // >> absolute-layout-populating
var absoluteLayout = new absoluteLayoutModule.AbsoluteLayout();
absoluteLayout.width = 230;
absoluteLayout.height = 230;
@@ -48,8 +32,7 @@ export class AbsoluteLayoutTest extends testModule.UITest
+ // << absolute-layout-populating
}
public testAll() {
diff --git a/apps/tests/layouts/absolute-layout.md b/apps/tests/layouts/absolute-layout.md
new file mode 100644
index 000000000..ca920e27e
--- /dev/null
+++ b/apps/tests/layouts/absolute-layout.md
@@ -0,0 +1,19 @@
+---
+nav-title: "absolute-layout How-To"
+title: "How-To"
+description: "Examples for using absolute-layout"
+---
+# AbsoluteLayout
+Using a AbsoluteLayout requires the AbsoluteLayout module.
+
+
+``` XML
+
+
+
+
+
+```
+
+## Creating and populating a AbsoluteLayout with children
+
diff --git a/apps/tests/layouts/dock-layout-tests.ts b/apps/tests/layouts/dock-layout-tests.ts
index d21bc963c..06c440475 100644
--- a/apps/tests/layouts/dock-layout-tests.ts
+++ b/apps/tests/layouts/dock-layout-tests.ts
@@ -6,32 +6,13 @@ import testModule = require("../ui-test");
import layoutHelper = require("./layout-helper");
import commonTests = require("./common-layout-tests");
-//
-// # DockLayout
-// Using a DockLayout requires the DockLayout module.
-// ``` JavaScript
+// >>
import dockModule = require("ui/layouts/dock-layout");
-// ```
+// <<
-// ### Declaring a DockLayout.
-//``` XML
-//
-//
-//
-//
-//```
-//
-
-// Other frequently used modules when working with a DockLayout include:
-// ``` JavaScript
+// >> dock-layout-others
import enums = require("ui/enums");
-// ```
-//
+// << dock-layout-others
export class DockLayoutTest extends testModule.UITest {
@@ -164,30 +145,24 @@ export class DockLayoutTest extends testModule.UITest {
}
public test_codesnippets() {
- //
- // ## Create DockLayout
- // ``` JavaScript
+ // >> dock-layout-create
var dockLayout = new dockModule.DockLayout();
- // ```
-
- // ## Add child view to layout
- // ``` JavaScript
+ // << dock-layout-create
+
+ // >> dock-layout-addchild
var btn = new button.Button();
dockLayout.addChild(btn);
- // ```
+ // << dock-layout-addchild
- // ## Remove child view from layout
- // ``` JavaScript
+ // >> dock-layout-removechild
dockLayout.removeChild(btn);
- // ```
+ // << dock-layout-removechild
- // ## Setting the dock property
- // ``` JavaScript
+ // >> dock-layout-setdocl
var btnDockedToRight = new button.Button();
dockModule.DockLayout.setDock(btnDockedToRight, enums.Dock.right);
dockLayout.addChild(btnDockedToRight);
- // ```
- //
+ // << dock-layout-setdocl
}
public test_percent_support() {
diff --git a/apps/tests/layouts/dock-layout.md b/apps/tests/layouts/dock-layout.md
new file mode 100644
index 000000000..ac332b1a0
--- /dev/null
+++ b/apps/tests/layouts/dock-layout.md
@@ -0,0 +1,37 @@
+
+---
+nav-title: "dock-layout How-To"
+title: "How-To"
+description: "Examples for using dock-layout"
+---
+# DockLayout
+Using a DockLayout requires the DockLayout module.
+
+
+### Declaring a DockLayout.
+``` XML
+
+
+
+
+
+
+
+
+
+```
+
+Other frequently used modules when working with a DockLayout include:
+
+
+## Create DockLayout
+
+
+## Add child view to layout
+
+
+## Remove child view from layout
+
+
+## Setting the dock property
+
diff --git a/apps/tests/layouts/grid-layout-tests.ts b/apps/tests/layouts/grid-layout-tests.ts
index 0e6b4adc9..f3ce31fed 100644
--- a/apps/tests/layouts/grid-layout-tests.ts
+++ b/apps/tests/layouts/grid-layout-tests.ts
@@ -561,27 +561,12 @@ export class GridLayoutTest extends testModule.UITest {
}
public test_codesnippets = function () {
- //
- // ## GridLayout sample
- // ### Creating Grid Layout via code.
- // ``` JavaScript
+ // >> grid-layout-require
//var layout = require("ui/layouts/grid-layout");
var gridLayout = new GridLayout();
- // ```
+ // << grid-layout-require
- // ### Create grid layout with an xml declaration
- // ``` XML
- //
- //
- //
- //
- //// by default column and row are set to 0
- //
- //
- // ```
-
- // ### Add views to grid layout
- // ``` JavaScript
+ // >> grid-layout-addviews
var btn1 = new Button();
var btn2 = new Button();
var btn3 = new Button();
@@ -590,27 +575,23 @@ export class GridLayoutTest extends testModule.UITest {
gridLayout.addChild(btn2);
gridLayout.addChild(btn3);
gridLayout.addChild(btn4);
- // ```
-
- // ### Set column property on views - btn1 in first column, btn2 is second and btn3 in third
- // ``` JavaScript
+ // << grid-layout-addviews
+
+ // >> grid-layout-setcolumn
GridLayout.setColumn(btn1, 0);
GridLayout.setColumn(btn2, 1);
GridLayout.setColumn(btn3, 2);
- // ```
-
- // ### Set row property on btn4.
- // ``` JavaScript
+ // << grid-layout-setcolumn
+
+ // >> grid-layout-setrow
GridLayout.setRow(btn4, 1);
- // ```
+ // << grid-layout-setrow
- // ### Set columnSpan property on btn4 to stretch into all columns
- // ``` JavaScript
+ // >> grid-layout-columnspan
GridLayout.setColumnSpan(btn4, 3);
- // ```
+ // << grid-layout-columnspan
- // ### Create ItemSpec for columns and rows 3 columns - 80px, *, auto size and 2 rows - 100px and auto size
- // ``` JavaScript
+ // >> grid-layout-itemspec
//// ItemSpec modes of the column refers to its width.
//// Absolute size of the column
var firstColumn = new ItemSpec(80, GridUnitType.pixel);
@@ -622,17 +603,15 @@ export class GridLayoutTest extends testModule.UITest {
//// Star and Auto modes for rows behave like corresponding setting for columns but refer to row height.
var firstRow = new ItemSpec(1, GridUnitType.auto);
var secondRow = new ItemSpec(1, GridUnitType.star);
- // ```
-
- // ### Add columns and rows to GridLayout
- // ``` JavaScript
+ // << grid-layout-itemspec
+
+ // >> grid-layout-add-rowscols
gridLayout.addColumn(firstColumn);
gridLayout.addColumn(secondColumn);
gridLayout.addColumn(thirdColumn);
gridLayout.addRow(firstRow);
gridLayout.addRow(secondRow);
- // ```
- //
+ // << grid-layout-add-rowscols
}
public test_percent_support() {
diff --git a/apps/tests/layouts/grid-layout.md b/apps/tests/layouts/grid-layout.md
new file mode 100644
index 000000000..84cf24f0e
--- /dev/null
+++ b/apps/tests/layouts/grid-layout.md
@@ -0,0 +1,37 @@
+---
+nav-title: "grid-layout How-To"
+title: "How-To"
+description: "Examples for using grid-layout"
+---
+## GridLayout sample
+### Creating Grid Layout via code.
+
+
+### Create grid layout with an xml declaration
+``` XML
+
+
+
+
+ // by default column and row are set to 0
+
+
+```
+
+### Add views to grid layout
+
+
+### Set column property on views - btn1 in first column, btn2 is second and btn3 in third
+
+
+### Set row property on btn4.
+
+
+### Set columnSpan property on btn4 to stretch into all columns
+
+
+### Create ItemSpec for columns and rows 3 columns - 80px, *, auto size and 2 rows - 100px and auto size
+
+
+### Add columns and rows to GridLayout
+
diff --git a/apps/tests/layouts/stack-layout-tests.ts b/apps/tests/layouts/stack-layout-tests.ts
index 0fb48a27e..4c0c5a472 100644
--- a/apps/tests/layouts/stack-layout-tests.ts
+++ b/apps/tests/layouts/stack-layout-tests.ts
@@ -161,42 +161,28 @@ export class StackLayoutTest extends testModule.UITest {
}
public test_codesnippets() {
- //
- // ### import StackLayout and Button classes
+
+ // >> stack-layout-new
// var StackLayout = require("ui/layouts/stack-layout").StackLayout;
+ // >> (hide)
// var Button = require("ui/button").Button;
- // ### Create StackLayout
- // ``` JavaScript
+ // << (hide)
var stackLayout = new StackLayout();
- // ```
+ // << stack-layout-new
- // ### Declaring a StackLayout.
- //``` XML
- //
- //
- //
- //
- //
- //```
- //
-
- // ### Add child view to layout
- // ``` JavaScript
+ // >> stack-layout-addchild
var btn = new Button();
stackLayout.addChild(btn);
- // ```
+ // << stack-layout-addchild
- // ### Remove child view from layout
- // ``` JavaScript
+ // >> stack-layout-remove
stackLayout.removeChild(btn);
- // ```
+ // << stack-layout-remove
- // ### Change layout orientation to Horizontal
- // ``` JavaScript
+ // >> stack-layout-horizontal
stackLayout.orientation = enums.Orientation.horizontal;
- // ```
+ // << stack-layout-horizontal
- //
}
private setup_percent(): layoutHelper.MyButton {
diff --git a/apps/tests/layouts/stack-layout.md b/apps/tests/layouts/stack-layout.md
new file mode 100644
index 000000000..d0750a5e1
--- /dev/null
+++ b/apps/tests/layouts/stack-layout.md
@@ -0,0 +1,29 @@
+---
+nav-title: "stack-layout How-To"
+title: "How-To"
+description: "Examples for using stack-layout"
+---
+### import StackLayout and Button classes
+var StackLayout = require("ui/layouts/stack-layout").StackLayout;
+var Button = require("ui/button").Button;
+### Create StackLayout
+
+
+### Declaring a StackLayout.
+``` XML
+
+
+
+
+
+```
+
+### Add child view to layout
+
+
+### Remove child view from layout
+
+
+### Change layout orientation to Horizontal
+
+
diff --git a/apps/tests/layouts/wrap-layout-tests.ts b/apps/tests/layouts/wrap-layout-tests.ts
index c185eb95d..9c6ec4cbf 100644
--- a/apps/tests/layouts/wrap-layout-tests.ts
+++ b/apps/tests/layouts/wrap-layout-tests.ts
@@ -4,41 +4,20 @@ import layoutHelper = require("./layout-helper");
import testModule = require("../ui-test");
import commonTests = require("./common-layout-tests");
-//
-// # WrapLayout
-// Using a WrapLayout requires the WrapLayout module.
-// ``` JavaScript
+// >> wrap-layout-require
import wrapLayoutModule = require("ui/layouts/wrap-layout");
-// ```
+// << wrap-layout-require
-// Other frequently used modules when working with a WrapLayout include:
-// ``` JavaScript
+// >> wrap-layout-others
import enums = require("ui/enums");
-// ```
-//
+// << wrap-layout-others
export class WrapLayoutTest extends testModule.UITest {
public create(): wrapLayoutModule.WrapLayout {
- //
- // ## Creating a WrapLayout
- // ``` JavaScript
+ // >> wrap-layout-new
var wrapLayout = new wrapLayoutModule.WrapLayout();
- // ```
- //
-
- // ### Declaring a WrapLayout.
- //``` XML
- //
- //
- //
- //
- //
- //
- //
- //
- //```
- //
+ // << wrap-layout-new
wrapLayout.width = layoutHelper.dp(200);
wrapLayout.height = layoutHelper.dp(200);
@@ -124,12 +103,9 @@ export class WrapLayoutTest extends testModule.UITest
- // ## Setting the orientation of a wrap-layout.
- // ``` JavaScript
+ // >> wrap-layout-orientation
wrapLayout.orientation = enums.Orientation.vertical;
- // ```
- //
+ // << wrap-layout-orientation
this.waitUntilTestElementLayoutIsValid();
let actualValue = this.testView.getChildAt(0)._getCurrentLayoutBounds();
diff --git a/apps/tests/layouts/wrap-layout.md b/apps/tests/layouts/wrap-layout.md
new file mode 100644
index 000000000..e08668be9
--- /dev/null
+++ b/apps/tests/layouts/wrap-layout.md
@@ -0,0 +1,29 @@
+---
+nav-title: "WrapLayout How-To"
+title: "How-To"
+description: "Examples for using WrapLayout"
+---
+# WrapLayout
+Using a WrapLayout requires the WrapLayout module.
+
+
+Other frequently used modules when working with a WrapLayout include:
+
+
+## Creating a WrapLayout
+
+
+### Declaring a WrapLayout.
+``` XML
+
+
+
+
+
+
+
+
+```
+
+## Setting the orientation of a wrap-layout.
+