Skip to content

Commit bca1514

Browse files
committed
example and explaination updated
1 parent 115883d commit bca1514

31 files changed

+226
-41
lines changed

Diff for: docs/api/browser/click.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data:
2121
<CBBaseInfo/>
2222
<CBParameters/>
2323

24-
### Examples
24+
### Example
2525

2626
```js
2727
// Using Codebolt's browser API, you can interact with elements on a web page.

Diff for: docs/api/browser/close.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ data:
1616
<CBBaseInfo/>
1717
<CBParameters/>
1818

19-
### Examples
20-
```js
19+
### Example
20+
21+
```js
2122
// Open the browser and navigate to a specific URL
22-
codebolt.browser.goToPage(url);
23+
codebolt.browser.goToPage(url);
2324

2425
// Perform tests on the web page
2526
// (Assume you have performed all necessary tests)
2627

2728
// Close the current page
28-
codebolt.browser.close();
29+
codebolt.browser.close();
2930

3031
```
3132
### Explaination

Diff for: docs/api/browser/enter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data:
1818
<CBBaseInfo/>
1919
<CBParameters/>
2020

21-
### Examples
21+
### Example
2222

2323
```js
2424

Diff for: docs/api/browser/extractText.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data:
1616
<CBBaseInfo/>
1717
<CBParameters/>
1818

19-
### Examples:
19+
### Example
2020

2121
```js
2222
// Navigate to the news website

Diff for: docs/api/browser/getContent.md

+19
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,22 @@ data:
2020
### Status
2121
Working Progress...
2222

23+
24+
### Example
25+
26+
```js
27+
28+
// Navigate to the product page
29+
await codebolt.browser.goToPage("https://example-ecommerce.com/product/12345")
30+
31+
// Retrieve the get content of the current page
32+
const getContent = await codebolt.browser.getContent()
33+
34+
console.log(getContent)
35+
36+
```
37+
38+
39+
### Explaination
40+
41+
The codebolt.browser.getContent() method is used to capture the entire content of the webpage that is currently loaded. This includes the HTML, text, and other elements present on the page. The codebolt.browser.getContent() function is used to retrieve the HTML content of the current web page. This function is particularly useful for web scraping, data extraction, and automated testing scenarios where you need to capture the content of a web page for further analysis or processing.

Diff for: docs/api/browser/getHTML.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data:
1919
<CBParameters/>
2020

2121

22-
### Examples :
22+
### Example
2323

2424
```js
2525

Diff for: docs/api/browser/getMarkdown.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data:
1818
<CBBaseInfo/>
1919
<CBParameters/>
2020

21-
### Examples:
21+
### Example
2222

2323
```js
2424

Diff for: docs/api/browser/getPDF.md

+16
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,19 @@ data:
2020
### Status
2121
Working Progress...
2222

23+
24+
### Example
25+
26+
```js
27+
28+
29+
await codebolt.browser.goToPage("https://example-ecommerce.com/product/12345")
30+
31+
32+
const getPDF = await codebolt.browser.getPDF()
33+
34+
```
35+
36+
### Explaination
37+
38+
The codebolt.browser.getPDF() method is designed to capture the content of the current webpage and generate a PDF file from it. This is useful for saving web pages as PDFs for offline reading, documentation, or record-keeping.

Diff for: docs/api/browser/getUrl.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data:
1919
<CBParameters/>
2020

2121

22-
### Examples:
22+
### Example
2323

2424
```js
2525

Diff for: docs/api/browser/goToPage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data:
2121
<CBBaseInfo/>
2222
<CBParameters/>
2323

24-
### Examples
24+
### Example
2525

2626
```js
2727

Diff for: docs/api/browser/newPage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data:
1616
<CBBaseInfo/>
1717
<CBParameters/>
1818

19-
### Examples:
19+
### Example
2020

2121
```js
2222
// Open a new page in the browser

Diff for: docs/api/browser/pdfToText.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data:
2121

2222
Working Progress...
2323

24-
<!-- ### Examples:
24+
### Example
2525

2626
```js
2727

@@ -34,4 +34,4 @@ codebolt.browser.pdfToText();
3434
```
3535

3636
### Explanation
37-
The codebolt.browser.pdfToText() function is used to convert the PDF content of the current page into text format. This function is particularly useful when dealing with PDF documents in web automation or data extraction scenarios where you need to extract textual information from PDF files. -->
37+
The codebolt.browser.pdfToText() function is used to convert the PDF content of the current page into text format. This function is particularly useful when dealing with PDF documents in web automation or data extraction scenarios where you need to extract textual information from PDF files.

Diff for: docs/api/browser/screenshot.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ data:
2020

2121
Working Progress...
2222

23-
<!-- ### Examples:
23+
24+
### Example
2425

2526
```js
2627

@@ -35,9 +36,3 @@ codebolt.browser.screenshot();
3536
### Explanation:
3637

3738
The codebolt.browser.screenshot() function is used to capture a screenshot of the current page displayed in the browser. This function is helpful for various purposes such as visual verification, debugging, or generating documentation.
38-
39-
### Explaination of the code:
40-
41-
Navigation: The script navigates to the desired web page using codebolt.browser.goToPage("https://example.com").
42-
43-
Screenshot Capture: Once the page has loaded, the script calls codebolt.browser.screenshot() to capture a screenshot of the current page. This function takes a snapshot of the entire visible area of the web page, including all visible elements and content. -->

Diff for: docs/api/browser/scroll.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ data:
2626
<CBBaseInfo/>
2727
<CBParameters/>
2828

29-
### Examples:
29+
### Example
3030

3131
```js
3232

@@ -36,6 +36,6 @@ await codebolt.browser.scroll("down", "500");
3636

3737
```
3838

39-
### Explanation:
39+
### Explanation
4040

4141
The codebolt.browser.scroll(direction: string, pixels: string) function is used to scroll the current page in a specified direction by a specified number of pixels. This function is useful for automating scrolling actions on a web page, such as navigating through lengthy content or bringing specific elements into view.

Diff for: docs/api/browser/search.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data:
2525
<CBParameters/>
2626

2727

28-
### Examples:
28+
### Example
2929

3030
```js
3131

@@ -37,6 +37,6 @@ console.log(searchResults);
3737

3838
```
3939

40-
### Explanation:
40+
### Explanation
4141

4242
The codebolt.browser.search(elementid: string, query: string) function is used to perform a search on the current page using a specified query. This function allows automation scripts to search for specific content or elements within the page.

Diff for: docs/api/browser/type.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data:
2525
<CBParameters/>
2626

2727

28-
### Examples:
28+
### Example
2929

3030
```js
3131
// Type "John Doe" into the input field with the ID "name"

Diff for: docs/api/cbstate/addToAgentState.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data:
2424
<CBBaseInfo/>
2525
<CBParameters/>
2626

27-
### Examples:
27+
### Example
2828
```js
2929
// Add a user ID to the agent's state
3030
await codebolt.cbstate.addToAgentState("userID", "12345");

Diff for: docs/api/cbstate/getAgentState.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data:
1919
<CBParameters/>
2020

2121

22-
### Examples:
22+
### Example
2323

2424
```js
2525

Diff for: docs/api/cbstate/getApplicationState.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data:
1818
<CBBaseInfo/>
1919
<CBParameters/>
2020

21-
### Examples
21+
### Example
2222

2323
```js
2424
// Retrieve the current application state

Diff for: docs/api/chat/getChatHistory.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data:
2121
<CBParameters/>
2222

2323

24-
### Examples
24+
### Example
2525

2626
```js
2727
// Retrieve the chat history from the server

Diff for: docs/api/chat/stopProcess.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data:
1919
<CBParameters/>
2020

2121

22-
### Examples
22+
### Example
2323

2424
```js
2525

Diff for: docs/api/git/add.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,18 @@ data:
2323

2424
### Status
2525

26-
Working Progress...
26+
Working Progress...
27+
28+
### Example
29+
30+
```js
31+
32+
await git.add('/path/to/repo/file.txt')
33+
34+
```
35+
36+
### Explaination
37+
38+
Add changes in the specified directory to the staging area. It has one parameter.
39+
40+
path: A string specifying the path of the directory or files to be added.

Diff for: docs/api/git/branch.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,20 @@ data:
2626

2727
### Status
2828

29-
Working Progress...
29+
Working Progress...
30+
31+
### Example
32+
33+
```js
34+
35+
await git.branch('/path/to/repo', 'new-branch')
36+
37+
```
38+
39+
### Explaination
40+
41+
Creates a new branch in the local repository.It has two parameter.
42+
43+
path: A string specifying the local repository path.
44+
45+
branch: A string specifying the new branch name.

Diff for: docs/api/git/checkout.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,21 @@ data:
2626

2727
### Status
2828

29-
Working Progress...
29+
Working Progress...
30+
31+
32+
### Example
33+
34+
```js
35+
36+
await git.checkout('/path/to/repo', 'feature-branch')
37+
38+
```
39+
40+
### Explaination
41+
42+
Check out a specific branch in the local repository. It has two parameter.
43+
44+
path: A string specifying the local repository path.
45+
46+
branch: A string specifying the branch name to be checked out.

Diff for: docs/api/git/clone.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,20 @@ data:
2626

2727
### Status
2828

29-
Working Progress...
29+
Working Progress...
30+
31+
### Example
32+
33+
```js
34+
35+
await git.clone('https://github.com/user/repo.git', '/path/to/local/repo')
36+
37+
```
38+
39+
### Explaination
40+
41+
Clone an existing Git repository from a given URL to a local directory. It has two parameter.
42+
43+
url: A string specifying the remote repository URL.
44+
45+
path: A string specifying the local directory path where the repository should be cloned.

Diff for: docs/api/git/diff.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,20 @@ data:
2626

2727
### Status
2828

29-
Working Progress...
29+
Working Progress...
30+
31+
### Example
32+
33+
```js
34+
35+
await git.diff('abc123', '/path/to/repo')
36+
37+
```
38+
39+
### Explaination
40+
41+
Shows the difference between the specified commit and the current state of the repository. It has two parameter.
42+
43+
commitHash: A string specifying the commit hash to compare against.
44+
45+
path: A string specifying the local repository path.

0 commit comments

Comments
 (0)