From 6f5a2ababa6bcac967776c2aabaa1a9f8db2aed2 Mon Sep 17 00:00:00 2001 From: ni-richard Date: Thu, 12 Sep 2019 10:45:01 +0200 Subject: [PATCH] Created ide.write (markdown) --- ide.write.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ide.write.md diff --git a/ide.write.md b/ide.write.md new file mode 100644 index 0000000..d11226b --- /dev/null +++ b/ide.write.md @@ -0,0 +1,54 @@ +### Request +* **Description**: Overwrites the contents of a file. +* **Subscribers**: [IdeHandler](https://github.com/avatao-content/baseimage-tutorial-framework/wiki/IdeHandler) + +```json +{ + "key": "ide.write", + "intent": "control", + "scope": "zmq" +} +``` + +| Parameter | Type | Required | Description | +| ------------ |:--------:|:------------------:| --------------------------- | +| *filename* | `string` | :heavy_check_mark: | Full path or basename of a file. | +| *content* | `string` | | New contents of the selected file. | + +*** + +**Example**: +```json +{ + "key": "ide.write", + "filename": "main.c", + "content": "#include ..." +} +``` + +### Response +* **Description**: Informs the frontend that the file was changed. +* **Subscribers**: *none* + +```json +{ + "key": "ide.write", + "scope": "websocket" +} +``` + +| Parameter | Type | Required | Description | +| ------------ |:--------:|:------------------:| --------------------------- | +| *filename* | `string` | :heavy_check_mark: | Full path or basename of a file. | +| *files* | `array` | :heavy_check_mark: | List of every readable file according to the current patterns. | + +*** + +**Example**: +```json +{ + "key": "ide.write", + "filename": "main.c", + "files": ["/home/main.c", "/home/not_main.c"] +} +``` \ No newline at end of file