From 4e2bdf9757413c5c13eeff7cb997c31b5d5643fe Mon Sep 17 00:00:00 2001 From: Heejin Date: Sat, 30 Apr 2016 21:35:02 +0900 Subject: [PATCH] Update docs for v0.3.0 --- docs/package-json-format.md | 4 ++-- docs/plugin-context-app.md | 20 +++++++++++++------- docs/plugin-context.md | 1 + docs/plugin-docs.md | 8 +++----- docs/preferences-json-format.md | 27 ++++++++++++++++++++++++++- 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/docs/package-json-format.md b/docs/package-json-format.md index 2241d41e..472028e4 100644 --- a/docs/package-json-format.md +++ b/docs/package-json-format.md @@ -13,7 +13,7 @@ All plugin configurations must be located in package.json - `group` String - Default result group name (optional, default is `name` value) **And...** -* `keywords` Array\ - Add Base API version `hain-0.1.0` for sharing your plugin (**required**) +* `keywords` Array\ - Add Base API version `hain-0.3.0` for sharing your plugin (**required**) @@ -23,7 +23,7 @@ All plugin configurations must be located in package.json "name": "hain-plugin-google", "version": "0.0.1", "keywords": [ - "hain-0.1.0" + "hain-0.3.0" ], "hain": { "prefix": "/g", diff --git a/docs/plugin-context-app.md b/docs/plugin-context-app.md index d07852f4..58e67331 100644 --- a/docs/plugin-context-app.md +++ b/docs/plugin-context-app.md @@ -7,19 +7,25 @@ App object has following functions: * **quit()** Quit the app - + +* **open(query)** + - `query` String - Query text (optional, default is `undefined`) + + Open the window with new Query + * **close(dontRestoreFocus)** - `dontRestoreFocus` Boolean - if true, Hain doesn't focus previous focused window (optional, default is `false`) - Close the open window + Close the window -* **setInput(text)** - - `text` String - New input(query) (**required**) +* **setQuery(query)** + - `query` String - Query text (**required**) - Change user input (similar with `redirect` property in `SearchResult`) - -* **openPreferences()** + Change query (similar with `redirect` property in `SearchResult`) +* **openPreferences(prefId)** + - `prefId` String - Opening Preferences Id (PackageName for Plugin) (optional, default is `undefined`) + Open preferences window **Example** diff --git a/docs/plugin-context.md b/docs/plugin-context.md index c9addfcd..d0484005 100644 --- a/docs/plugin-context.md +++ b/docs/plugin-context.md @@ -16,6 +16,7 @@ PluginContext is a object which has following properties: * `toast` [Toast](plugin-context-toast.md) - Provides toast functionality * `shell` [Shell](plugin-context-shell.md) - Provides electron's shell commands * `logger` [Logger](plugin-context-logger.md) - Provides logging functionality +* `localStorage` [node-persist Object](https://github.com/simonlast/node-persist) - Provides a storage for each plugins **Preference Objects:** * `globalPreferences` [PreferencesObject](preferences-object.md) - Contains Global preferences diff --git a/docs/plugin-docs.md b/docs/plugin-docs.md index eaf7250d..02c713e8 100644 --- a/docs/plugin-docs.md +++ b/docs/plugin-docs.md @@ -1,6 +1,6 @@ # Plugin Documentation (working) -Current API Version: `hain-0.1.0` +Current API Version: `hain-0.3.0` ## Examples @@ -37,7 +37,6 @@ Current API Version: `hain-0.1.0` ## Guides * [Plugin Directories](plugin-directories.md) -* Run your plugins * [Share your plugins](share-your-plugins.md) ## API Reference @@ -56,6 +55,5 @@ Current API Version: `hain-0.1.0` * [Icon URL Format](icon-url-format.md) * [Text Format](text-format.md) -## Very Important Notice - -* You should avoid to use `console.log` in your plugin or plugin process would be break. Instead, you can use `PluginContext.Logger`. (for unknown reason) +## Known Issues +- You should avoid to use `console.log` in your plugin or plugin process would be break. Instead, you can use `PluginContext.Logger`. (for unknown reason) diff --git a/docs/preferences-json-format.md b/docs/preferences-json-format.md index 8ec74ce7..d5892197 100644 --- a/docs/preferences-json-format.md +++ b/docs/preferences-json-format.md @@ -58,11 +58,36 @@ module.exports = (pluginContext) => { ``` See [PreferencesObject](preferences-object.md) +## Non-Standard Options + +* **errorMessages** + You can customize displaying error messages to what you want + + **Example** + ```json + { + "type": "string", + "minLength": 3, + "errorMessages": "This is error!" + } + ``` + or + ```json + { + "type": "string", + "minLength": 3, + "maxLength": 5, + "errorMessages": { + "minLength": "This is Error for minLength", + "maxLength": "This is Error for maxLength" + } + } + ``` + ## Limitations Currently, Type of root object must be `object`. - ## Related Docs * [Plugin Skeleton](plugin-skeleton.md) * [PreferencesObject](preferences-object.md) \ No newline at end of file