You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+47-5Lines changed: 47 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,39 @@
1
1
# acode-plugin
2
2
3
3
To create plugin for Acode editor use this template. To use this template create a github repository and add `https://github.com/deadlyjack/acode-plugin` as template.
4
+
<detailsopen>
5
+
<summary><h2style="display:inline;"id="toc">Table of Contents</h2></summary>
6
+
7
+
*[Required Files of a plugin](#required-files)
8
+
*[How to add a plugin to Acode](#add-your-plugin-to-acode)
- plugin.json - contains information about the plugin.
8
32
9
33
- id - plugin should have unique id. E.g. com.example.my-plugin
10
34
- name - plugin name.
11
35
- version - plugin version, if changes an update notificaiton will be sent to users.
12
-
- main - plugins main js file.
36
+
- main - path of plugin's main js file.
13
37
- icon - plugin icon.
14
38
- readme - readme file.
15
39
- files - list of all files that are required by the plugin.
@@ -25,6 +49,8 @@ Transpile your javascript file using babel so that your plugin can work on older
25
49
26
50
## Add your plugin to Acode
27
51
52
+
[:arrow_up: TOC](#toc)
53
+
28
54
To add your plugin, fork [this](https://github.com/deadlyjack/acode-plugins) repository, clone it, add your plugin information to `list.json` and make a pull request.
29
55
30
56
To initialize your plugin, use `acode.setPluginInit` method. This method requires two arguments.
@@ -46,30 +72,36 @@ You also need to set an unmount function, this is called when user choose to uni
46
72
47
73
## Plugin Development
48
74
49
-
You can take reference from already available plugins [acode-plugin-python](https://github.com/deadlyjack/acode-plugin-python)and [acode-plugin-prettier](https://github.com/deadlyjack).
75
+
You can take reference from already available plugins [acode-plugin-python](https://github.com/deadlyjack/acode-plugin-python), [acode-plugin-prettier](https://github.com/deadlyjack/acode-plugin-prettier)and [acode-plugin-snippets](https://github.com/deadlyjack/acode-plugin-snippets).
50
76
51
77
## Testing
52
78
79
+
[:arrow_up: TOC](#toc)
80
+
53
81
1. Open plugin project in VScode.
54
82
55
83
2. Install 'live server' extension. Enable 'https' for live server and start the server
56
84
57
-
3.Go to `settings > plugin > tap '+' icon in top right corner`.
85
+
3.Open Acode and go to `settings > plugins > tap '+' icon in top right corner`.
58
86
59
-
4. Add plugin locaion, e.g. https:⁄⁄192.168.1.100:500 and click on install.
87
+
4. Add plugin locaion, e.g. `https://192.168.1.100:500` and click on install.
60
88
61
89
### Requirement
62
90
63
91
-[Nodejs](https://nodejs.org/en/)
64
92
- Cordova
65
93
- Android Studio
66
94
67
-
## Global API
95
+
## Global APIs
96
+
97
+
[:arrow_up: TOC](#toc)
68
98
69
99
The global variables that you can use them directly in your plugin.
@@ -122,6 +156,8 @@ The global variables that you can use them directly in your plugin.
122
156
123
157
### actionStack
124
158
159
+
[:arrow_up: TOC](#toc)
160
+
125
161
-`push(action: Object): void` Pushes a callback function to actionStack. When use tap on physical/virtual back button, the given callback function is triggered.
126
162
127
163
- action
@@ -136,6 +172,8 @@ The global variables that you can use them directly in your plugin.
@@ -161,6 +199,8 @@ Function `window.toast(msg: string, milliSecond: number): void` will show a toas
161
199
162
200
## Native APIs
163
201
202
+
[:arrow_up: TOC](#toc)
203
+
164
204
To access native features and method of device use these [plugins](https://github.com/deadlyjack/Acode/tree/main/src/plugins). For example to open a file using SAF
165
205
166
206
```javascript
@@ -180,6 +220,8 @@ To get more info api provided by these plugins see there `js` files in `www` dir
0 commit comments