cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject [59/75] docs commit: Moved tools to tools/ and added some tools for new doc pipeline.
Date Thu, 23 Jul 2015 22:21:03 GMT
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/table_of_contents_spec.js
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/table_of_contents_spec.js b/tools/spec/cordova/table_of_contents_spec.js
new file mode 100644
index 0000000..f537b83
--- /dev/null
+++ b/tools/spec/cordova/table_of_contents_spec.js
@@ -0,0 +1,124 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+/*jslint node: true */
+/*global describe, it, beforeEach, afterEach, after, before */
+(function () {
+    'use strict';
+    var assert = require("assert"),
+        path = require('path'),
+        fs = require('fs'),
+        esrever = require('esrever'),
+        cheerio = require('cheerio'),
+        TableOfContents = require("../../lib/cordova/post/tableofcontents"),
+        SpecHelpers = require("../spec_helpers");
+
+    describe('TableOfContents', function () {
+        var sut,
+            files;
+        
+        beforeEach(function (done) {
+            var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
+            sut = new TableOfContents();
+            files = {
+                'normal': path.join(tmp_directory, 'example.html'),
+                'no_source': path.join(tmp_directory, 'example_no_source.html'),
+                'no_target': path.join(tmp_directory, 'example_no_target.html')
+            };
+            done();
+        });
+        
+        afterEach(function (done) {
+            SpecHelpers.remove_tmp_directory();
+            done();
+        });
+
+        it('should find the table of content values', function () {
+            var dom = cheerio.load(fs.readFileSync(files.normal)),
+                result = sut.run(files.normal, dom);
+            assert.strictEqual(32, result.length);
+        });
+
+        it('should find all <h1> elements', function () {
+            var dom = cheerio.load(fs.readFileSync(files.normal)),
+                result = sut.run(files.normal, dom),
+                headers = [];
+            
+            result.forEach(function (header, index) {
+                var match = header.toString().match(/-/);
+                if (match === null) {
+                    headers.push(header);
+                }
+            });
+            assert.strictEqual(8, headers.length);
+        });
+
+        it('should find all <h2> elements', function () {
+            var dom = cheerio.load(fs.readFileSync(files.normal)),
+                result = sut.run(files.normal, dom),
+                headers = [];
+            
+            result.forEach(function (header, index) {
+                var match = header.toString().match(/-/);
+                if (match !== null) {
+                    // if nil != (header =~ /-/) and (header =~ /-/) > 0 }
+                    headers.push(header);
+                }
+            });
+            assert.strictEqual(24, headers.length);
+        });
+
+        it('should ignore whitespace in the target name', function () {
+            var dom = cheerio.load(fs.readFileSync(files.normal)),
+                result = sut.run(files.normal, dom),
+                names = [],
+                doc = dom;
+            
+            //result = result.reverse();
+            //console.log(result[0]);
+            assert.ok(doc("#content > h1, #content > h2").length > 0, "Should found H1 and H2");
+            doc("#content > h1, #content > h2").each(function (index, element) {
+                var child = cheerio(element).children().first(),
+                    resultElement = result.shift(),
+                    resultElementHtml = resultElement.toString(),
+                    valueMatch = resultElementHtml.match(/value=\"([^\"]*)\"/);
+                assert.ok(valueMatch !== null, "Could not find value in the resulting HTML '" + resultElementHtml + "' which should match to '" + child.attr('name') + "'");
+                assert.strictEqual(valueMatch[1], child.attr('name'));
+            });
+        });
+
+        it('should create a HTML select element', function () {
+            var dom = cheerio.load(fs.readFileSync(files.normal)),
+                result = sut.run(files.normal, dom);
+            
+            assert.ok(dom('#subheader > small > select').length > 0);
+        });
+
+        it('should skip files with no source title', function () {
+            var dom = cheerio.load(fs.readFileSync(files.no_source)),
+                result = sut.run(files.no_source, dom);
+            assert.strictEqual(null, result);
+        });
+
+        it('should skip files with no target title', function () {
+            var dom = cheerio.load(fs.readFileSync(files.no_target)),
+                result = sut.run(files.no_target, dom);
+            assert.ok(null === result, "Find something when should not");
+        });
+    });
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/table_of_contents_spec/example.html
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/table_of_contents_spec/example.html b/tools/spec/cordova/table_of_contents_spec/example.html
new file mode 100644
index 0000000..94db5fa
--- /dev/null
+++ b/tools/spec/cordova/table_of_contents_spec/example.html
@@ -0,0 +1,515 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
+<meta name="generator" content="joDoc">
+<link rel="stylesheet" type="text/css" href="index.css">
+<title>PhoneGap API Documentation</title>
+</head>
+<body>
+		
+		<div id="header">
+			<h1>Phone<strong>Gap</strong> Documentation</h1>
+			<small></small>
+		</div>
+		<div id="subheader">
+			<h1>Accelerometer</h1>
+			<small>[ SELECT BOX PLACEHOLDER ]</small>
+		</div>
+		
+		<div id="sidebar">
+			<div class="vertical_divider"></div>
+			<h1>API Reference</h1>
+			<ul>
+<li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
+				<li><a href="phonegap_camera_camera.md.html">Camera</a></li>
+				<li><a href="phonegap_device_device.md.html">Device</a></li>
+				<li><a href="phonegap_events_events.md.html">Events</a></li>
+				<li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
+				<li><a href="phonegap_notification_notification.md.html">Notification</a></li>
+			</ul>
+</div>
+		
+		<div id="content">
+			<h1><a name="Accelerometer">Accelerometer</a></h1>
+
+<blockquote>
+  <p>Captures device motion in the x, y, and z direction.</p>
+</blockquote>
+
+<h2>Methods</h2>
+
+<ul>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
+</ul>
+<h2>Arguments</h2>
+
+<ul>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
+</ul>
+<h2>Objects (Read-Only)</h2>
+
+<ul>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
+</ul>
+<hr>
+<h1><a name="accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></h1>
+
+<p>Get the current acceleration along the x, y, and z axis.</p>
+
+<pre><code>navigator.accelerometer.getCurrentAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>, <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>);
+</code></pre>
+
+<h2>Description</h2>
+
+<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
+
+<p>The acceleration is returned using the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function.</p>
+
+<h2>Supported Platforms</h2>
+
+<ul>
+<li>iPhone</li>
+</ul>
+<h2>Quick Example</h2>
+
+<pre><code>function onSuccess(acceleration) {
+    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+};
+
+function onError() {
+    alert('onError!');
+};
+
+navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+</code></pre>
+
+<h2>Full Example</h2>
+
+<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd"&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // Wait for PhoneGap to load
+    //
+    function onLoad() {
+        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+    }
+
+    // PhoneGap is ready
+    //
+    function onDeviceReady() {
+        navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+    }
+
+    // onSuccess: Get a snapshot of the current acceleration
+    //
+    function onSuccess(acceleration) {
+        alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
+    }
+
+    // onError: Failed to get the acceleration
+    //
+    function onError() {
+        alert('onError!');
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload="onLoad()"&gt;
+    &lt;h1&gt;Example&lt;/h1&gt;
+    &lt;p&gt;getCurrentAcceleration&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>iPhone Quirks</h2>
+
+<ul>
+<li>iPhone doesn't have the concept of getting the current acceleration at any given point.</li>
+<li>You must watch the acceleration and capture the data at given time intervals.</li>
+<li>Thus, the <code>getCurrentAcceleration</code> function will give you the last value reported from a phoneGap <code>watchAccelerometer</code> call.</li>
+</ul>
+<hr>
+<h1><a name="accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></h1>
+
+<p>At a regular interval, get the acceleration along the x, y, and z axis.</p>
+
+<pre><code>var watchID = navigator.accelerometer.watchAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>,
+                                                       <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>,
+                                                       [<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a>]);
+</code></pre>
+
+<h2>Description</h2>
+
+<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
+
+<p>The <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code> gets the device's current acceleration at a regular interval. Each time the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> is retrieved, the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function is executed. Specify the interval in milliseconds via the <code>frequency</code> parameter in the <code>acceleratorOptions</code> object.</p>
+
+<p>The returned watch ID references references the accelerometer watch interval. The watch ID can be used with <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></code> to stop watching the accelerometer.</p>
+
+<h2>Supported Platforms</h2>
+
+<ul>
+<li>iPhone</li>
+</ul>
+<h2>Quick Example</h2>
+
+<pre><code>function onSuccess(acceleration) {
+    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
+};
+
+function onError() {
+    alert('onError!');
+};
+
+var options = { frequency: 3000 };  // Update every 3 seconds
+
+var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+</code></pre>
+
+<h2>Full Example</h2>
+
+<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd"&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // The watch id references the current `watchAcceleration`
+    var watchID = null;
+
+    // Wait for PhoneGap to load
+    //
+    function onLoad() {
+        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+    }
+
+    // PhoneGap is ready
+    //
+    function onDeviceReady() {
+        startWatch();
+    }
+
+    // Start watching the acceleration
+    //
+    function startWatch() {
+
+        // Update acceleration every 3 seconds
+        var options = { frequency: 3000 };
+
+        watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+    }
+
+    // Stop watching the acceleration
+    //
+    function stopWatch() {
+        if (watchID) {
+            navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+            watchID = null;
+        }
+    }
+
+    // onSuccess: Get a snapshot of the current acceleration
+    //
+    function onSuccess(acceleration) {
+        var element = document.getElementById('accelerometer');
+        element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '&lt;br /&gt;' +
+                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '&lt;br /&gt;' +
+                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '&lt;br /&gt;';
+    }
+
+    // onError: Failed to get the acceleration
+    //
+    function onError() {
+        alert('onError!');
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload="onLoad()"&gt;
+    &lt;div id="accelerometer"&gt;Waiting for accelerometer...&lt;/div&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2> iPhone Quirks</h2>
+
+<ul>
+<li>At the interval requested, PhoneGap will call the success callback function and pass the accelerometer results.</li>
+<li>However, in requests to the device PhoneGap restricts the interval to minimum of every 40ms and a maximum of every 1000ms.
+<ul>
+<li>For example, if you request an interval of 3 seconds (3000ms), PhoneGap will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds.</li>
+</ul>
+</li>
+</ul>
+<hr>
+<h1><a name="accelerometer.clearWatch">accelerometer.clearWatch</a></h1>
+
+<p>Stop watching the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> referenced by the watch ID parameter.</p>
+
+<pre><code>navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+</code></pre>
+
+<ul>
+<li>
+<strong>watchID</strong>: The ID returned by <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code>.</li>
+</ul>
+<h2>Supported Platforms</h2>
+
+<ul>
+<li>iPhone</li>
+</ul>
+<h2>Quick Example</h2>
+
+<pre><code>var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+
+// ... later on ...
+
+navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+</code></pre>
+
+<h2>Full Example</h2>
+
+<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd"&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // The watch id references the current `watchAcceleration`
+    var watchID = null;
+
+    // Wait for PhoneGap to load
+    //
+    function onLoad() {
+        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+    }
+
+    // PhoneGap is ready
+    //
+    function onDeviceReady() {
+        startWatch();
+    }
+
+    // Start watching the acceleration
+    //
+    function startWatch() {
+
+        // Update acceleration every 3 seconds
+        var options = { frequency: 3000 };
+
+        watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+    }
+
+    // Stop watching the acceleration
+    //
+    function stopWatch() {
+        if (watchID) {
+            navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+            watchID = null;
+        }
+    }
+
+    // onSuccess: Get a snapshot of the current acceleration
+    //
+    function onSuccess(acceleration) {
+        var element = document.getElementById('accelerometer');
+        element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '&lt;br /&gt;' +
+                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '&lt;br /&gt;' +
+                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '&lt;br /&gt;';
+    }
+
+    // onError: Failed to get the acceleration
+    //
+    function onError() {
+        alert('onError!');
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload="onLoad()"&gt;
+    &lt;div id="accelerometer"&gt;Waiting for accelerometer...&lt;/div&gt;
+    &lt;button onclick="stopWatch();"&gt;Stop Watching&lt;/button&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<hr>
+<h1><a name="Acceleration">Acceleration</a></h1>
+
+<p>Contains <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> data captured at a specific point in time.</p>
+
+<h2>Properties</h2>
+
+<ul>
+<li>
+<strong>x:</strong> Amount of motion on the x-axis. Range [0, 1] (<code>Number</code>)</li>
+<li>
+<strong>y:</strong> Amount of motion on the y-axis. Range [0, 1] (<code>Number</code>)</li>
+<li>
+<strong>z:</strong> Amount of motion on the z-axis. Range [0, 1] (<code>Number</code>)</li>
+<li>
+<strong>timestamp:</strong> Creation timestamp in milliseconds. (<code>DOMTimeStamp</code>)</li>
+</ul>
+<h2>Description</h2>
+
+<p>This object is created and populated by PhoneGap, and returned by an <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> method.</p>
+
+<h2>Supported Platforms</h2>
+
+<ul>
+<li>Untested</li>
+</ul>
+<h2>Quick Example</h2>
+
+<pre><code>function onSuccess(acceleration) {
+    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+};
+
+function onError() {
+    alert('onError!');
+};
+
+navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+</code></pre>
+
+<h2>Full Example</h2>
+
+<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd"&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // Wait for PhoneGap to load
+    //
+    function onLoad() {
+        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+    }
+
+    // PhoneGap is ready
+    //
+    function onDeviceReady() {
+        navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+    }
+
+    // onSuccess: Get a snapshot of the current acceleration
+    //
+    function onSuccess() {
+        alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+    }
+
+    // onError: Failed to get the acceleration
+    //
+    function onError() {
+        alert('onError!');
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload="onLoad()"&gt;
+    &lt;h1&gt;Example&lt;/h1&gt;
+    &lt;p&gt;getCurrentAcceleration&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<hr>
+<h1><a name="accelerometerSuccess">accelerometerSuccess</a></h1>
+
+<p>onSuccess callback function that provides the <a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> information.</p>
+
+<pre><code>function(acceleration) {
+    // Do something
+}
+</code></pre>
+
+<h2>Parameters</h2>
+
+<ul>
+<li>
+<strong>acceleration:</strong> The acceleration at a single moment in time. (<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a>)</li>
+</ul>
+<h2>Example</h2>
+
+<pre><code>function onSuccess(acceleration) {
+    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+};
+</code></pre>
+
+<hr>
+<h1><a name="accelerometerError">accelerometerError</a></h1>
+
+<p>onError callback function for acceleration functions.</p>
+
+<pre><code>function() {
+    // Handle the error
+}
+</code></pre>
+
+<hr>
+<h1><a name="accelerometerOptions">accelerometerOptions</a></h1>
+
+<p>An optional parameter to customize the retrieval of the accelerometer.</p>
+
+<h2>Options</h2>
+
+<ul>
+<li>
+<strong>frequency:</strong> How often to retrieve the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> in milliseconds. <em>(Number)</em> (Default: 10000)</li>
+</ul>
+</div>
+		
+	</body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/table_of_contents_spec/example_no_source.html
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/table_of_contents_spec/example_no_source.html b/tools/spec/cordova/table_of_contents_spec/example_no_source.html
new file mode 100644
index 0000000..4dab85c
--- /dev/null
+++ b/tools/spec/cordova/table_of_contents_spec/example_no_source.html
@@ -0,0 +1,49 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
+<meta name="generator" content="joDoc">
+<link rel="stylesheet" type="text/css" href="index.css">
+<title>PhoneGap API Documentation</title>
+</head>
+<body>
+		<div id="header">
+			<h1>Phone<strong>Gap</strong> Documentation</h1>
+			<small></small>
+		</div>
+		<div id="subheader">
+			<h1>Accelerometer</h1>
+			<small></small>
+		</div>
+		<div id="content">
+			<blockquote>
+			  <p>Captures device motion in the x, y, and z direction.</p>
+			</blockquote>
+			<ul>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
+			</ul>
+		</div>
+	</body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/table_of_contents_spec/example_no_target.html
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/table_of_contents_spec/example_no_target.html b/tools/spec/cordova/table_of_contents_spec/example_no_target.html
new file mode 100644
index 0000000..f6d6179
--- /dev/null
+++ b/tools/spec/cordova/table_of_contents_spec/example_no_target.html
@@ -0,0 +1,496 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
+<meta name="generator" content="joDoc">
+<link rel="stylesheet" type="text/css" href="index.css">
+<title>PhoneGap API Documentation</title>
+</head>
+<body>
+		
+		<div id="header">
+			<h1>Phone<strong>Gap</strong> Documentation</h1>
+			<small></small>
+		</div>
+		<div id="subheader">
+			<h1>Accelerometer</h1>
+		</div>
+		<div id="content">
+			<h1><a name="Accelerometer">Accelerometer</a></h1>
+
+			<blockquote>
+			  <p>Captures device motion in the x, y, and z direction.</p>
+			</blockquote>
+
+			<h2>Methods</h2>
+
+			<ul>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
+			</ul>
+			<h2>Arguments</h2>
+
+			<ul>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
+			</ul>
+			<h2>Objects (Read-Only)</h2>
+
+			<ul>
+			<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
+			</ul>
+			<hr>
+			<h1><a name="accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></h1>
+
+			<p>Get the current acceleration along the x, y, and z axis.</p>
+
+			<pre><code>navigator.accelerometer.getCurrentAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>, <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>);
+			</code></pre>
+
+			<h2>Description</h2>
+
+			<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
+
+			<p>The acceleration is returned using the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function.</p>
+
+			<h2>Supported Platforms</h2>
+
+			<ul>
+			<li>iPhone</li>
+			</ul>
+			<h2>Quick Example</h2>
+
+			<pre><code>function onSuccess(acceleration) {
+			    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+			};
+
+			function onError() {
+			    alert('onError!');
+			};
+
+			navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+			</code></pre>
+
+			<h2>Full Example</h2>
+
+			<pre><code>&lt;!DOCTYPE html&gt;
+			&lt;html&gt;
+			  &lt;head&gt;
+			    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+			    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+			    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+			    // Wait for PhoneGap to load
+			    //
+			    function onLoad() {
+			        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+			    }
+
+			    // PhoneGap is ready
+			    //
+			    function onDeviceReady() {
+			        navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+			    }
+
+			    // onSuccess: Get a snapshot of the current acceleration
+			    //
+			    function onSuccess(acceleration) {
+			        alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+			              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+			              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
+			    }
+
+			    // onError: Failed to get the acceleration
+			    //
+			    function onError() {
+			        alert('onError!');
+			    }
+
+			    &lt;/script&gt;
+			  &lt;/head&gt;
+			  &lt;body onload="onLoad()"&gt;
+			    &lt;h1&gt;Example&lt;/h1&gt;
+			    &lt;p&gt;getCurrentAcceleration&lt;/p&gt;
+			  &lt;/body&gt;
+			&lt;/html&gt;
+			</code></pre>
+
+			<h2>iPhone Quirks</h2>
+
+			<ul>
+			<li>iPhone doesn't have the concept of getting the current acceleration at any given point.</li>
+			<li>You must watch the acceleration and capture the data at given time intervals.</li>
+			<li>Thus, the <code>getCurrentAcceleration</code> function will give you the last value reported from a phoneGap <code>watchAccelerometer</code> call.</li>
+			</ul>
+			<hr>
+			<h1><a name="accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></h1>
+
+			<p>At a regular interval, get the acceleration along the x, y, and z axis.</p>
+
+			<pre><code>var watchID = navigator.accelerometer.watchAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>,
+			                                                       <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>,
+			                                                       [<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a>]);
+			</code></pre>
+
+			<h2>Description</h2>
+
+			<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
+
+			<p>The <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code> gets the device's current acceleration at a regular interval. Each time the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> is retrieved, the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function is executed. Specify the interval in milliseconds via the <code>frequency</code> parameter in the <code>acceleratorOptions</code> object.</p>
+
+			<p>The returned watch ID references references the accelerometer watch interval. The watch ID can be used with <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></code> to stop watching the accelerometer.</p>
+
+			<h2>Supported Platforms</h2>
+
+			<ul>
+			<li>iPhone</li>
+			</ul>
+			<h2>Quick Example</h2>
+
+			<pre><code>function onSuccess(acceleration) {
+			    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
+			};
+
+			function onError() {
+			    alert('onError!');
+			};
+
+			var options = { frequency: 3000 };  // Update every 3 seconds
+
+			var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+			</code></pre>
+
+			<h2>Full Example</h2>
+
+			<pre><code>&lt;!DOCTYPE html&gt;
+			&lt;html&gt;
+			  &lt;head&gt;
+			    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+			    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+			    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+			    // The watch id references the current `watchAcceleration`
+			    var watchID = null;
+
+			    // Wait for PhoneGap to load
+			    //
+			    function onLoad() {
+			        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+			    }
+
+			    // PhoneGap is ready
+			    //
+			    function onDeviceReady() {
+			        startWatch();
+			    }
+
+			    // Start watching the acceleration
+			    //
+			    function startWatch() {
+
+			        // Update acceleration every 3 seconds
+			        var options = { frequency: 3000 };
+
+			        watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+			    }
+
+			    // Stop watching the acceleration
+			    //
+			    function stopWatch() {
+			        if (watchID) {
+			            navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+			            watchID = null;
+			        }
+			    }
+
+			    // onSuccess: Get a snapshot of the current acceleration
+			    //
+			    function onSuccess(acceleration) {
+			        var element = document.getElementById('accelerometer');
+			        element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '&lt;br /&gt;' +
+			                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '&lt;br /&gt;' +
+			                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '&lt;br /&gt;';
+			    }
+
+			    // onError: Failed to get the acceleration
+			    //
+			    function onError() {
+			        alert('onError!');
+			    }
+
+			    &lt;/script&gt;
+			  &lt;/head&gt;
+			  &lt;body onload="onLoad()"&gt;
+			    &lt;div id="accelerometer"&gt;Waiting for accelerometer...&lt;/div&gt;
+			  &lt;/body&gt;
+			&lt;/html&gt;
+			</code></pre>
+
+			<h2> iPhone Quirks</h2>
+
+			<ul>
+			<li>At the interval requested, PhoneGap will call the success callback function and pass the accelerometer results.</li>
+			<li>However, in requests to the device PhoneGap restricts the interval to minimum of every 40ms and a maximum of every 1000ms.
+			<ul>
+			<li>For example, if you request an interval of 3 seconds (3000ms), PhoneGap will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds.</li>
+			</ul>
+			</li>
+			</ul>
+			<hr>
+			<h1><a name="accelerometer.clearWatch">accelerometer.clearWatch</a></h1>
+
+			<p>Stop watching the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> referenced by the watch ID parameter.</p>
+
+			<pre><code>navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+			</code></pre>
+
+			<ul>
+			<li>
+			<strong>watchID</strong>: The ID returned by <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code>.</li>
+			</ul>
+			<h2>Supported Platforms</h2>
+
+			<ul>
+			<li>iPhone</li>
+			</ul>
+			<h2>Quick Example</h2>
+
+			<pre><code>var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+
+			// ... later on ...
+
+			navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+			</code></pre>
+
+			<h2>Full Example</h2>
+
+			<pre><code>&lt;!DOCTYPE html&gt;
+			&lt;html&gt;
+			  &lt;head&gt;
+			    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+			    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+			    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+			    // The watch id references the current `watchAcceleration`
+			    var watchID = null;
+
+			    // Wait for PhoneGap to load
+			    //
+			    function onLoad() {
+			        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+			    }
+
+			    // PhoneGap is ready
+			    //
+			    function onDeviceReady() {
+			        startWatch();
+			    }
+
+			    // Start watching the acceleration
+			    //
+			    function startWatch() {
+
+			        // Update acceleration every 3 seconds
+			        var options = { frequency: 3000 };
+
+			        watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
+			    }
+
+			    // Stop watching the acceleration
+			    //
+			    function stopWatch() {
+			        if (watchID) {
+			            navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
+			            watchID = null;
+			        }
+			    }
+
+			    // onSuccess: Get a snapshot of the current acceleration
+			    //
+			    function onSuccess(acceleration) {
+			        var element = document.getElementById('accelerometer');
+			        element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '&lt;br /&gt;' +
+			                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '&lt;br /&gt;' +
+			                            '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '&lt;br /&gt;';
+			    }
+
+			    // onError: Failed to get the acceleration
+			    //
+			    function onError() {
+			        alert('onError!');
+			    }
+
+			    &lt;/script&gt;
+			  &lt;/head&gt;
+			  &lt;body onload="onLoad()"&gt;
+			    &lt;div id="accelerometer"&gt;Waiting for accelerometer...&lt;/div&gt;
+			    &lt;button onclick="stopWatch();"&gt;Stop Watching&lt;/button&gt;
+			  &lt;/body&gt;
+			&lt;/html&gt;
+			</code></pre>
+
+			<hr>
+			<h1><a name="Acceleration">Acceleration</a></h1>
+
+			<p>Contains <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> data captured at a specific point in time.</p>
+
+			<h2>Properties</h2>
+
+			<ul>
+			<li>
+			<strong>x:</strong> Amount of motion on the x-axis. Range [0, 1] (<code>Number</code>)</li>
+			<li>
+			<strong>y:</strong> Amount of motion on the y-axis. Range [0, 1] (<code>Number</code>)</li>
+			<li>
+			<strong>z:</strong> Amount of motion on the z-axis. Range [0, 1] (<code>Number</code>)</li>
+			<li>
+			<strong>timestamp:</strong> Creation timestamp in milliseconds. (<code>DOMTimeStamp</code>)</li>
+			</ul>
+			<h2>Description</h2>
+
+			<p>This object is created and populated by PhoneGap, and returned by an <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> method.</p>
+
+			<h2>Supported Platforms</h2>
+
+			<ul>
+			<li>Untested</li>
+			</ul>
+			<h2>Quick Example</h2>
+
+			<pre><code>function onSuccess(acceleration) {
+			    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+			};
+
+			function onError() {
+			    alert('onError!');
+			};
+
+			navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+			</code></pre>
+
+			<h2>Full Example</h2>
+
+			<pre><code>&lt;!DOCTYPE html&gt;
+			&lt;html&gt;
+			  &lt;head&gt;
+			    &lt;title&gt;<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example&lt;/title&gt;
+
+			    &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
+			    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+			    // Wait for PhoneGap to load
+			    //
+			    function onLoad() {
+			        document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+			    }
+
+			    // PhoneGap is ready
+			    //
+			    function onDeviceReady() {
+			        navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
+			    }
+
+			    // onSuccess: Get a snapshot of the current acceleration
+			    //
+			    function onSuccess() {
+			        alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+			              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+			              '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+			    }
+
+			    // onError: Failed to get the acceleration
+			    //
+			    function onError() {
+			        alert('onError!');
+			    }
+
+			    &lt;/script&gt;
+			  &lt;/head&gt;
+			  &lt;body onload="onLoad()"&gt;
+			    &lt;h1&gt;Example&lt;/h1&gt;
+			    &lt;p&gt;getCurrentAcceleration&lt;/p&gt;
+			  &lt;/body&gt;
+			&lt;/html&gt;
+			</code></pre>
+
+			<hr>
+			<h1><a name="accelerometerSuccess">accelerometerSuccess</a></h1>
+
+			<p>onSuccess callback function that provides the <a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> information.</p>
+
+			<pre><code>function(acceleration) {
+			    // Do something
+			}
+			</code></pre>
+
+			<h2>Parameters</h2>
+
+			<ul>
+			<li>
+			<strong>acceleration:</strong> The acceleration at a single moment in time. (<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a>)</li>
+			</ul>
+			<h2>Example</h2>
+
+			<pre><code>function onSuccess(acceleration) {
+			    alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
+			          '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
+			};
+			</code></pre>
+
+			<hr>
+			<h1><a name="accelerometerError">accelerometerError</a></h1>
+
+			<p>onError callback function for acceleration functions.</p>
+
+			<pre><code>function() {
+			    // Handle the error
+			}
+			</code></pre>
+
+			<hr>
+			<h1><a name="accelerometerOptions">accelerometerOptions</a></h1>
+
+			<p>An optional parameter to customize the retrieval of the accelerometer.</p>
+
+			<h2>Options</h2>
+
+			<ul>
+			<li>
+			<strong>frequency:</strong> How often to retrieve the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> in milliseconds. <em>(Number)</em> (Default: 10000)</li>
+			</ul>
+		</div>
+		
+	</body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/update_index_spec.js
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/update_index_spec.js b/tools/spec/cordova/update_index_spec.js
new file mode 100644
index 0000000..5fee632
--- /dev/null
+++ b/tools/spec/cordova/update_index_spec.js
@@ -0,0 +1,77 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+/*jslint node: true */
+/*global describe, it, beforeEach, afterEach, after, before */
+(function () {
+    'use strict';
+    var assert = require("assert"),
+        path = require('path'),
+        fs = require('fs'),
+        cheerio = require('cheerio'),
+        UpdateIndex = require("../../lib/cordova/post/updateindex"),
+        SpecHelpers = require("../spec_helpers");
+
+    describe('UpdateIndex', function () {
+        var sut,
+            files;
+        
+        beforeEach(function (done) {
+            var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
+            sut = new UpdateIndex();
+            files = {
+                'input': path.join(tmp_directory, 'index.md.html'),
+                'output': path.join(tmp_directory, 'index.html')
+            };
+            done();
+        });
+        
+        afterEach(function (done) {
+            SpecHelpers.remove_tmp_directory();
+            done();
+        });
+
+        it('should skip all files but index.md.html', function () {
+            assert.strictEqual(false, sut.run('index.md'));
+            assert.strictEqual(false, sut.run('index.html'));
+            assert.strictEqual(false, sut.run('_index.md.html'));
+        });
+
+        it('should rename the title', function () {
+            var testing_file = files.normal,
+                dom,
+                initial_title,
+                new_title;
+            dom = cheerio.load(fs.readFileSync(files.input));
+            initial_title = dom('#subheader > h1').first().html();
+            assert.notStrictEqual(sut.header_title, initial_title);
+            sut.run(files.input);
+            dom = cheerio.load(fs.readFileSync(files.output));
+            new_title = dom('#subheader > h1').first().html();
+            assert.strictEqual(sut.header_title, new_title);
+        });
+
+        it('should rename the file', function () {
+            assert.strictEqual(true, fs.existsSync(files.input));
+            assert.strictEqual(false, fs.existsSync(files.output));
+            var result = sut.run(files.input);
+            assert.strictEqual(false, fs.existsSync(files.input));
+            assert.strictEqual(true, fs.existsSync(files.output));
+        });
+    });
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/update_index_spec/index.md.html
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/update_index_spec/index.md.html b/tools/spec/cordova/update_index_spec/index.md.html
new file mode 100644
index 0000000..5a81724
--- /dev/null
+++ b/tools/spec/cordova/update_index_spec/index.md.html
@@ -0,0 +1,112 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
+		<meta name="generator" content="joDoc">
+		<link rel="stylesheet" type="text/css" href="index.css">
+		<link rel="stylesheet" type="text/css" href="mobile.css" media="only screen and (max-device-width: 1024px)">
+		<title>PhoneGap API Documentation</title>
+	</head>
+	<body>
+		
+		<div id="header">
+			<h1><a href="index.html">Phone<strong>Gap</strong> Documentation</a></h1>
+			<small></small>
+		</div>
+		<div id="subheader">
+			<h1>Geolocation</h1>
+			<small></small>
+		</div>
+		
+		<div id="sidebar">
+			<div class="vertical_divider"></div>
+			<h1>API Reference</h1>
+			<ul>
+				<li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
+				<li><a href="phonegap_camera_camera.md.html">Camera</a></li>
+				<li><a href="phonegap_media_capture.md.html">Capture</a></li>
+				<li><a href="phonegap_device_device.md.html">Device</a></li>
+				<li><a href="phonegap_events_events.md.html">Events</a></li>
+				<li><a href="phonegap_file_file.md.html">File</a></li>
+				<li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
+				<li><a href="phonegap_media_media.md.html">Media</a></li>
+				<li><a href="phonegap_notification_notification.md.html">Notification</a></li>
+				<li><a href="phonegap_storage_storage.md.html">Storage</a></li>
+			</ul>
+			<h1></h1>
+			<ul>
+				<li><a href="_index.html">Keyword Index</a></li>
+			</ul>
+		</div>
+		
+		<div id="content">
+			<div id="home">
+    <h1><a name="API Reference">API Reference</a></h1>
+    <ul>
+        <li>
+            <h2><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></h2>
+            <span>Tap into the device's motion sensor.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_camera_camera.md.html#Camera">Camera</a></h2>
+            <span>Capture photo using the device's camera.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_media_capture.md.html#Capture">Capture</a></h2>
+            <span>Capture media using device applications.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_device_device.md.html#Device">Device</a></h2>
+            <span>Gather device specific information.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_events_events.md.html#Events">Events</a></h2>
+            <span>Hook into native events through JavaScript.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_file_file.md.html#File">File</a></h2>
+            <span>Hook into native file system through JavaScript.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_geolocation_geolocation.md.html#Geolocation">Geolocation</a></h2>
+            <span>Make your application location aware.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_media_media.md.html#Media">Media</a></h2>
+            <span>Record and play back audio.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_notification_notification.md.html#Notification">Notification</a></h2>
+            <span>Visual, audible, and tactile device notifications.</span>
+        </li>
+        <li>
+            <h2><a href="phonegap_storage_storage.md.html#Storage">Storage</a></h2>
+            <span>Hook into the native devices storage options.</span>
+        </li>
+    </ul>
+</div>
+
+		</div>
+		
+	</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/update_keyword_index_spec.js
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/update_keyword_index_spec.js b/tools/spec/cordova/update_keyword_index_spec.js
new file mode 100644
index 0000000..6ff1061
--- /dev/null
+++ b/tools/spec/cordova/update_keyword_index_spec.js
@@ -0,0 +1,96 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+/*jslint node: true */
+/*global describe, it, beforeEach, afterEach, after, before */
+(function () {
+    'use strict';
+    var assert = require("assert"),
+        path = require('path'),
+        fs = require('fs'),
+        cheerio = require('cheerio'),
+        UpdateKeywordIndex = require("../../lib/cordova/post/updatekeywordindex"),
+        SpecHelpers = require("../spec_helpers");
+
+    describe('UpdateKeywordIndex', function () {
+        var sut,
+            file;
+        
+        beforeEach(function (done) {
+            var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
+            sut = new UpdateKeywordIndex();
+            file = path.join(tmp_directory, '_index.html');
+            done();
+        });
+        
+        afterEach(function (done) {
+            SpecHelpers.remove_tmp_directory();
+            done();
+        });
+
+        it('should skip all files but _index.html', function () {
+            assert.strictEqual(false, sut.run('index.md'));
+            assert.strictEqual(false, sut.run('index.html'));
+            assert.strictEqual(false, sut.run('index.htm'));
+            assert.strictEqual(false, sut.run('_index.htm'));
+            assert.strictEqual(false, sut.run('index.md.html'));
+        });
+
+        it('should rename the title', function () {
+            var dom,
+                initial_title,
+                new_title;
+            dom = cheerio.load(fs.readFileSync(file));
+            initial_title = dom('#subheader > h1').first().html();
+            assert.notStrictEqual(sut.header_title, initial_title);
+            sut.run(file);
+            dom = cheerio.load(fs.readFileSync(file));
+            new_title = dom('#subheader > h1').first().html();
+            assert.strictEqual(sut.header_title, new_title);
+        });
+
+        it('should rename the h1', function () {
+            var dom,
+                initial_title,
+                new_title;
+            dom = cheerio.load(fs.readFileSync(file));
+            initial_title = dom('#content > h1').first().html();
+            assert.notStrictEqual(sut.content_title, initial_title);
+            sut.run(file);
+            dom = cheerio.load(fs.readFileSync(file));
+            new_title = dom('#content > h1').first().html();
+            assert.strictEqual(sut.content_title, new_title);
+        });
+
+        it('should remove the <hr/>', function () {
+            var dom;
+            dom = cheerio.load(fs.readFileSync(file));
+            assert.notStrictEqual(0, dom('#content > hr').length);
+            sut.run(file);
+            dom = cheerio.load(fs.readFileSync(file));
+            assert.strictEqual(0, dom('#content > hr').length);
+        });
+
+        it('should update references from index.md.html to index.html', function () {
+            var fileToSearch = "index.md.html";
+            assert.notStrictEqual(-1, fs.readFileSync(file).toString().indexOf(fileToSearch));
+            sut.run(file);
+            assert.strictEqual(-1, fs.readFileSync(file).toString().indexOf(fileToSearch));
+        });
+    });
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/update_keyword_index_spec/_index.html
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/update_keyword_index_spec/_index.html b/tools/spec/cordova/update_keyword_index_spec/_index.html
new file mode 100644
index 0000000..ac5f59a
--- /dev/null
+++ b/tools/spec/cordova/update_keyword_index_spec/_index.html
@@ -0,0 +1,155 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
+<meta name="generator" content="joDoc">
+<link rel="stylesheet" type="text/css" href="index.css">
+<title>PhoneGap API Documentation</title>
+</head>
+<body>
+		
+		<div id="header">
+			<h1>Phone<strong>Gap</strong> Documentation</h1>
+			<small></small>
+		</div>
+		<div id="subheader">
+			<h1>Index</h1>
+			<small>
+				<select><option>Quick Jump...</option>
+<option>Geolocation</option>
+<option>getCurrentPosition</option>
+<option>    - Description</option>
+<option>    - Quick Example</option>
+<option>    - Full Example</option>
+<option>    - iPhone Quirks</option>
+<option>watchPosition</option>
+<option>    - Description</option>
+<option>    - Quick Example</option>
+<option>    - Full Example</option>
+<option>    - iPhone Quirks</option>
+<option>clearWatch</option>
+<option>    - Description</option>
+<option>    - Quick Example</option>
+<option>    - Full Example</option>
+<option>    - iPhone Quirks</option></select></small>
+		</div>
+		
+		<div id="sidebar">
+			<div class="vertical_divider"></div>
+			<h1>API Reference</h1>
+			<ul>
+<li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
+				<li><a href="phonegap_camera_camera.md.html">Camera</a></li>
+				<li><a href="phonegap_media_capture.md.html">Capture</a></li>
+				<li><a href="phonegap_device_device.md.html">Device</a></li>
+				<li><a href="phonegap_events_events.md.html">Events</a></li>
+				<li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
+				<li><a href="phonegap_notification_notification.md.html">Notification</a></li>
+			</ul>
+<h1></h1>
+			<ul>
+<li><a href="_index.html">Keyword Index</a></li>
+			</ul>
+</div>
+		
+		<div id="content">
+			
+
+<hr>
+<h1>Index</h1>
+<div id="index">
+
+<h2>A</h2>
+
+<ul>
+<li><a href="introduction.md.html#About">About</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
+<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
+<li><a href="introduction.md.html#Application%20Template">Application Template</a></li>
+<li><a href="index.md.html#API%20Reference">API Reference</a></li>
+</ul>
+<h2>C</h2>
+
+<ul>
+<li><a href="phonegap_camera_camera.md.html#Camera">Camera</a></li>
+<li><a href="phonegap_camera_camera.md.html#camera.getPicture">camera.getPicture</a></li>
+<li><a href="phonegap_camera_camera.md.html#cameraError">cameraError</a></li>
+<li><a href="phonegap_camera_camera.md.html#cameraOptions">cameraOptions</a></li>
+<li><a href="phonegap_camera_camera.md.html#cameraSuccess">cameraSuccess</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#Coordinates">Coordinates</a></li>
+</ul>
+<h2>D</h2>
+
+<ul>
+<li><a href="phonegap_device_device.md.html#Device">Device</a></li>
+<li><a href="phonegap_device_device.md.html#device.name">device.name</a></li>
+<li><a href="phonegap_device_device.md.html#device.platform">device.platform</a></li>
+<li><a href="phonegap_device_device.md.html#device.uuid">device.uuid</a></li>
+<li><a href="phonegap_device_device.md.html#device.version">device.version</a></li>
+<li><a href="phonegap_events_events.md.html#deviceready">deviceready</a></li>
+</ul>
+<h2>E</h2>
+
+<ul>
+<li><a href="phonegap_events_events.md.html#Events">Events</a></li>
+</ul>
+<h2>G</h2>
+
+<ul>
+<li><a href="phonegap_geolocation_geolocation.md.html#Geolocation">Geolocation</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#geolocation.clearWatch">geolocation.clearWatch</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#geolocation.getCurrentPosition">geolocation.getCurrentPosition</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#geolocation.watchPosition">geolocation.watchPosition</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#geolocationError">geolocationError</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#geolocationOptions">geolocationOptions</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#geolocationSuccess">geolocationSuccess</a></li>
+<li><a href="introduction.md.html#Getting%20Started">Getting Started</a></li>
+</ul>
+<h2>N</h2>
+
+<h2>P</h2>
+
+<ul>
+<li><a href="introduction.md.html#PhoneGap%20API%20Documentation">PhoneGap API Documentation</a></li>
+<li><a href="phonegap_geolocation_geolocation.md.html#Position">Position</a></li>
+</ul>
+<h2>R</h2>
+
+<ul>
+<li><a href="phonegap_network_network.md.html#reachableCallback">reachableCallback</a></li>
+<li><a href="phonegap_network_network.md.html#reachableHostname">reachableHostname</a></li>
+<li><a href="phonegap_network_network.md.html#reachableOptions">reachableOptions</a></li>
+</ul>
+</div>
+
+
+		</div>
+		
+	</body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/yaml_front_matter_spec.js
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/yaml_front_matter_spec.js b/tools/spec/cordova/yaml_front_matter_spec.js
new file mode 100644
index 0000000..1e9b359
--- /dev/null
+++ b/tools/spec/cordova/yaml_front_matter_spec.js
@@ -0,0 +1,67 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+/*jslint node: true */
+/*global describe, it, beforeEach, afterEach, after, before */
+(function () {
+    'use strict';
+    var assert = require("assert"),
+        path = require('path'),
+        fs = require('fs'),
+        cheerio = require('cheerio'),
+        YamlFrontMatter = require("../../lib/cordova/pre/yamlfrontmatter"),
+        SpecHelpers = require("../spec_helpers");
+
+    describe('YamlFrontMatter', function () {
+        var sut,
+            files;
+        
+        beforeEach(function (done) {
+            var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
+            sut = new YamlFrontMatter();
+            files = {
+                'yaml': path.join(tmp_directory, 'has_yaml.md'),
+                'no_yaml': path.join(tmp_directory, 'no_yaml.md')
+            };
+            done();
+        });
+        
+        afterEach(function (done) {
+            SpecHelpers.remove_tmp_directory();
+            done();
+        });
+
+        it('should skip files with no YAML Front Matter', function () {
+            var expected_data = fs.readFileSync(files.no_yaml, "utf8"),
+                data,
+                actual_data;
+            data = sut.run(files.no_yaml);
+            assert.deepEqual({}, data);
+            actual_data = fs.readFileSync(files.no_yaml, "utf8");
+            assert.strictEqual(expected_data, actual_data);
+        });
+
+        it('should parse files with YAML Front Matter', function () {
+            var data = sut.run(files.yaml);
+            assert.deepEqual({
+                'platforms': 'Android, BlackBerry, iOS',
+                'type': 'Function'
+            }, data);
+        });
+    });
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md b/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md
new file mode 100644
index 0000000..6f3e750
--- /dev/null
+++ b/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md
@@ -0,0 +1,13 @@
+---
+platforms: Android, BlackBerry, iOS
+type: Function
+---
+
+
+
+
+
+PhoneGap
+========
+
+It's a fun place to be
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md
----------------------------------------------------------------------
diff --git a/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md b/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md
new file mode 100644
index 0000000..d8b5837
--- /dev/null
+++ b/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md
@@ -0,0 +1,4 @@
+PhoneGap II
+===========
+
+The return of the system admin.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/file_helpers_spec.js
----------------------------------------------------------------------
diff --git a/tools/spec/file_helpers_spec.js b/tools/spec/file_helpers_spec.js
new file mode 100644
index 0000000..5eceb42
--- /dev/null
+++ b/tools/spec/file_helpers_spec.js
@@ -0,0 +1,33 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+/*jslint node: true*/
+/*global describe, it, beforeEach */
+(function () {
+    'use strict';
+    var assert = require("assert"),
+        path = require('path'),
+        fs = require('fs'),
+        FileHelpers = require("../lib/file_helpers");
+
+    describe('FileHelpers', function () {
+        it('should have a default input directory that exists', function () {
+            assert.equal(true, fs.existsSync(FileHelpers.getDefaultInputDirectory()));
+        });
+    });
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/spec/spec_helpers.js
----------------------------------------------------------------------
diff --git a/tools/spec/spec_helpers.js b/tools/spec/spec_helpers.js
new file mode 100644
index 0000000..c61ae7a
--- /dev/null
+++ b/tools/spec/spec_helpers.js
@@ -0,0 +1,100 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+/*jslint node: true */
+var fs = require("fs-extra");
+var path = require("path");
+var FileHelpers = require("../lib/file_helpers");
+
+var SpecHelpers = (function () {
+    'use strict';
+    
+    /**
+    * Creates a new instance of SpecHelpers
+    * @param options Options for the generation process.
+    */
+    function SpecHelpers() {
+    }
+    
+    SpecHelpers.create_tmp_directory_assets = function (reference_filename) {
+        var directories;
+        if (reference_filename === null || reference_filename === undefined) {
+            directories = {
+                source: SpecHelpers.docs_directory(),
+                destination: SpecHelpers.tmp_docs_directory()
+            };
+        } else {
+            directories = SpecHelpers.find_test_directories(reference_filename);
+        }
+
+        if (directories !== null) {
+            fs.copySync(directories.source, directories.destination);
+        }
+
+        return directories.destination;
+    };
+    
+    SpecHelpers.find_test_directories = function (filename) {
+        var extension = path.extname(filename),
+            source_directory = filename.replace(extension, ''),
+            destination_directory = path.join(SpecHelpers.tmp_directory(), path.basename(source_directory));
+    
+        if (!fs.existsSync(source_directory)) {
+            console.warn("The directory " + source_directory + " not present");
+            return null;
+        }
+        
+        return {
+            source: source_directory,
+            destination: destination_directory
+        };
+    };
+    
+    SpecHelpers.tmp_public_directory = function () {
+        return path.join(SpecHelpers.tmp_directory(), 'public');
+    };
+    
+    SpecHelpers.docs_directory = function () {
+        return FileHelpers.getDefaultInputDirectory();
+    };
+    
+    SpecHelpers.tmp_docs_directory = function () {
+        return path.join(SpecHelpers.tmp_directory(), 'docs');
+    };
+    
+    /**
+    * Gets temporary directory for running specs.
+    */
+    SpecHelpers.tmp_directory = function () {
+        return path.resolve(path.join(SpecHelpers.root_directory(), '..', 'tmp_spec'));
+    };
+    
+    /**
+    * Root directory for the project.
+    */
+    SpecHelpers.root_directory = function () {
+        return path.resolve(path.dirname(module.filename));
+    };
+    
+    SpecHelpers.remove_tmp_directory = function () {
+        fs.removeSync(SpecHelpers.tmp_directory());
+    };
+    
+    return SpecHelpers;
+}());
+module.exports = SpecHelpers;
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message