Add some documentation about plugin manager

This commit is contained in:
Zachary Yedidia 2016-10-05 18:26:41 -04:00
parent d3d35bd9ff
commit 921b828afb
4 changed files with 74 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ Here are the possible commands that you can use.
* `replace "search" "value" flags`: This will replace `search` with `value`.
The `flags` are optional.
At this point, there is only one flag: `c`, which enables `check` mode
which asks if you'd like to perform the replacement each time
which asks if you'd like to perform the replacement each time.
Note that `search` must be a valid regex. If one of the arguments
does not have any spaces in it, you may omit the quotes.
@ -35,14 +35,29 @@ Here are the possible commands that you can use.
keybindings above for more info about what keys and actions are available.
* `vsplit filename`: opens a vertical split with `filename`. If no filename is
provided, a vertical split is opened with an empty buffer
provided, a vertical split is opened with an empty buffer.
* `hsplit filename`: same as `vsplit` but opens a horizontal split instead of
a vertical split
a vertical split.
* `tab filename`: opens the given file in a new tab.
* `log`: opens a log of all messages and debug statements
* `log`: opens a log of all messages and debug statements.
* `plugin install plugin_name`: installs the given plugin.
* `plugin remove plugin_name`: removes the given plugin.
* `plugin list`: lists all installed plugins.
* `plugin update`: updates all installed plugins.
* `plugin search plugin_name`: searches for the given plugin.
Note that you can find a list of all available plugins at
github.com/micro-editor/plugin-channel.
You can also see more information about the plugin manager
in the `Plugin Manager` section of the `plugins` help topic.
---

View File

@ -94,12 +94,25 @@ Here are the options that you can set:
default value: `2`
* `autosave`: micro will save the buffer every 8 seconds automatically.
Micro also will automatically save and quit when you exit without asking.
Be careful when using this feature, because you might accidentally save a file,
overwriting what was there before.
Micro also will automatically save and quit when you exit without asking.
Be careful when using this feature, because you might accidentally save a file,
overwriting what was there before.
default value: `off`
* `pluginchannels`: contains all the channels micro's plugin manager will search
for plugins in. A channel is simply a list of 'repository' json files which contain
metadata about the given plugin. See the `Plugin Manager` section of the `plugins` help topic
for more information.
default value: `https://github.com/micro-editor/plugin-channel`
* `pluginrepos`: contains all the 'repositories' micro's plugin manager will search for
plugins in. A repository consists of a `repo.json` file which contains metadata for a
single plugin.
default value: ` `
---
Default plugin options:

View File

@ -164,3 +164,39 @@ MakeCommand("foo", "example.foo", MakeCompletion("example.complete"))
For examples of plugins, see the default plugins `linter`, `go`, and `autoclose`.
They are stored in Micro's GitHub repository [here](https://github.com/zyedidia/micro/tree/master/runtime/plugins).
# Plugin Manager
Micro also has a built in plugin manager which you can invoke with the `> plugin ...` command.
For the valid commands you can use, see the `command` help topic.
The manager fetches plugins from the channels (which is simply a list of plugin metadata)
which it knows about. By default, micro only knows about the official channel which is located
at github.com/micro-editor/plugin-channel but you can add your own third-party channels using
the `pluginchannels` option and you can directly link third-party plugins to allow installation
through the plugin manager with the `pluginrepos` option.
If you'd like to publish a plugin you've made as an official plugin, you should upload your
plugin online (to Github preferably) and add a `repo.json` file. This file will contain the
metadata for your plugin. Here is an example:
```json
[{
"Name": "pluginname",
"Description": "Here is a nice concise description of my plugin",
"Tags": ["python", "linting"],
"Versions": [
{
"Version": "1.0.0",
"Url": "https://github.com/user/plugin/archive/v1.0.0.zip",
"Require": {
"micro": ">=1.0.3"
}
}
]
}]
```
Then open a pull request at github.com/micro-editor/plugin-channel adding a link to the
raw `repo.json` that is in your plugin repository.