From 73d0d57bbc8f02298ad48ed989958a7abebf1935 Mon Sep 17 00:00:00 2001
From: Ibby Hadeed
Date: Fri, 7 Jul 2017 05:49:45 -0400
Subject: [PATCH] docs(): add paid tag
---
scripts/docs/processors/jekyll.js | 12 ++++++++++++
scripts/docs/tag-defs/tag-defs.js | 3 ++-
scripts/docs/templates/common.template.html | 9 +++++++++
scripts/docs/templates/native_menu.template.html | 8 ++------
src/@ionic-native/plugins/admob/index.ts | 2 +-
src/@ionic-native/plugins/native-keyboard/index.ts | 4 +---
6 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/scripts/docs/processors/jekyll.js b/scripts/docs/processors/jekyll.js
index 6b889f455..edf9ba9ee 100644
--- a/scripts/docs/processors/jekyll.js
+++ b/scripts/docs/processors/jekyll.js
@@ -24,6 +24,18 @@ module.exports = function jekyll(renderDocsProcessor) {
.replace('content/', '');
});
+ const betaDocs = [];
+
+ docs = docs.filter(doc => {
+ if (doc.beta === true) {
+ betaDocs.push(doc);
+ return false;
+ }
+ return true;
+ });
+
+ docs = docs.concat(betaDocs);
+
// add side menu
docs.push({
docType: 'nativeMenu',
diff --git a/scripts/docs/tag-defs/tag-defs.js b/scripts/docs/tag-defs/tag-defs.js
index 5a40ba412..d311b2dff 100644
--- a/scripts/docs/tag-defs/tag-defs.js
+++ b/scripts/docs/tag-defs/tag-defs.js
@@ -6,5 +6,6 @@ module.exports = [
{'name': 'usage'},
{'name': 'hidden'}, // hide from docs
{'name': 'classes'}, // related classes
- {'name': 'interfaces'} // related interfaces
+ {'name': 'interfaces'}, // related interfaces
+ {'name': 'paid', transforms: (doc, tag, value) => typeof value !== 'undefined'} // paid plugin, set value to true
];
diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html
index 9a9b1826f..60824ecc3 100644
--- a/scripts/docs/templates/common.template.html
+++ b/scripts/docs/templates/common.template.html
@@ -147,6 +147,9 @@ docType: "<$ doc.docType $>"
<@- if doc.beta == true -@>
β
<@- endif -@>
+ <@- if doc.paid == true -@>
+ Paid
+ <@- endif -@>
@@ -163,6 +166,12 @@ docType: "<$ doc.docType $>"
href="<$ prop.repo $>/issues">plugin repo.
<@ endif @>
+<@ if doc.paid == true @>
+
+ This plugin might require a paid license, or might take a share of your app's earnings.
+ Check the plugin's repo for more information.
+
+<@ endif @>
<# --- Plugin description --- #>
<$ doc.description | marked $>
diff --git a/scripts/docs/templates/native_menu.template.html b/scripts/docs/templates/native_menu.template.html
index 2dcd6c16e..aa9ca3d7b 100644
--- a/scripts/docs/templates/native_menu.template.html
+++ b/scripts/docs/templates/native_menu.template.html
@@ -4,11 +4,7 @@
Browser Usage
-<@- for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
+<@- for doc in docs @><@ if doc.URL and doc.private != true @>
- <$ doc.name $>
-<@ endif @><@ endfor @>
-<@- for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
-
- <$ doc.name $> β
+ <$ doc.name $> <@ if doc.paid == true @>Paid<@ endif @><@ if doc.beta == true @>β<@ endif @>
<@ endif @><@ endfor @>
diff --git a/src/@ionic-native/plugins/admob/index.ts b/src/@ionic-native/plugins/admob/index.ts
index 527f733dd..ee193bb58 100644
--- a/src/@ionic-native/plugins/admob/index.ts
+++ b/src/@ionic-native/plugins/admob/index.ts
@@ -90,11 +90,11 @@ export interface AdExtras {
}
/**
+ * @paid
* @name AdMob
* @description
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
*
- * IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMob Free](../admob-free).
* @usage
* ```typescript
* import { AdMob } from '@ionic-native/admob';
diff --git a/src/@ionic-native/plugins/native-keyboard/index.ts b/src/@ionic-native/plugins/native-keyboard/index.ts
index c4d491286..ea070c564 100644
--- a/src/@ionic-native/plugins/native-keyboard/index.ts
+++ b/src/@ionic-native/plugins/native-keyboard/index.ts
@@ -172,14 +172,12 @@ export interface NativeKeyboardUpdateMessengerOptions {
}
/**
+ * @paid
* @name Native Keyboard
* @description
* A cross platform WhatsApp / Messenger / Slack -style keyboard even. For your Cordova app.
*
*
- * IMPORTANT NOTICE: this plugin is paid, please read more about this at the [plugin's repo](https://github.com/EddyVerbruggen/cordova-plugin-native-keyboard#i-like-it-hook-me-up).
- *
- *
* @usage
* ```
* import { NativeKeyboard } from '@ionic-native/native-keyboard';