Skip to content

Commit c8b8291

Browse files
committed
add example and explaination
1 parent ef1f3e3 commit c8b8291

26 files changed

+200
-22
lines changed

docs/api/chat/eventEmitter.md

Whitespace-only changes.

docs/api/chat/userMessageListener.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ data:
1515
link: userMessageListener.md
1616
---
1717
<CBBaseInfo/>
18-
<CBParameters/>
18+
<CBParameters/>
19+
20+
### Status
21+
Working Progress....

docs/api/chat/waitforReply.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,17 @@ data:
1919
link: waitforReply.md
2020
---
2121
<CBBaseInfo/>
22-
<CBParameters/>
22+
<CBParameters/>
23+
24+
### Example:
25+
26+
```js
27+
28+
const message = await codebolt.chat.waitforReply(message: string)
29+
30+
```
31+
32+
### Explaination
33+
34+
The codebolt.chat.waitforReply(message: string) function is used to send a message on the codebolt chat and wait for the reply. This function enables real-time communication by allowing the script to send text messages on the codebolt chat. This function returns the reply message, which we can store in a variable and use.
35+

docs/api/codeparsers/getAstTreeInFile.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ data:
2020
link: getAstTreeInFile.md
2121
---
2222
<CBBaseInfo/>
23-
<CBParameters/>
23+
<CBParameters/>
24+
25+
### Status
26+
27+
Working Progress...

docs/api/codeparsers/getClassesInFile.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ data:
1717
link: getClassesInFile.md
1818
---
1919
<CBBaseInfo/>
20-
<CBParameters/>
20+
<CBParameters/>
21+
22+
### Status
23+
24+
Working Progress...

docs/api/codeparsers/getFunctionsinClass.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ data:
2020
link: getFunctionsinClass.md
2121
---
2222
<CBBaseInfo/>
23-
<CBParameters/>
23+
<CBParameters/>
24+
25+
### Status
26+
27+
Working Progress...

docs/api/codeutils/getAllFilesAsMarkDown.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,31 @@ data:
1616
link: getAllFilesAsMarkDown.md
1717
---
1818
<CBBaseInfo/>
19-
<CBParameters/>
19+
<CBParameters/>
20+
21+
### Example
22+
23+
```js
24+
25+
////test.js
26+
27+
function foo(d) {
28+
d += 3;
29+
return d+999
30+
}
31+
function bar(d) {
32+
return d*100
33+
}
34+
35+
36+
///index.js
37+
38+
const getAllFilesAsMarkDown = await codebolt.codeutils.getAllFilesAsMarkDown();
39+
40+
```
41+
42+
![markdown](../../../static/img/markdown.png)
43+
44+
### Explaination
45+
46+
The codebolt.codeutils.getAllFilesAsMarkDown() function is used the Retrieves all files as Markdown. This Function returns the File as markdown, which we can store in a variable and use.

docs/api/codeutils/getJsTree.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,17 @@ data:
1919
link: getJsTree.md
2020
---
2121
<CBBaseInfo/>
22-
<CBParameters/>
22+
<CBParameters/>
23+
24+
### Examples
25+
26+
```js
27+
28+
const GetJsTree = await codebolt.codeutils.getJsTree();
29+
30+
```
31+
32+
33+
### Explaination
34+
35+
The method codebolt.codeutils.getJsTree(filePath: string) is designed to analyze a JavaScript file located at the given file path and return its tree structure. This tree structure is a hierarchical representation of the code within the file, which typically includes various elements such as functions, variables, classes, etc.

docs/api/codeutils/getMatcherList.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ data:
1616
link: getMatcherList.md
1717
---
1818
<CBBaseInfo/>
19-
<CBParameters/>
19+
<CBParameters/>
20+
21+
### Status
22+
Working Progress..

docs/api/codeutils/matchDetail.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ data:
1919
link: matchDetail.md
2020
---
2121
<CBBaseInfo/>
22-
<CBParameters/>
22+
<CBParameters/>
23+
24+
25+
### Status
26+
Working Progress..

docs/api/codeutils/performMatch.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ data:
2525
link: performMatch.md
2626
---
2727
<CBBaseInfo/>
28-
<CBParameters/>
28+
<CBParameters/>
29+
30+
### Status
31+
Working Progress..

docs/api/crawler/click.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ data:
1919
link: click.md
2020
---
2121
<CBBaseInfo/>
22-
<CBParameters/>
22+
<CBParameters/>
23+
24+
### Status
25+
Working Progress..

docs/api/crawler/crawl.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ data:
1414
link: crawl.md
1515
---
1616
<CBBaseInfo/>
17-
<CBParameters/>
17+
<CBParameters/>
18+
19+
20+
### Status
21+
Working Progress..

docs/api/crawler/enter.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ data:
1414
link: enter.md
1515
---
1616
<CBBaseInfo/>
17-
<CBParameters/>
17+
<CBParameters/>
18+
19+
20+
### Status
21+
Working Progress..

docs/api/crawler/goToPage.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ data:
1717
link: goToPage.md
1818
---
1919
<CBBaseInfo/>
20-
<CBParameters/>
20+
<CBParameters/>
21+
22+
23+
### Status
24+
Working Progress..

docs/api/crawler/screenshot.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ data:
1414
link: screenshot.md
1515
---
1616
<CBBaseInfo/>
17-
<CBParameters/>
17+
<CBParameters/>
18+
19+
20+
### Status
21+
Working Progress..

docs/api/crawler/scroll.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ data:
1717
link: scroll.md
1818
---
1919
<CBBaseInfo/>
20-
<CBParameters/>
20+
<CBParameters/>
21+
22+
23+
### Status
24+
Working Progress..

docs/api/crawler/start.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ data:
1414
link: start.md
1515
---
1616
<CBBaseInfo/>
17-
<CBParameters/>
17+
<CBParameters/>
18+
19+
20+
### Status
21+
Working Progress..

docs/api/crawler/type.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ data:
2222
link: type.md
2323
---
2424
<CBBaseInfo/>
25-
<CBParameters/>
25+
<CBParameters/>
26+
27+
### Status
28+
Working Progress..

docs/api/dbmemory/addKnowledge.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,25 @@ data:
2222
link: addKnowledge.md
2323
---
2424
<CBBaseInfo/>
25-
<CBParameters/>
25+
<CBParameters/>
26+
27+
### Example
28+
29+
```js
30+
31+
// Add a key-value pair to the in-memory database with the key "UserID" and the value "admin"
32+
await codebolt.dbmemory.addKnowledge("UserID", "admin")
33+
34+
// Add a key-value pair to the in-memory database with the key "Password" and the value "Test@123"
35+
await codebolt.dbmemory.addKnowledge("Password", "Test@123")
36+
37+
```
38+
39+
40+
### Explaination
41+
42+
Adding a key-value pair to an in-memory database involves storing a specific piece of information (value) that can be retrieved later using a unique identifier (key).
43+
44+
Key: A unique identifier, typically a string, that is used to reference the data.
45+
46+
Value: The actual data or information that you want to store. This can be any type of data, such as a number, a string, an object, etc.

docs/api/dbmemory/getKnowledge.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,27 @@ data:
1919
link: getKnowledge.md
2020
---
2121
<CBBaseInfo/>
22-
<CBParameters/>
22+
<CBParameters/>
23+
24+
### Example
25+
26+
```js
27+
28+
//set the userID and password
29+
const UserID = await codebolt.dbmemory.getKnowledge("UserID")
30+
const Password = await codebolt.dbmemory.getKnowledge("Passowrd")
31+
32+
console.log("UserId------",UserID);
33+
console.log("Password------",Password);
34+
35+
///output
36+
37+
///UserId------ admin
38+
///Password----- Test@123
39+
40+
```
41+
42+
### Explaination
43+
44+
The getKnowledge method retrieves the value associated with a given key from the in-memory database, allowing you to access stored information using the unique identifier provided.
45+

docs/api/debug/debug.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,25 @@ data:
2222
link: debug.md
2323
---
2424
<CBBaseInfo/>
25-
<CBParameters/>
25+
<CBParameters/>
26+
27+
28+
### Example
29+
30+
```js
31+
//error is a varialbe that stored error log
32+
const error = "error log"
33+
34+
//// Calling the `codebolt.debug.debug` method to log the error with its type (e.g., "warning", "error", etc.)
35+
const fileData = await codebolt.debug.debug(error, "error")
36+
37+
//after executing this command then show the error in debug section on coltbolt.
38+
39+
```
40+
41+
![debug](../../../static/img/debug.png)
42+
43+
44+
### Explaination
45+
46+
While executing the codebolt.debug.debug method, the error will be shown in the debug section of Codebolt.

docs/api/debug/openDebugBrowser.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ data:
2424
link: openDebugBrowser.md
2525
---
2626
<CBBaseInfo/>
27-
<CBParameters/>
27+
<CBParameters/>
28+
29+
30+
### status
31+
32+
Working Progress...

static/img/debug.png

145 KB
Loading

static/img/fileMarkDown.png

65 KB
Loading

static/img/markdown.png

8.5 KB
Loading

0 commit comments

Comments
 (0)