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: 04-Harnessing-GitHub-Copilot-with-JavaScript/README.MD
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ const siteProps = {
64
64
65
65
### 🔎 Step 2: Animate the social media icons with a prompt
66
66
67
-
An animation can make the social media section more eye-catching. Next, lets ask Copilot’s help to animate the icons. Write the following prompt in the `src/styles.css` file:
67
+
An animation can make the social media section more eye-catching. Ask Copilot’s help to animate the icons. Write the following prompt in the `src/styles.css` file:
68
68
69
69
```css
70
70
/* add an amazing animation to the social icons */
@@ -91,11 +91,16 @@ img.socialIcon:hover {
91
91
}
92
92
```
93
93
94
-
### 🚀 Step 3: Work with the suggestion
94
+
### 🚀 Step 3: Find out how to run the app
95
+
Open GitHub Copilot chat by clicking on the chat icon on the left side bar and use the input section to ask the following:
95
96
96
-
Accept the suggestion by pressing the tab key. If you don't receive the exact same suggestion, then you can either experiment with the suggestion provided or keep typing the CSS code until it matches.
97
+
```
98
+
@workspace I want to understand how can I run this React application
99
+
```
97
100
98
-
Your site should already be running in your Codespace, and the change will reload onto the page automatically. To see them, hover over one of your social media icons in the footer to see the magic!
101
+
The prompts uses `@workspace` which is a special feature of GitHub Copilot chat that allows you to include more context for a more complete answer. Try out other queries using the chat panel for a more interactive workflow.
99
102
103
+
### Conclusion
104
+
Your site should already be running in your Codespace, and the change will reload onto the page automatically. To see them, hover over one of your social media icons in the footer to see the magic!
100
105
101
-
Congratulations, through the exercise, you haven't only used copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
106
+
Congratulations, through the exercise, you have use GitHub Copilot to generate code and also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
Copy file name to clipboardExpand all lines: 05-Harnessing-GitHub-Copilot-with-Python/README.md
+2-9Lines changed: 2 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,21 +56,14 @@ Next, generate a new endpoint with GitHub Copilot by adding the comment:
56
56
# Create a FastAPI endpoint that accepts a POST request with a JSON body containing a single field called "text" and returns a checksum of the text
57
57
```
58
58
59
-
### 🐍 Step 3: Add necessary imports
59
+
### 🐍 Step 3: Explain code
60
60
61
-
The generated code causes the application to crash. The crash happens because the `base64` and `os` modules aren't imported. Add the following lines to the top of the file:
62
-
63
-
```python
64
-
import base64
65
-
import os
66
-
```
61
+
The `generate()` route creates a pseudo-random token ID using a single line that might be difficult to fully understand. Select the whole function, and then right click on the selection, then select the Copilot menu item, and then the _"Explain This"_ option. The GitHub Copilot chat interface will open to the left and provide you a useful explanation which you can use to interactively ask more questions.
67
62
68
63
Finally, verify the new endpoint is working by trying it out by going to the `/docs` endpoint and confirming that the endpoint shows up.
69
64
70
-
71
65
🚀 Congratulations, through the exercise, you haven't only used copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
72
66
73
-
74
67
## Legal Notices
75
68
76
69
Microsoft and any contributors grant you a license to the Microsoft documentation and other content
0 commit comments