diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 66e0e836..4930aef0 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -319,6 +319,7 @@ func main() { // Extension Files L.SetGlobal("ReadRuntimeFile", luar.New(L, PluginReadRuntimeFile)) L.SetGlobal("ListRuntimeFiles", luar.New(L, PluginListRuntimeFiles)) + L.SetGlobal("AddRuntimeFile", luar.New(L, PluginAddRuntimeFile)) LoadPlugins() diff --git a/cmd/micro/plugin.go b/cmd/micro/plugin.go index 6594e276..e728c3dd 100644 --- a/cmd/micro/plugin.go +++ b/cmd/micro/plugin.go @@ -137,8 +137,6 @@ func LoadPlugins() { continue } loadedPlugins = append(loadedPlugins, pluginName) - } else if f.Name() == "help.md" { - AddRuntimeFile(FILE_Help, namedFile{realFile(fullPath), pluginName}) } } } diff --git a/cmd/micro/rtfiles.go b/cmd/micro/rtfiles.go index 5466b548..5b0f51da 100644 --- a/cmd/micro/rtfiles.go +++ b/cmd/micro/rtfiles.go @@ -2,6 +2,7 @@ package main import ( "io/ioutil" + "os" "path" "path/filepath" ) @@ -142,3 +143,13 @@ func PluginListRuntimeFiles(fileType string) []string { } return result } + +func PluginAddRuntimeFile(plugin, filetype, path string) { + fullpath := configDir + "/plugins/" + plugin + "/" + path + if _, err := os.Stat(fullpath); err == nil { + AddRuntimeFile(filetype, realFile(fullpath)) + } else { + fullpath = "runtime/plugins/" + plugin + "/" + path + AddRuntimeFile(filetype, assetFile(fullpath)) + } +} diff --git a/cmd/micro/runtime.go b/cmd/micro/runtime.go index 2ae39567..35057a3c 100644 --- a/cmd/micro/runtime.go +++ b/cmd/micro/runtime.go @@ -481,7 +481,7 @@ func runtimeHelpOptionsMd() (*asset, error) { return a, nil } -var _runtimeHelpPluginsMd = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x58\x5b\x8f\xdc\xb6\x92\x7e\xd7\xaf\x28\x4c\x1e\xd2\x1d\x74\x34\xd9\xd7\x06\xfc\x60\x7b\x13\x3b\xd9\xc4\x0e\x30\x93\x0d\x82\xc5\x02\x2c\x49\xa5\x16\x33\x14\xa9\xc3\x4b\xb7\xfb\x04\x39\xbf\xfd\xa0\x8a\xd4\xa5\xc7\x93\xe0\x18\x30\x46\x2d\x91\x75\xf9\x58\x97\xaf\xf8\x05\xfc\x6c\xd2\x49\xdb\x50\x55\x3f\xe9\xd6\x3b\x08\x69\x9a\x9c\x8f\x01\x5a\x4f\x18\xb5\x3d\xc1\x94\x17\xc0\x45\xc7\x01\x10\x82\x1e\x27\x43\xf0\x63\x42\x08\xd7\x10\x69\xac\xe1\xdb\x33\xf9\x6b\x59\x07\x03\x06\xc0\x6a\x44\x6d\x21\xb4\x5e\x4f\x11\x2e\x83\x6e\x07\xd0\x01\x7c\xb2\x80\x11\x42\x44\x1f\xd3\x54\xde\x87\xc1\x25\xd3\x41\x43\x30\x19\x6c\xa9\x03\x6d\xa1\x52\xff\xba\xaf\x5b\x67\x7b\x7d\xba\x1f\xd9\xac\xfb\x62\x44\xf9\xfb\x01\x47\xda\x3c\xd6\x26\xa1\xaa\xab\xea\x71\x20\x4f\x80\xfc\x1f\x6c\x1a\x1b\xf2\xe0\x7a\x68\xd1\x98\x06\xdb\x27\xe8\x93\x6d\xa3\x76\xec\x8a\x68\xbe\xba\x04\x2d\xda\xec\x29\xb1\xde\xab\x4b\xbe\x2a\x7e\x44\x27\xf6\xb6\xae\x23\x36\x3a\xea\x91\x02\xb8\x38\x90\x87\x38\xa0\x9d\xbd\xa8\xe1\x71\x20\xb0\x38\x32\x54\xa1\x1d\x68\x24\xd0\xa1\x52\xce\xbe\x16\x65\xbb\xb3\xa6\xcb\x5e\xd5\xf0\x9d\xf3\x40\x9f\x50\xc0\xc3\xc5\x96\x5b\x70\x48\x80\x64\x55\x10\x07\x82\x14\xc8\x43\xc0\x33\x85\x8a\x7f\x36\xa9\xef\xc9\xc3\xa5\xe0\x75\xac\x2a\xa5\x94\x49\x58\x2d\xc2\x9c\x7d\xc0\x33\x65\x95\x15\x00\x40\x5d\xd7\xf2\xd7\x53\x4c\xde\x42\x8f\x26\x50\x45\xb6\xe3\x9d\x82\x17\x28\x5e\xac\xe0\x8c\x5e\x63\x63\xd8\x76\x40\xf0\xd4\x93\x27\xdb\x12\xa3\xc0\xaa\x79\x91\x3c\x60\x56\xa4\x03\x34\xc4\x1e\xd3\x27\x6a\x53\xa4\x0e\x9c\xad\xab\xc7\x41\x07\x11\x60\x46\x17\x22\xa0\xb9\xe0\x35\xc8\xb6\x36\x79\x4f\x36\x8a\x9c\xc3\x33\xf8\x4f\x14\x73\x6c\xa9\xb7\xc9\xff\xaf\xa6\xcb\x6e\xaf\x00\x03\x5c\xc8\x98\xba\xaa\x5e\x1b\x03\x78\x46\x6d\xc4\x3c\x2c\x27\xc8\x87\x6c\x74\x88\x39\x5e\x58\xc5\x13\x5d\x1b\x6d\x3b\x6d\x4f\x01\x02\x15\x3c\x7a\xf9\x34\x90\x99\x72\x78\x04\xda\x44\x41\x89\x3c\x34\xc1\xcd\x00\x21\x34\xce\x19\xe2\xe3\x9d\xa8\xd5\xfd\x95\x7d\xbc\x0c\x54\x8e\x3d\x03\x51\xad\x21\xeb\xc9\xb8\x16\xd9\x8a\x02\x54\x9b\x7c\x70\x1e\x9c\x07\xeb\x22\x60\x1f\xcb\xbe\x15\xb7\xd6\x71\x08\x44\xaa\xab\xea\x83\x8b\x7c\xd0\x1c\x5d\x62\xda\x1c\xa9\x01\x5c\xdb\x26\xff\xf9\x76\xce\xad\x86\xc8\x2e\x42\xba\x1a\xbe\xef\x19\xc9\xea\x82\x36\x02\xae\xc1\xde\x50\xef\x3c\x3d\xd3\x3d\x9f\xd6\x81\x43\x0b\xd4\xe4\xa9\x04\x29\x07\xe8\xf7\x8c\x23\x1b\x88\x81\x72\xbc\x15\x28\x32\x36\xd4\x15\x4c\x34\x85\x05\x92\xe2\xe7\x46\xcb\x8a\xcd\xac\xac\x5a\xdd\x30\x09\x73\x42\xcd\xf6\x07\x3e\x60\x9b\xb3\x2a\x05\xea\x93\x59\x3d\x88\x0e\x9e\xac\xbb\x00\x36\x2e\x6d\x8a\x88\xe0\xba\xfa\xc4\x99\xc6\x41\xf3\x71\xa2\x39\xd7\xd6\xb5\x2c\x8b\x3a\xb6\xd6\x72\x6a\x71\x59\xa0\x4b\x0e\x66\x1d\xc0\x4d\xc4\x5e\xa1\xed\xc4\x38\x4b\x97\x6a\xfe\x34\x61\x08\x12\x5a\x9c\xde\x39\xa8\x8b\x79\xbd\xf3\x10\x28\x4a\x65\xe4\xb3\x37\xe0\xa6\x1c\x4e\x0d\x06\xc9\x03\x11\xd6\x6b\x43\xf1\x3a\xd1\xa1\xea\x37\x79\xcf\x38\xf2\x46\xd7\xf7\xa0\x22\x36\x21\xba\x30\x61\x4b\x41\x81\xb3\xe6\x2a\xc2\xdf\x39\xd9\x2c\x18\x8b\xac\xab\x04\x7b\x36\xb6\xae\xaa\xaf\xbf\xfe\xfa\xaf\x2a\xdd\x1a\xda\xec\xd3\x9c\xd2\x21\x87\x98\x2c\x5e\xf2\x28\x3a\xc9\x3f\x6d\x2b\xe7\x3b\x3e\x1d\x07\xd8\xb6\x14\x72\xba\x6a\x6b\xa5\xd0\xf8\x27\x49\x27\xd7\x83\x54\xe1\x1a\xde\xb3\x5a\x29\x11\x9c\x7c\xb0\xe3\xc5\xec\x26\x04\x7d\xb2\x18\x93\xa7\x20\x0e\x6f\x2c\xf1\x04\x27\x7d\x26\x0b\x29\xb0\xeb\xef\xdc\x97\xa1\x6c\x91\xee\xb1\x3f\x56\xd5\x57\xa0\x3e\x3e\xa8\xe3\x5a\x84\xf2\x01\xf2\xb6\x6c\xcf\xc7\x87\x6c\x80\x9c\x69\x2e\x25\xe6\xca\x15\x33\xa3\x69\xd9\x90\x7c\x4a\xbc\x3a\xe0\x48\x15\x86\xac\xea\xdd\xc7\x8f\x0f\x8b\xe0\x03\x04\x07\xaa\x43\x7f\xd1\x56\x1d\x40\x5d\xb4\xed\xdc\x25\xf0\xa3\xd1\x36\x7d\xe2\x87\xde\x13\x35\xa1\x53\x75\x5d\xef\xc5\x34\x3e\x27\x75\x9c\x5d\x76\x3d\xa0\x31\xa2\x87\x3f\x6c\xcc\xd1\xec\x22\xc9\x96\x36\xf9\x47\x6c\xd4\xb1\x80\xd9\xd1\xa7\xb9\x14\xcd\x85\x50\xf6\x96\xca\x25\xcf\x2c\x5c\xf6\x8e\x14\x02\xd9\x13\x79\x75\x04\x43\x31\xc8\x39\x05\xb2\x1d\xf0\x17\x3c\x31\x24\x6e\x6d\x0f\xce\xcf\xfd\x6b\xf2\x6e\x9c\x62\x10\x21\xef\x28\x7e\x94\xb0\xdc\x59\x1c\x09\x42\xf4\xda\x9e\xf6\xea\x58\x72\x39\xe3\x74\x46\x93\x68\x36\xcc\xd3\x3f\x12\x49\x3d\xcd\xf1\x2c\x62\x5e\x77\xdd\xe7\x62\x0e\x65\xa3\xb6\x91\x7c\x8f\x2d\xfd\xf1\x27\x4b\x0e\x6c\x2b\x4b\xca\xa7\x9d\xa5\xe4\xc2\xbe\xbc\xe5\x5e\x94\x37\xef\xd4\x66\xbb\x82\x91\x50\xa2\xf6\x9a\x43\x43\x5b\x78\xe7\x32\xfa\x0f\x8b\x27\x59\xe2\xac\x7d\x75\xe9\x65\xc5\x73\xe3\xe2\xc5\x25\x89\x2f\xda\x18\xb6\x20\x50\xae\x58\x65\xe5\xc9\xb8\x06\x8d\xb9\x1e\x20\x59\xc3\x19\xa0\x63\x09\xf1\x9c\xde\x9c\x98\x79\x69\x3d\x5b\xf4\x23\x7f\xf9\x1b\xb3\x0e\x73\xaf\xfe\xea\x8d\xfc\xfd\x3b\x33\xd9\xa2\xf5\x34\x44\x67\x0e\xa6\x75\x6d\x16\x26\xca\xdf\x68\xdb\xfd\x0f\x5d\x77\x4f\x74\x3d\x2c\x25\x77\x81\x82\x1b\x60\x00\xf5\x44\x57\xc5\x00\xa8\xbc\x40\xc9\xce\x9f\xf0\x89\xde\xba\x71\x44\xdb\xc9\x69\x1e\x56\x0e\x32\x1b\x5d\xaa\xb2\xe4\x6d\x5d\xd7\x6f\x97\x9f\x2c\x9b\xed\xcc\x91\xc6\xd8\xb4\x59\x52\x69\xdc\x2c\x6f\x2e\xbb\x8c\xb2\x14\x5e\x50\xb3\x02\x95\x6b\xd9\xdc\x10\x84\x92\xfc\x12\x08\xbe\x91\x82\xb7\xd5\x1a\x9d\xd0\x81\x0f\x6e\xd5\x5d\x6f\xad\x2f\xef\x76\xcf\x4c\xdf\xab\xe3\xad\x79\x6a\x5d\x2b\x48\x70\xbb\xcb\xa6\x6e\x60\xc8\xb8\xac\xa4\xe3\x36\x3b\xb6\x94\x45\x16\xbe\x47\xdb\x99\x05\xc2\x76\xec\xb6\x69\x95\xec\xf6\x70\x0b\x3a\x9b\x6d\x0f\x03\x19\x33\xef\x0d\xf2\x63\x11\x70\xc8\xa9\xc4\x87\x75\xce\x5d\xf7\x00\x17\xd4\xf1\xd1\xbd\x35\x2e\xe4\x37\x2f\x28\x11\x29\xe2\x76\x16\x9b\x99\xa8\xda\xc8\x52\xb2\xf5\x85\xb6\x2d\xfe\x95\x13\x2c\x0d\x9b\xe9\x67\x09\x3a\xee\xbe\x27\xef\x52\x11\xc9\x2a\xd4\xc6\x9e\x22\x55\xf2\x02\xa7\xc9\xb0\x60\xdd\x3f\x53\xcc\xa5\xd8\x27\x92\x46\x94\x93\x5b\x9a\x90\x8e\xb3\x3e\x16\x58\x48\x4a\xb5\x10\x54\xae\xe6\x25\x71\xa9\xd3\xd1\xf9\x7c\xf8\x3f\xb8\xe6\x81\xd9\xf6\x06\xf4\x03\x73\xdd\xd8\xb9\x14\xcb\x13\x79\xcf\x4f\xdf\x7e\x62\x15\x65\x09\x17\x48\xf4\x27\x09\xe6\x9b\x40\x11\x69\x61\x69\x20\xcf\x30\x5d\xa0\x79\x01\x0f\x35\xab\x55\xe5\x91\xbc\x57\xe2\xa5\xca\xca\x15\xcb\xe7\xa6\xb7\x92\xb9\xe8\x84\xf8\x3c\x1f\x3f\x24\x51\x1a\xda\x92\x94\x8d\x25\x33\xd1\x1d\x70\x9a\x72\xe1\x2c\xc0\xac\xd6\x70\xc5\xe7\x96\x2d\xf9\xa4\x66\x67\x95\x68\x17\x46\xe6\x4f\x69\x24\x1b\x6f\x14\x72\x7a\x15\x76\x33\x53\xd6\xcf\xe6\xa3\x05\x74\x2a\x81\xfe\x15\xa7\x6e\xfd\x76\xec\x0e\xd0\x61\xc4\x9b\xe2\x6b\x3b\x98\x5f\x70\x1c\x67\x99\x21\x76\x7a\xa1\xdf\xbf\xbb\x66\x36\x75\x3d\x4e\x37\xdd\x4a\x66\x61\x4f\x6c\x20\xf2\xfa\x2a\xcf\x12\x23\x5e\x21\x10\x8d\x60\xf4\x13\x53\x9d\x30\x72\x5d\x59\xfa\xf0\xc2\x66\x56\x68\x9b\x14\x21\xb8\x71\x69\x6b\xae\xf9\x9d\xda\x18\xaa\x85\xc3\x36\xd7\xcc\xcf\x96\x1d\x03\x9e\x09\x46\x6e\x3d\x23\xc5\xc1\x75\xa1\xbe\x19\x44\xe6\x92\x80\x99\x36\x66\x79\x55\x06\x54\x46\xdd\x42\x06\xf0\xe5\xd1\x12\x8d\xb9\x1d\xfd\x56\xd9\x47\x99\xd5\x64\x24\xdb\xab\xba\xfa\xad\x6c\x09\x44\xc5\xc2\x8d\xab\x93\x0b\x41\x6f\xe7\x9f\x17\x86\x1e\x9e\x72\x20\xba\x49\xb7\xb5\x4c\x76\x33\x7d\x77\xf6\x33\x23\x79\x4b\x2b\xa5\xf2\x05\x22\x2f\x24\x7d\x09\xde\x9c\xae\x15\xcf\x3a\xc9\xd6\xf0\x7d\x19\x3f\x3d\x71\x92\xf0\xe1\x9f\xc8\x92\x97\x9e\x15\xa2\x6e\x9f\x4a\x0a\x8b\x5b\x39\xa6\x47\x94\x97\x08\xcb\x60\x5d\xe1\xd9\x69\x91\x91\x7c\xe0\x9a\x37\x79\xd7\x18\x1a\xc3\x01\xb6\x6c\x59\xf7\x05\x47\xee\x25\xcf\x60\xe3\xe2\xb2\x57\x0c\x83\x2a\x43\x2f\x63\xf8\x43\x0a\x31\x8f\x36\x2f\xa3\xcc\xf4\x6f\xae\x43\x17\x67\xbf\x8c\x45\xf8\x22\x02\xf0\x84\x9a\x5b\xce\x2f\x61\x2e\x0c\x9b\x63\x3f\x2c\xe7\x2a\x33\xe3\x86\x30\x97\x76\x8f\x21\xb8\x56\xcb\x3c\x58\x88\x0f\x96\x06\xd2\x5c\x0b\xff\x5d\x2d\xab\xdf\xa4\x5e\xcd\xc3\xf0\xc2\xf4\x36\x42\xd5\x77\xda\xd0\xe3\x75\x22\xa6\xa5\x3f\x63\x1c\xf8\xef\x07\x6e\xb5\x3c\xd6\xcb\x19\x2f\x71\x51\x62\xf7\x85\xf0\x2b\x7a\x45\xe0\xca\x2d\x57\xae\x8d\x9e\x8e\xb7\xc4\xb3\xfe\x29\x13\xcd\xdd\x18\x4e\x5c\x3a\x6f\x88\xde\xed\xca\x6f\xbd\x77\xfe\x3f\x58\xf7\x1b\x85\x0f\xee\x67\x21\xa8\xbb\xcc\x53\xe7\x1a\x02\xbb\xdc\xf0\x72\x93\xbb\xdd\x75\xb3\xe1\x00\x83\x0e\xd1\xf9\xeb\xa3\x0c\x0f\x9f\x51\x16\x79\xbd\xa1\x2c\xb0\x5b\xb8\x58\x16\x5d\xe5\x49\x19\xca\xa4\x1c\x22\xda\x0e\x7d\x07\xb3\xf8\xdf\x97\xe0\xf9\x4b\x0b\xee\xee\x0e\xf0\x0d\x8b\xfa\x02\x5e\xa7\xe8\xe6\x29\x76\x69\x18\x4b\xc5\xad\xaa\x07\x49\x63\x99\xb9\xcb\xec\xe7\xc0\x10\x7a\x0b\x83\xbb\xcc\x94\xe4\x19\xad\x29\x8d\xe4\x96\xa2\x94\x3b\x9e\x4c\x46\x17\xde\x93\x3b\xd8\xaf\x3a\x0e\xbb\x87\xec\xa6\xbc\xd9\x57\xdc\xdc\xa4\x16\xbf\x2a\x0f\xc7\x34\x4d\xe4\x77\xf9\x0b\xfa\x28\x1f\xd0\xc7\xf9\x3d\x13\xbb\x72\xfb\x91\x01\xab\x43\x6a\x66\xa1\xff\x75\x28\xef\x0c\xd9\x5d\xd6\xb0\x7f\xf5\x4a\x1e\xe4\x1a\x69\xbd\x7a\x9a\xb1\xd8\x69\x3b\x25\xb1\x23\x5b\x8c\x42\x7b\x16\x82\xf7\x0a\xfe\xb8\x7b\x4f\xc6\xb8\xbb\x03\xdc\xfd\xea\xbc\xe9\xf8\xe1\x3b\x27\xbf\xdf\xa0\xbf\xfb\x73\xd9\xe9\x29\x24\xc3\xe6\xfe\xc1\xef\xd8\x4c\x2e\x0e\xfa\x70\xe6\xac\x9f\x50\xfb\xb0\xbb\x15\xbe\x87\x8e\xd9\xb4\xee\xb7\xe8\x9c\x99\x5d\xb1\x45\x9c\x01\xd2\x47\xf9\x5f\xe4\xd0\xaf\xb5\x0d\xe4\xe3\x2e\x2b\x3a\xc0\x39\xdf\x99\x01\x3b\xb6\xfe\x29\xd8\xe4\x45\xcf\x9c\xee\x9d\xdb\xa1\x3f\xf1\xbe\x25\x66\x8e\x73\xf6\xc8\x07\x59\xbf\xa5\xde\x77\x7d\xf6\xb5\x84\x45\x9d\x7f\x3e\xa3\xb7\xcb\xd7\x19\xd5\xbb\xfd\x3e\x5f\xd9\x7d\x01\xff\x4d\x3d\x32\x2e\xd3\x7c\x6f\xbb\xe9\x2e\x32\xaa\x97\x0f\x87\xa5\x93\x74\xb7\x3b\x64\xd6\x8d\xe4\xb9\x9a\x9c\x9c\x3a\xe4\xa0\x43\x8e\x67\xa1\x77\xd2\x3d\xf2\xa5\x03\xe7\x5b\xbe\x61\x93\xcb\x61\x1e\xa7\x75\x7c\x9f\x1a\xf0\x34\xb9\xc0\x04\xed\x0a\xff\x37\x90\xa7\xff\xdf\x0d\x31\x4e\xe1\x78\x7f\x7f\xd2\x71\x48\x0d\x1b\x7e\xff\xcf\x2b\x75\xba\xd3\x58\xae\x70\xa3\x27\xba\x1f\x31\x44\xf2\xf7\x3e\xd9\xa8\x97\x3b\xdc\xb0\xaf\xab\x7f\x07\x00\x00\xff\xff\x6d\x20\xae\xb7\x89\x16\x00\x00") +var _runtimeHelpPluginsMd = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x58\xdd\x8f\xdc\xb6\x11\x7f\xd7\x5f\x31\xb8\x3c\x78\x37\xd8\xe8\xd2\xd7\x03\xfc\x60\xbb\x89\x9d\x34\xb1\x83\xde\xa5\x41\x50\x14\xe0\x48\x1a\xad\x98\xa3\x48\x95\x1f\xbb\xde\x1a\xe9\xdf\x5e\xcc\x90\xfa\xd8\xf3\x25\xa8\x01\xe3\xb4\x12\x39\x33\xfc\xcd\xd7\x6f\xf8\x05\xfc\x64\xd2\x51\xdb\x50\x55\x3f\xea\xd6\x3b\x08\x69\x9a\x9c\x8f\x01\x5a\x4f\x18\xb5\x3d\xc2\x94\x17\xc0\x59\xc7\x01\x10\x82\x1e\x27\x43\xf0\x43\x42\x08\x97\x10\x69\xac\xe1\x9b\x13\xf9\x4b\x59\x07\x03\x06\xc0\x6a\x44\x6d\x21\xb4\x5e\x4f\x11\xce\x83\x6e\x07\xd0\x01\x7c\xb2\x80\x11\x42\x44\x1f\xd3\x54\xde\x87\xc1\x25\xd3\x41\x43\x30\x19\x6c\xa9\x03\x6d\xa1\x52\xff\xbd\xad\x5b\x67\x7b\x7d\xbc\x1d\xd9\xac\xdb\x62\x44\xf9\xfb\x1e\x47\xda\x3c\xd6\x26\xa1\xaa\xab\xea\x61\x20\x4f\x80\xfc\x1f\x6c\x1a\x1b\xf2\xe0\x7a\x68\xd1\x98\x06\xdb\x47\xe8\x93\x6d\xa3\x76\x7c\x14\xd1\x7c\x71\x09\x5a\xb4\xf9\xa4\xc4\x7a\x2f\x2e\xf9\xaa\x9c\x23\x3a\xb1\xb7\x75\x1d\xb1\xd1\x51\x8f\x14\xc0\xc5\x81\x3c\xc4\x01\xed\x7c\x8a\x1a\x1e\x06\x02\x8b\x23\x43\x15\xda\x81\x46\x02\x1d\x2a\xe5\xec\x2b\x51\xb6\x3b\x69\x3a\xef\x55\x0d\xdf\x3a\x0f\xf4\x11\x05\x3c\x5c\x6c\xb9\x06\x87\x04\x48\x56\x05\x71\x20\x48\x81\x3c\x04\x3c\x51\xa8\xf8\x67\x93\xfa\x9e\x3c\x9c\x0b\x5e\x77\x55\xa5\x94\x32\x09\xab\x45\x98\xb3\xf7\x78\xa2\xac\xb2\x02\x00\xa8\xeb\x5a\xfe\x7a\x8a\xc9\x5b\xe8\xd1\x04\xaa\xc8\x76\xbc\x53\xf0\x02\xc5\x8b\x15\x9c\xd0\x6b\x6c\x0c\xdb\x0e\x08\x9e\x7a\xf2\x64\x5b\x62\x14\x58\x35\x2f\x92\x07\xcc\x8a\x74\x80\x86\xf8\xc4\xf4\x91\xda\x14\xa9\x03\x67\xeb\xea\x61\xd0\x41\x04\x98\xd1\x85\x08\x68\xce\x78\x09\xb2\xad\x4d\xde\x93\x8d\x22\xe7\xf0\x04\xfe\x23\xc5\x1c\x5b\xea\x4d\xf2\xff\xd0\x74\xde\xed\x15\x60\x80\x33\x19\x53\x57\xd5\x2b\x63\x00\x4f\xa8\x8d\x98\x87\xc5\x83\xec\x64\xa3\x43\xcc\xf1\xc2\x2a\x1e\xe9\xd2\x68\xdb\x69\x7b\x0c\x10\xa8\xe0\xd1\xcb\xa7\x81\xcc\x94\xc3\x23\xd0\x26\x0a\x4a\xe4\xa1\x09\x6e\x06\x08\xa1\x71\xce\x10\xbb\x77\xa2\x56\xf7\x17\x3e\xe3\x79\xa0\xe2\xf6\x0c\x44\xb5\x86\xac\x27\xe3\x5a\x64\x2b\x0a\x50\x6d\xf2\xc1\x79\x70\x1e\xac\x8b\x80\x7d\x2c\xfb\x56\xdc\x5a\xc7\x21\x10\xa9\xae\xaa\xf7\x2e\xb2\xa3\x39\xba\xc4\xb4\x39\x52\x03\xb8\xb6\x4d\xfe\xf3\xed\x9c\x5b\x0d\x91\x5d\x84\x74\x35\x7c\xd7\x33\x92\xd5\x19\x6d\x04\x5c\x83\xbd\xa1\xde\x79\x7a\xa2\x7b\xf6\xd6\x81\x43\x0b\xd4\xe4\xa9\x04\x29\x07\xe8\x77\x8c\x23\x1b\x88\x81\x72\xbc\x15\x28\x32\x36\xd4\x15\x4c\x34\x85\x05\x92\x72\xce\x8d\x96\x15\x9b\x59\x59\xb5\x1e\xc3\x24\xcc\x09\x35\xdb\x1f\xd8\xc1\x36\x67\x55\x0a\xd4\x27\xb3\x9e\x20\x3a\x78\xb4\xee\x0c\xd8\xb8\xb4\x29\x22\x82\xeb\x7a\x26\xce\x34\x0e\x9a\x0f\x13\xcd\xb9\xb6\xae\x65\x59\xd4\xb1\xb5\x96\x53\x8b\xcb\x02\x9d\x73\x30\xeb\x00\x6e\x22\x3e\x15\xda\x4e\x8c\xb3\x74\xae\xe6\x4f\x13\x86\x20\xa1\xc5\xe9\x9d\x83\xba\x98\xd7\x3b\x0f\x81\xa2\x54\x46\xf6\xbd\x01\x37\xe5\x70\x6a\x30\x48\x1e\x88\xb0\x5e\x1b\x8a\x97\x89\x0e\x55\xbf\xc9\x7b\xc6\x91\x37\xba\xbe\x07\x15\xb1\x09\xd1\x85\x09\x5b\x0a\x0a\x9c\x35\x17\x11\xfe\xd6\xc9\x66\xc1\x58\x64\x5d\x24\xd8\xb3\xb1\x75\x55\x7d\xf5\xd5\x57\x7f\x54\xe9\xd6\xd0\xe6\x33\xcd\x29\x1d\x72\x88\xc9\xe2\x25\x8f\xa2\x93\xfc\xd3\xb6\x72\xbe\x63\xef\x38\xc0\xb6\xa5\x90\xd3\x55\x5b\x2b\x85\xc6\x3f\x4a\x3a\xb9\x1e\xa4\x0a\xd7\xf0\x8e\xd5\x4a\x89\xe0\xe4\x83\x1d\x2f\xe6\x63\x42\xd0\x47\x8b\x31\x79\x0a\x72\xe0\x8d\x25\x9e\xe0\xa8\x4f\x64\x21\x05\x3e\xfa\x5b\xf7\x22\x94\x2d\xd2\x3d\xf6\x77\x55\xf5\x25\xa8\x0f\xf7\xea\x6e\x2d\x42\xd9\x81\xbc\x2d\xdb\xf3\xe1\x3e\x1b\x20\x3e\xcd\xa5\xc4\x5c\xb8\x62\x66\x34\x2d\x1b\x92\xbd\xc4\xab\x03\x8e\x54\x61\xc8\xaa\xde\x7e\xf8\x70\xbf\x08\x3e\x40\x70\xa0\x3a\xf4\x67\x6d\xd5\x01\xd4\x59\xdb\xce\x9d\x03\x3f\x1a\x6d\xd3\x47\x7e\xe8\x3d\x51\x13\x3a\x55\xd7\xf5\x5e\x4c\x63\x3f\xa9\xbb\xf9\xc8\xae\x07\x34\x46\xf4\xf0\x87\x8d\x39\x9a\x8f\x48\xb2\xa5\x4d\xfe\x01\x1b\x75\x57\xc0\xec\xe8\xe3\x5c\x8a\xe6\x42\x28\x7b\x4b\xe5\x92\x67\x16\x2e\x7b\x47\x0a\x81\xec\x91\xbc\xba\x03\x43\x31\x88\x9f\x02\xd9\x0e\xf8\x0b\x1e\x19\x12\xb7\xb6\x07\xe7\xe7\xfe\x35\x79\x37\x4e\x31\x88\x90\xb7\x14\x3f\x48\x58\xee\x2c\x8e\x04\x21\x7a\x6d\x8f\x7b\x75\x57\x72\x39\xe3\x74\x42\x93\x68\x36\xcc\xd3\xbf\x13\x49\x3d\xcd\xf1\x2c\x62\x5e\x75\xdd\xe7\x62\x0e\x65\xa3\xb6\x91\x7c\x8f\x2d\x7d\xfa\x9d\x25\x07\xb6\x95\x25\x65\x6f\x67\x29\xb9\xb0\x2f\x6f\xb9\x17\xe5\xcd\x3b\xb5\xd9\xae\x60\x24\x94\xa8\xbd\xe4\xd0\xd0\x16\xde\xba\x8c\xfe\xfd\x72\x92\x2c\x71\xd6\xbe\x1e\xe9\x79\xc5\x73\xe3\xe2\xc5\x25\x89\xcf\xda\x18\xb6\x20\x50\xae\x58\x65\xe5\xd1\xb8\x06\x8d\xb9\x1c\x20\x59\xc3\x19\xa0\x63\x09\xf1\x9c\xde\x9c\x98\x79\x69\x3d\x5b\xf4\x03\x7f\xf9\x13\xb3\x0e\x73\xaf\xfe\xf2\xb5\xfc\xfd\x33\x33\xd9\xa2\xd5\x1b\xa2\x33\x07\xd3\xba\x36\x0b\x13\xe5\xaf\xb5\xed\xfe\x46\x97\xdd\x23\x5d\x0e\x4b\xc9\x5d\xa0\xe0\x06\x18\x40\x3d\xd2\x45\x31\x00\x2a\x2f\x50\xb2\xf3\x47\x7c\xa4\x37\x6e\x1c\xd1\x76\xe2\xcd\xc3\xca\x41\x66\xa3\x4b\x55\x96\xbc\xad\xeb\xfa\xcd\xf2\x93\x65\xb3\x9d\x39\xd2\x18\x9b\x36\x4b\x2a\x8d\x9b\xe5\xcd\x65\x97\x51\x96\xc2\x0b\x6a\x56\xa0\x72\x2d\x9b\x1b\x82\x50\x92\x9f\x03\xc1\xd7\x52\xf0\xb6\x5a\xa3\x13\x3a\xf0\xde\xad\xba\xeb\xad\xf5\xe5\xdd\xee\x89\xe9\x7b\x75\x77\x6d\x9e\x5a\xd7\x0a\x12\xdc\xee\xb2\xa9\x1b\x18\x32\x2e\x2b\xe9\xb8\xce\x8e\x2d\x65\x91\x85\xef\xd0\x76\x66\x81\xb0\x1d\xbb\x6d\x5a\x25\xbb\x75\x6e\x41\x67\xb3\xed\x7e\x20\x63\xe6\xbd\x41\x7e\x2c\x02\x0e\x39\x95\xd8\x59\xa7\xdc\x75\x0f\x70\x46\x1d\x1f\xdc\x1b\xe3\x42\x7e\xf3\x8c\x12\x91\x22\xc7\xce\x62\x33\x13\x55\x1b\x59\x4a\xb6\x3e\xd3\xb6\xe5\x7c\xc5\x83\xa5\x61\x33\xfd\x2c\x41\xc7\xdd\xf7\xe8\x5d\x2a\x22\x59\x85\xda\xd8\x53\xa4\x4a\x5e\xe0\x34\x19\x16\xac\xfb\x27\x8a\xb9\x14\xfb\x44\xd2\x88\x72\x72\x4b\x13\xd2\x71\xd6\xc7\x02\x0b\x49\xa9\x16\x82\xca\xd5\xbc\x24\x2e\x75\x3a\x3a\x9f\x9d\xff\xbd\x6b\xee\x99\x6d\x6f\x40\x3f\x30\xd7\x8d\x9d\x4b\xb1\x3c\x91\xf7\xfc\xf4\xcd\x47\x56\x51\x96\x70\x81\x44\x7f\x94\x60\xbe\x0a\x14\x91\x16\x96\x06\xf2\x04\xd3\x05\x9a\x67\xf0\x50\xb3\x5a\x55\x1e\xc9\x7b\x25\xa7\x54\x59\xb9\x62\xf9\xdc\xf4\x56\x32\x17\x9d\x10\x9f\xa7\xe3\x87\x24\x4a\x43\x5b\x92\xb2\xb1\x64\x26\xba\x03\x4e\x53\x2e\x9c\x05\x98\xd5\x1a\xae\xf8\xdc\xb2\x25\x9f\xd4\x7c\x58\x25\xda\x85\x91\xf9\x63\x1a\xc9\xc6\x2b\x85\x9c\x5e\x85\xdd\xcc\x94\xf5\xb3\xf9\x68\x01\x9d\x4a\xa0\x7f\xc9\xa9\x5b\xbf\x19\xbb\x03\x74\x18\xf1\xaa\xf8\xda\x0e\xe6\x17\x1c\xc7\x59\x66\x88\x9d\x5e\xe8\xf7\x6f\xae\x99\x4d\x5d\xdd\xe9\xa6\x6b\xc9\x2c\xec\x91\x0d\x44\x5e\x5f\xe5\x59\x62\xc4\x0b\x04\xa2\x11\x8c\x7e\x64\xaa\x13\x46\xae\x2b\x4b\x1f\x5e\xd8\xcc\x0a\x6d\x93\x22\x04\x37\x2e\x6d\xcd\x35\xbf\x51\x1b\x43\xb5\x70\xd8\xe6\x92\xf9\xd9\xb2\x63\xc0\x13\xc1\xc8\xad\x67\xa4\x38\xb8\x2e\xd4\x57\x83\xc8\x5c\x12\x30\xd3\xc6\x2c\xaf\xca\x80\xca\xa8\x5b\xc8\x00\x3e\x3f\x5a\xa2\x31\xd7\xa3\xdf\x2a\xfb\x4e\x66\x35\x19\xc9\xf6\xaa\xae\x7e\x2d\x5b\x02\x51\xb1\x70\x73\xd4\xc9\x85\xa0\xb7\xf3\xcf\x33\x43\x0f\x4f\x39\x10\xdd\xa4\xdb\x5a\x26\xbb\x99\xbe\x3b\xfb\x99\x91\xbc\xa5\x95\x52\xf9\x0c\x91\x17\x92\xbe\x04\x6f\x4e\xd7\x8a\x67\x9d\x64\x6b\xf8\xae\x8c\x9f\x9e\x38\x49\xd8\xf9\x47\xb2\xe4\xa5\x67\x85\xa8\xdb\xc7\x92\xc2\x72\xac\x1c\xd3\x23\xca\x4b\x84\x65\xb0\xae\xf0\xe4\xb4\xc8\x48\x3e\x70\xcd\x9b\xbc\x6b\x0c\x8d\xe1\x00\x5b\xb6\xac\xfb\x82\x23\xf7\x92\x27\xb0\x71\x71\xd9\x2b\x86\x41\x95\xa1\x97\x31\xfc\x3e\x85\x98\x47\x9b\xe7\x51\x66\xfa\x37\xd7\xa1\xb3\xb3\x2f\x62\x11\xbe\x88\x00\x3c\xa2\xe6\x96\xf3\x73\x98\x0b\xc3\xc6\xed\x87\xc5\xaf\x32\x33\x6e\x08\x73\x69\xf7\x18\x82\x6b\xb5\xcc\x83\x85\xf8\x60\x69\x20\xcd\xa5\xf0\xdf\xd5\xb2\xfa\x75\xea\xd5\x3c\x0c\x2f\x4c\x6f\x23\x54\x7d\xab\x0d\x3d\x5c\x26\x62\x5a\xfa\x13\xc6\x81\xff\xbe\xe7\x56\xcb\x63\xbd\xf8\x78\x89\x8b\x12\xbb\xcf\x84\x5f\xd1\x2b\x02\x57\x6e\xb9\x72\x6d\xf4\x74\x77\x4d\x3c\xeb\x1f\x33\xd1\xdc\x8d\xe1\xc8\xa5\xf3\x8a\xe8\x5d\xaf\xfc\xc6\x7b\xe7\xff\x8f\x75\xbf\x52\x78\xef\x7e\x12\x82\xba\xcb\x3c\x75\xae\x21\xb0\xcb\x0d\x2f\x37\xb9\xeb\x5d\x57\x1b\x0e\x30\xe8\x10\x9d\xbf\x3c\xc8\xf0\xf0\x19\x65\x91\xd7\x1b\xca\x02\xbb\x85\x8b\x65\xd1\x55\x9e\x94\xa1\x4c\xca\x21\xa2\xed\xd0\x77\x30\x8b\xff\x6d\x09\x9e\x3f\xb4\xe0\xe6\xe6\x00\x5f\xb3\xa8\x2f\xe0\x55\xc7\x59\x97\x93\x4e\xe6\xb5\x03\x84\x8b\x8d\xf8\x71\xfe\x25\xcc\xc6\x38\x9f\xef\x84\xc2\x7c\xbd\x54\xb2\xa0\x5a\xf2\x9d\x35\x8a\x73\x5e\x75\xdd\xdf\x93\x8d\x7a\x24\xf6\x7b\xe1\x68\x32\x43\xc2\x84\x71\x58\x8a\xee\xca\xdb\x78\x68\xeb\xf2\xa0\xe7\x52\x80\x47\x61\x7f\xae\xaf\xf2\xfc\x98\x47\xbc\x59\xe1\x55\x15\x3a\x94\xdc\x7a\xd1\xe5\xca\x5a\x04\xe1\xa6\x86\xe4\xb1\xf8\x4a\x44\x55\x3a\x95\x8a\x14\xa2\xca\xc9\x90\xab\x41\x99\x40\xe4\x18\xfc\xb1\x1e\x3b\x25\x38\x6c\xf3\xf9\x20\x22\x7d\xb2\xf1\xaa\x02\xaf\xd7\x58\x4f\x00\xb8\x61\x49\x37\x07\xb8\x61\xa3\xf8\x6f\x91\x7c\xb3\xcf\xb7\x57\x5f\xc0\xab\x14\xdd\x7c\x93\xb0\x34\xed\xa5\xeb\x55\xd5\xbd\x94\x52\xb9\xf7\x28\xf3\xb7\x03\x43\xe8\x2d\x0c\xee\x3c\xd3\xc2\x27\xd4\xb2\x34\xf3\x6b\x9a\x58\x0c\xcc\x03\xc1\x02\x7f\x66\x11\xbf\xe8\x38\xec\xee\x73\xa8\xc9\x9b\x7d\xc5\x04\x43\xfa\xe1\xcb\xf2\x70\x97\xa6\x89\xfc\x2e\x7f\x41\x1f\xe5\x03\xfa\x38\xbf\x67\x72\x5d\x6e\xa0\xb2\x97\xeb\x90\x9a\x59\xe8\x5f\x0e\xe5\x9d\x21\xbb\xcb\x1a\xf6\x2f\x5f\xca\x83\x5c\xe5\xad\xd7\x7f\x33\x16\x3b\x6d\xa7\x24\x76\x64\x8b\x51\xa8\xe7\x42\xb2\x5f\xc2\xa7\x9b\x77\x64\x8c\x63\x50\x7f\x71\xde\x74\xfc\xf0\xad\x93\xdf\xaf\xd1\xdf\xfc\xbe\xec\xf4\x14\x92\x61\x73\x3f\xf1\x3b\x36\x93\x1d\xaa\x0f\x27\x0e\xe7\x09\xb5\x0f\xbb\x6b\xe1\x7b\xe8\x78\xa2\xd1\xfd\x16\x9d\x13\x33\x5c\xb6\x88\x1d\x2f\x5c\x86\xff\x45\x2e\x3f\xb5\xb6\x81\x7c\xdc\x65\x45\x07\x38\xe5\x7b\x4b\xe0\x83\xad\x7f\x0a\x36\x79\xd1\x93\x43\xf7\xce\xed\xd0\x1f\x79\xdf\x92\xb7\x77\x73\x05\x93\x0f\xb2\x7e\x3b\xfe\xdc\xf4\xf9\xac\x25\x2c\xea\xfc\xf3\xc9\x88\xb1\x7c\x9d\x51\xbd\xd9\x2f\x81\xf7\x57\xea\x91\x71\x99\xe6\xbb\xf3\x4d\x6e\xc9\x75\x49\xf9\x70\x58\xba\x79\x77\xbd\x43\xee\x1b\x22\x79\xae\xe8\x47\xa7\x72\x6a\x28\xe4\x78\x16\x8a\x2d\x1d\x3c\x5f\xfc\x70\xcd\xcb\xb7\x9c\x72\x41\xff\x22\xc0\x5b\x1d\xdf\xa5\x06\x3c\x4d\x2e\x30\x49\xbe\xc0\x3f\x07\xf2\xf4\xaf\xdd\x10\xe3\x14\xee\x6e\x6f\x8f\x3a\x0e\xa9\x61\xc3\x6f\xff\x73\xa1\x4e\x77\x1a\xcb\x35\x7a\xf4\x44\xb7\x23\x86\x48\xfe\xd6\xe7\x5c\x9b\xaf\xd6\xf7\x75\xf5\xbf\x00\x00\x00\xff\xff\x77\xdf\x01\x95\x0d\x18\x00\x00") func runtimeHelpPluginsMdBytes() ([]byte, error) { return bindataRead( diff --git a/runtime/help/plugins.md b/runtime/help/plugins.md index 25f83ae3..7feb3c5b 100644 --- a/runtime/help/plugins.md +++ b/runtime/help/plugins.md @@ -4,8 +4,6 @@ Micro supports creating plugins with a simple Lua system. Every plugin has a main script which is run at startup which should be placed in `~/.config/micro/plugins/pluginName/pluginName.lua`. -If you want to add a help page for your plugin, place a markdown file in `~/.config/micro/plugins/pluginName/help.md`. - There are a number of callback functions which you can create in your plugin to run code at times other than startup. The naming scheme is `onAction(view)`. For example a function which is run every time the user saves @@ -111,6 +109,16 @@ The possible methods which you can call using the `messenger` variable are: If you want a standard prompt, just use `messenger.Prompt(prompt, "", 0)` +# Adding help files, syntax files, or colorschemes in your plugin + +You can use the `AddRuntimeFile(name, type, path string)` function to add various kinds of +files to your plugin. For example, if you'd like to add a help topic and to your plugin +called `test`, you would create the `test.md` file for example, and runt the function: + +```lua +AddRuntimeFile("test", "help", "test.md") +``` + # Autocomplete command arguments See this example to learn how to use `MakeCompletion` and `MakeCommand`