From acce821044f42724b76b32a8940bbda9cac7699a Mon Sep 17 00:00:00 2001 From: Samuel Imolorhe Date: Sat, 2 May 2020 17:44:59 +0200 Subject: [PATCH] Updated docs for plugin and theme --- docs/docs/features/settings-pane.md | 12 ++++++++++-- docs/docs/features/theme-customization.md | 2 +- docs/docs/plugins/writing-plugin.md | 24 +---------------------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/docs/docs/features/settings-pane.md b/docs/docs/features/settings-pane.md index d5b3bda3c9..4f52b55f29 100644 --- a/docs/docs/features/settings-pane.md +++ b/docs/docs/features/settings-pane.md @@ -18,7 +18,7 @@ A settings modal is available in the app to allow you customize all the various The available options are listed here: ### `theme` - Specifies the theme -Options include `light`, `dark`, `dracula`. +Options include `light`, `dark`, `dracula`, `system`. ### `language` - Specifies the language The options are any of the valid language codes according to: [https://support.crowdin.com/api/language-codes/](https://support.crowdin.com/api/language-codes/). @@ -45,4 +45,12 @@ _Default: false_ _Default: false_ ### `plugin.list` - Specifies a list of enabled plugins (requires enableExperimental to be true) -_Default: []_ \ No newline at end of file +_Default: []_ +Plugins are specified in a string format `:@::[]->[]`: + +- `` _(Optional)_ specifies the source of the plugin. Options include `npm`, `url`, `github`. +- `` **_Required_** specifies the name of the plugin. Plugin names must begin with `altair-graphql-plugin-`. +- `` _(Optional)_ specifies the version of the plugin. +- `[]->[]` _(Optional)_ specifies an extran option for the plugin. This is used when you specify the source as `url`. In that case, you need to specify the URL where the plugin would be sourced from. + +Valid plugins in string format include: `altair-graphql-plugin-some-plugin`, `npm:altair-graphql-plugin-some-plugin`, `npm:altair-graphql-plugin-some-plugin@0.3.4`, `url:altair-graphql-plugin-some-plugin@0.3.4::[url]->[http://example.com/some-plugin]` diff --git a/docs/docs/features/theme-customization.md b/docs/docs/features/theme-customization.md index 6b9513a029..130ee8a3e2 100644 --- a/docs/docs/features/theme-customization.md +++ b/docs/docs/features/theme-customization.md @@ -4,4 +4,4 @@ parent: Features ## Multiple Themes -You can use Altair with either the light or dark, or dracula theme, depending on which theme you like. *Support for custom theme is coming very soon*. \ No newline at end of file +You can use Altair with either the system, light or dark, or dracula theme, depending on which theme you like. *Support for custom theme is coming very soon*. \ No newline at end of file diff --git a/docs/docs/plugins/writing-plugin.md b/docs/docs/plugins/writing-plugin.md index 633a6f4a13..132a3302e3 100644 --- a/docs/docs/plugins/writing-plugin.md +++ b/docs/docs/plugins/writing-plugin.md @@ -37,29 +37,7 @@ The manifest.json file has the following fields: #### Developing Plugins Locally -To write a plugin for Altair in local development, you would need to clone the [Altair repository](https://github.com/imolorhe/altair), navigate to the `packages/altair-app` directory, run `yarn` to install dependencies, then `yarn start` to launch the local development server for Altair. You can access the instance of Altair at `http://localhost:4200/`. - -Now go to `packages/altair-app/src/app/containers/app/app.component.ts` file and you should see a comment similar to the one below: - -```ts -// this.pluginRegistry.fetchPlugin('altair-graphql-plugin-birdseye', { -// pluginSource: 'url', -// version: '0.0.4', -// url: 'http://localhost:8002/' -// }); -``` - -You can uncomment those lines and replace the values according to your local plugin setup. For example, if working on a plugin called `altair-graphql-plugin-some-plugin`, hosted on `http://localhost:8080/`, you would have the following: - -```ts -this.pluginRegistry.fetchPlugin('altair-graphql-plugin-some-plugin', { - pluginSource: 'url', - version: '0.0.1', - url: 'http://localhost:8080/' -}); -``` - -After these, ensure you have `enableExperimental` option set to `true` in the settings pane, and restart the Altair app. +Ensure you have at least version 2.4.7 of Altair installed, and you have `enableExperimental` option set to `true` in the settings pane. In the `plugin.list` in the settings pane, specify your local plugin following this pattern `url:altair-graphql-plugin-some-plugin@0.0.1::[url]->[http://localhost:8080]`. In this example, you are working on a plugin called `altair-graphql-plugin-some-plugin`, hosted on `http://localhost:8080/` (version is optional). ### Sidebar Plugins