Skip to content

Commit 60d9d9b

Browse files
committed
📝 add docs for jsonrpc
1 parent ad8858a commit 60d9d9b

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@ coverage.xml
4343

4444
# vscode
4545
.history
46-
.vscode
46+
.vscode
47+
48+
49+
# ppt
50+
*.ppt
51+
*.pptx

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,27 @@
44

55
Flow Launcher supports Python by JsonRPC.
66

7-
## JSON RPC
7+
## JSON-RPC
88

9-
<!-- A picture from wox.one -->
9+
> [JSON-RPC](https://en.wikipedia.org/wiki/JSON-RPC) is a remote procedure call protocol encoded in JSON.
10+
11+
In Flow Launcher, we use JSON-RPC as a **local** procedure call protocol to bind Flow and other program languages.
12+
13+
So we need to build a **common API** between Flow and Plugin.
14+
15+
![JsonRPC](./assets/jsonrpc.png)
16+
17+
### Example
18+
19+
- `-->` denotes data sent to FLow.
20+
- `<--` denotes data coming from Flow.
21+
22+
```json
23+
--> {"method": "query", "parameters": [""]}
24+
<-- {"Title": "title", "SubTitle": "sub title", "IconPath": "favicon.ico"}
25+
```
26+
27+
<!-- TODO: try to add some other examples -->
1028

1129
## Installation
1230

@@ -24,6 +42,8 @@ Flow Launcher supports Python by JsonRPC.
2442
>>> python setup.py install
2543
```
2644

45+
<!-- TODO: update Example Plugin (HellowWorldPython) for this plugin -->
46+
2747
### License
2848

2949
This project is under the [MIT](./LICENSE) license.

assets/jsonrpc.png

14.1 KB
Loading

0 commit comments

Comments
 (0)