From 350a5b0911bce3d936db678cbea58b68225b2f51 Mon Sep 17 00:00:00 2001 From: mhartington Date: Mon, 22 Feb 2016 16:20:00 -0500 Subject: [PATCH] docs: updated docs to have consistent format --- scripts/docs/templates/common.template.html | 13 ++++++------ src/plugins/actionsheet.ts | 20 ++++++++++-------- src/plugins/barcodescanner.ts | 5 ++++- src/plugins/ble.ts | 23 ++++++++++++++------- src/plugins/calendar.ts | 5 ++++- src/plugins/camera.ts | 5 ++++- src/plugins/contacts.ts | 2 ++ src/plugins/device.ts | 5 ++++- src/plugins/facebook.ts | 7 +++++-- src/plugins/geolocation.ts | 11 +++++++--- src/plugins/push.ts | 5 ++++- src/plugins/statusbar.ts | 4 +++- src/plugins/touchid.ts | 16 +++++++------- 13 files changed, 81 insertions(+), 40 deletions(-) diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 5c4576d5e..b15f0c533 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -114,12 +114,7 @@ Improve this doc <@ endblock @> - - -<@ block description @> -<$ doc.description | marked $> -<@ endblock @> - + <@- if doc.decorators @> <@ for prop in doc.decorators[0].argumentInfo @>
@@ -135,6 +130,12 @@ Repo: <$ prop.repo $>
 <@ endfor @>
 <@ endif -@>
 
+
+<@ block description @>
+<$ doc.description | marked $>
+<@ endblock @>
+
+
 <@- if doc.directiveInfo @>
 

<$ doc.directiveInfo.type $>

<$ doc.directiveInfo.properties[0].name $>: <$ doc.directiveInfo.properties[0].values $>

diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index eaa5224cc..9d4c139c2 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -1,13 +1,15 @@ import {Plugin, Cordova} from './plugin'; /** + * @name ActionSheet + * @description * The ActionSheet plugin shows a native list of options the user can choose from. * * Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). * * @usage * - * ``` + * ```ts * import {ActionSheet} from 'ionic-native'; * * let buttonLabels = ['Share via Facebook', 'Share via Twitter']; @@ -33,14 +35,14 @@ export class ActionSheet { /** * Show the ActionSheet. * @param {options} options - * `buttonLabels`: string[] - * `title`: string - * `androidTheme` (Android only): number 1-5 - * `androidEnableCancelButton` (Android only): boolean, default false - * `winphoneEnableCancelButton` (WP only): boolean, default false - * `addCancelButtonWithLabel`: string - * `addDestructiveButtonWithLabel`: string - * `position`: [x, y] (iPad pass in [x, y] coords of popover) + * `buttonLabels`: string[] + * `title`: string + * `androidTheme` (Android only): number 1-5 + * `androidEnableCancelButton` (Android only): boolean, default false + * `winphoneEnableCancelButton` (WP only): boolean, default false + * `addCancelButtonWithLabel`: string + * `addDestructiveButtonWithLabel`: string + * `position`: [x, y] (iPad pass in [x, y] coords of popover) * @returns {Promise} Returns a Promise that resolves with the index of the * button pressed (1 based, so 1, 2, 3, etc.) */ diff --git a/src/plugins/barcodescanner.ts b/src/plugins/barcodescanner.ts index 9fd5da799..33cce31e7 100644 --- a/src/plugins/barcodescanner.ts +++ b/src/plugins/barcodescanner.ts @@ -1,6 +1,8 @@ import {Plugin, Cordova} from './plugin'; /** + * @name BarcodeScanner + * @description * The Barcode Scanner Plugin opens a camera view and automatically scans a barcode, returning the data back to you. * * Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). @@ -17,7 +19,8 @@ import {Plugin, Cordova} from './plugin'; @Plugin({ name: 'BarcodeScanner', plugin: 'phonegap-plugin-barcodescanner', - pluginRef: 'cordova.plugins.barcodeScanner' + pluginRef: 'cordova.plugins.barcodeScanner', + repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner' }) export class BarcodeScanner { diff --git a/src/plugins/ble.ts b/src/plugins/ble.ts index 4e69ff04c..f121bca1d 100644 --- a/src/plugins/ble.ts +++ b/src/plugins/ble.ts @@ -2,6 +2,8 @@ import {Plugin, Cordova} from './plugin'; import {Observable} from 'rxjs/Observable'; /** + * @name BLE + * @description * This plugin enables communication between a phone and Bluetooth Low Energy (BLE) peripherals. * * The plugin provides a simple JavaScript API for iOS and Android. @@ -16,10 +18,13 @@ import {Observable} from 'rxjs/Observable'; * * Simultaneous connections to multiple peripherals are supported. * + * @usage + * * ## Peripheral Data * * Peripheral Data is passed to the success callback when scanning and connecting. Limited data is passed when scanning. - * ``` + * + * ```ts * { * "name": "Battery Demo", * "id": "20:FF:D0:FF:D1:C0", @@ -28,7 +33,8 @@ import {Observable} from 'rxjs/Observable'; * } * ``` * After connecting, the peripheral object also includes service, characteristic and descriptor information. - * ``` + * + * ```ts * { * "name": "Battery Demo", * "id": "20:FF:D0:FF:D1:C0", @@ -86,7 +92,8 @@ import {Observable} from 'rxjs/Observable'; * The advertising information for both Android and iOS appears to be a combination of advertising data and scan response data. * * ### Android - * ``` + * + * ```ts * { * "name": "demo", * "id": "00:1A:7D:DA:71:13", @@ -100,7 +107,8 @@ import {Observable} from 'rxjs/Observable'; * ### iOS * * Note that iOS uses the string value of the constants for the [Advertisement Data Retrieval Keys](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/index.html#//apple_ref/doc/constant_group/Advertisement_Data_Retrieval_Keys). This will likely change in the future. - * ``` + * + * ```ts * { * "name": "demo", * "id": "D8479A4F-7517-BCD3-91B5-3302B2F81802", @@ -128,7 +136,8 @@ import {Observable} from 'rxjs/Observable'; * This plugin uses typed Arrays or ArrayBuffers for sending and receiving data. * * This means that you need convert your data to ArrayBuffers before sending and from ArrayBuffers when receiving. - * ``` + * + * ```ts * // ASCII only * function stringToBytes(string) { * var array = new Uint8Array(string.length); @@ -154,7 +163,7 @@ import {Observable} from 'rxjs/Observable'; name: 'BLE', plugin: 'cordova-plugin-ble-central', pluginRef: 'ble', - pluginRepo: 'https://github.com/don/cordova-plugin-ble-central' + repo: 'https://github.com/don/cordova-plugin-ble-central' }) export class BLE { /** @@ -369,7 +378,7 @@ export class BLE { * console.log(String.fromCharCode.apply(null, new Uint8Array(buffer)); * }); * ``` - * + * * @param {string} device_id UUID or MAC address of the peripheral * @param {string} service_uuid UUID of the BLE service * @param {string} characteristic_uuid UUID of the BLE characteristic diff --git a/src/plugins/calendar.ts b/src/plugins/calendar.ts index 0969b74de..0ff05dce4 100644 --- a/src/plugins/calendar.ts +++ b/src/plugins/calendar.ts @@ -17,6 +17,8 @@ export interface Calendar { } /** + * @name Calendar + * @description * This plugin allows you to add events to the Calendar of the mobile device. * * Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin). @@ -25,7 +27,8 @@ export interface Calendar { @Plugin({ name: 'Calendar', plugin: 'cordova-plugin-calendar', - pluginRef: 'plugins.calendar' + pluginRef: 'plugins.calendar', + repo: 'https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin' }) export class Calendar { /** diff --git a/src/plugins/camera.ts b/src/plugins/camera.ts index a63670b01..52a2e3669 100644 --- a/src/plugins/camera.ts +++ b/src/plugins/camera.ts @@ -85,6 +85,8 @@ export interface CameraPopoverOptions { } /** + * @name Camera + * @description * Take a photo or capture video. * * Requires Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera). @@ -102,7 +104,8 @@ export interface CameraPopoverOptions { @Plugin({ name: 'Camera', plugin: 'cordova-plugin-camera', - pluginRef: 'navigator.camera' + pluginRef: 'navigator.camera', + repo: 'https://github.com/apache/cordova-plugin-camera' }) export class Camera { /** diff --git a/src/plugins/contacts.ts b/src/plugins/contacts.ts index 57e757f3f..8a2fbc7b3 100644 --- a/src/plugins/contacts.ts +++ b/src/plugins/contacts.ts @@ -188,6 +188,8 @@ declare var Contact: { } /** + * @name Contacts + * @description * Access and manage Contacts on the device. * * Requires plugin: `cordova-plugin-contacts` diff --git a/src/plugins/device.ts b/src/plugins/device.ts index 1a9d1190a..0273c2e73 100644 --- a/src/plugins/device.ts +++ b/src/plugins/device.ts @@ -27,6 +27,8 @@ export interface Device { } /** + * @name Device + * @description * Access information about the underlying device and platform. * * @usage @@ -37,7 +39,8 @@ export interface Device { @Plugin({ name: 'Device', plugin: 'cordova-plugin-device', - pluginRef: 'device' + pluginRef: 'device', + repo: 'https://github.com/apache/cordova-plugin-device' }) export class Device { diff --git a/src/plugins/facebook.ts b/src/plugins/facebook.ts index ec745f6ab..4d0d98ee8 100644 --- a/src/plugins/facebook.ts +++ b/src/plugins/facebook.ts @@ -1,6 +1,8 @@ import {Plugin, Cordova} from './plugin'; /** + * @name Facebook + * @description * Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android. * * Requires Cordova plugin: `cordova-plugin-facebook4`. For more info, please see the [Facebook Connect](https://github.com/jeduan/cordova-plugin-facebook4). @@ -70,7 +72,8 @@ import {Plugin, Cordova} from './plugin'; @Plugin({ name: 'Facebook', plugin: 'cordova-plugin-facebook4', - pluginRef: 'facebookConnectPlugin' + pluginRef: 'facebookConnectPlugin', + repo: 'https://github.com/jeduan/cordova-plugin-facebook4' }) export class Facebook { @@ -82,7 +85,7 @@ export class Facebook { /** * Login to Facebook to authenticate this app. * - * ``` + * ```ts * { * status: "connected", * authResponse: { diff --git a/src/plugins/geolocation.ts b/src/plugins/geolocation.ts index 98ebbe3f5..9b7dc1032 100644 --- a/src/plugins/geolocation.ts +++ b/src/plugins/geolocation.ts @@ -93,10 +93,15 @@ export interface GeolocationOptions { /** - * Get geolocation data. + * @name Geolocation + * @description + * This plugin provides information about the device's location, such as latitude and longitude. Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs. + * + * This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation. * * @usage - * ```js + * + * ```ts * Geolocation.getCurrentPosition().then((resp) => { * //resp.coords.latitude * //resp.coords.longitude @@ -135,7 +140,7 @@ export class Geolocation { * Watch the current device's position. Clear the watch by unsubscribing from * Observable changes. * - * ``` + * ```ts * var subscription = Geolocation.watchPosition().subscribe(position => { * console.log(position.coords.longitude + ' ' + position.coords.latitude); * }); diff --git a/src/plugins/push.ts b/src/plugins/push.ts index 9b34aec0a..a16da648e 100644 --- a/src/plugins/push.ts +++ b/src/plugins/push.ts @@ -246,6 +246,8 @@ declare var PushNotification: { } /** + * @name Push + * @description * Register and receive push notifications. * * Requires Cordova plugin: `phonegap-plugin-push`. For more info, please see the [Push plugin docs](https://github.com/phonegap/phonegap-plugin-push). @@ -256,7 +258,8 @@ declare var PushNotification: { @Plugin({ name: 'Push', plugin: 'phonegap-plugin-push', - pluginRef: 'PushNotification' + pluginRef: 'PushNotification', + repo: 'https://github.com/phonegap/phonegap-plugin-push' }) export class Push { diff --git a/src/plugins/statusbar.ts b/src/plugins/statusbar.ts index 053ffae74..803ec124a 100644 --- a/src/plugins/statusbar.ts +++ b/src/plugins/statusbar.ts @@ -3,6 +3,7 @@ import {Plugin, Cordova, RequiresPlugin} from './plugin'; declare var window; /** + * * Manage the appearance of the native status bar. * * Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar). @@ -10,7 +11,8 @@ declare var window; @Plugin({ name: 'StatusBar', plugin: 'cordova-plugin-statusbar', - pluginRef: 'StatusBar' + pluginRef: 'StatusBar', + repo: 'https://github.com/apache/cordova-plugin-statusbar' }) export class StatusBar { /** diff --git a/src/plugins/touchid.ts b/src/plugins/touchid.ts index 420b71439..64098d8f5 100644 --- a/src/plugins/touchid.ts +++ b/src/plugins/touchid.ts @@ -1,6 +1,8 @@ import {Plugin, Cordova} from './plugin'; /** + * @name TouchID + * @description * Scan the fingerprint of a user with the TouchID sensor. * * Requires Cordova plugin: `cordova-plugin-touch-id`. For more info, please see the [TouchID plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-touch-id). @@ -11,13 +13,13 @@ import {Plugin, Cordova} from './plugin'; * * Here is a list of some of the error codes: * - * `-1` - Fingerprint scan failed more than 3 times - * `-2` or `-128` - User tapped the 'Cancel' button - * `-3` - User tapped the 'Enter Passcode' or 'Enter Password' button - * `-4` - The scan was cancelled by the system (Home button for example) - * `-6` - TouchID is not Available - * `-8` - TouchID is locked out from too many tries - * + * - `-1` - Fingerprint scan failed more than 3 times + * - `-2` or `-128` - User tapped the 'Cancel' button + * - `-3` - User tapped the 'Enter Passcode' or 'Enter Password' button + * - `-4` - The scan was cancelled by the system (Home button for example) + * - `-6` - TouchID is not Available + * - `-8` - TouchID is locked out from too many tries + * */ @Plugin({ name: 'TouchID',