Skip to content

Commit 2d3986a

Browse files
authored
docs: update Readme
1 parent 15c6653 commit 2d3986a

File tree

1 file changed

+26
-79
lines changed

1 file changed

+26
-79
lines changed

README.md

Lines changed: 26 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -193,33 +193,40 @@ hook config.
193193
```javascript
194194
import { useGithubAutomatedRepos, ProjectIcon, StackIcon } from 'github-automated-repos/index';
195195
```
196+
<br>
197+
196198
### The package imports four elements:
197199

198200
- `useGithubAutomatedRepos` hook responsible for automating the repositories. It returns a function called dataGithubRepos, which takes two parameters: data (data that comes from the GitHub API) and the keyword (the latter responsible for showing the project on your website from the moment it is declared in the Topics field of the your Github repository). The dataGithubRepos returns, so optimized, an array of objects containing 6 properties: id, html_url, homepage, topics, name and description.
199201

200202
```tsx
201203
const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
202204
```
203-
205+
<br>
206+
204207
- `StackIcons` component returns, based on the iteration of the topics array, icons of the stacks used in your project. Insert the stacks used in the topics field of your repository. Check the [Stack Icons](https://github-automated-repos.vercel.app/documentation/stackIcons) tab!
205208

206209
```tsx
207210
<StackIcons key={ } itemTopics={ } className={ } />
208211
```
209-
212+
<br>
213+
210214
- `StackLabels` component returns, based on the iteration of the topics array, labels of the stacks used in your project. Insert the stacks used in the topics field of your repository. Check the [Stack Icons](https://github-automated-repos.vercel.app/documentation/stackIcons) tab!
211215

212216
```tsx
213217
<StackLabes key={ } itemTopics={ } className={ } />
214218
```
215-
219+
<br>
220+
216221
- `ProjectIcons` component returns, based on the iteration of the topics array, icons to represent your project. The project tag must be inserted in the topics field of your repository. Check the [Project Icons](https://github-automated-repos.vercel.app/documentation/projectIcons) tab!
217222

218223
```tsx
219224
<ProjectIcons key={ } itemTopics={ } className={ } />
220225
```
221226

222-
227+
<br>
228+
<br>
229+
223230
## Fill in the fields in the github repository
224231

225232
- `id`: repository identification number. used as parameter in the key tag. This field does not need to be filled in.
@@ -228,93 +235,37 @@ hook config.
228235

229236
![image](https://user-images.githubusercontent.com/59892368/219116735-a026d9b9-f5b9-4389-b8f1-619db2488368.png)
230237

238+
<br>
239+
231240
- `topics`: array that brings information about the icons in [Project Icons](https://github-automated-repos.vercel.app/documentation/projectIcons) and [Stack Icons](https://github-automated-repos.vercel.app/documentation/stackIcons). Used in both ProjectIcon and StackIcon components. It is in this field that is passed the key configured in the hook. Refers to the field About / Topics of your GitHub.
232241

233242
![image](https://user-images.githubusercontent.com/59892368/219117029-d693ee8f-4289-4ac0-85ed-674091508510.png)
234243

244+
<br>
245+
235246
`name`: This is the name of the repository. Refers to the field Settings / General / Repository name of your GitHub.
236247

237248
![image](https://user-images.githubusercontent.com/59892368/219117097-43db2497-7f62-428e-85c6-ef3656da4cd2.png)
238249

250+
<br>
251+
239252
`description`: This is the description given to your repository. Refers to the About /Description field of your GitHub.
240253

241254
![image](https://user-images.githubusercontent.com/59892368/219117260-5bdb1fbb-c58b-4ad9-938a-068b58c72f27.png)
242255

256+
<br>
257+
<br>
243258

244259
## Code Example
245260

246-
:exclamation::exclamation: Don't forget to fill in the keyword fields (determined by you) and enter your github username.
247-
248-
```javascript
249-
fetch('https://api.github.com/users/usernameGitHub/repos?sort=created&per_page=999')
250-
```
261+
:exclamation::exclamation: Don't forget to fill in the keyword fields (determined by you) and enter your gitHubusername.
251262

252263
```javascript
253-
then(data => setRepository(dataReposGithub(data, 'keyword')))
264+
const data = useGithubAutomatedRepos("GitHubUsername", "KeyWord");
254265
```
255266

256-
#### <a href="https://typicode.github.io/husky/#/"><img alt="Javascript" width="35" height="35" src="https://user-images.githubusercontent.com/59892368/219095611-551d532a-30fc-4873-b00e-0a8bbf8bb5ec.svg"><a/>
257-
```javascript
258-
import './App.css';
259-
import { useEffect, useState } from 'react';
260-
import { useGithubAutomatedRepos, ProjectIcon, StackIcon } from 'github-automated-repos/index';
261-
function App() {
262-
{/*useGithubAutomatedRepos hook*/ }
263-
const { dataReposGithub } = useGithubAutomatedRepos()
264-
const [repository, setRepository] = useState([])
265-
266-
useEffect(() => {
267-
{/*Put here your github Name*/ }
268-
fetch('https://api.github.com/users/usernameGitHub/repos?sort=created&per_page=999')
269-
.then(response => response.json())
270-
.then(data => setRepository(dataReposGithub(data, 'deploy'))); {/*<-- keyWord*/}
271-
}, [])
272-
273-
return (
274-
<div className="App">
275-
{
276-
repository.map((item) => {
277-
return (
278-
<div key={item.id}>
279-
280-
{/*Project Icon*/}
281-
{item.topics.map((icon) => {
282-
return (
283-
<ProjectIcon key={icon} className="project_Icon" iconItem={icon} />
284-
)
285-
})}
286-
{/*html Url*/}
287-
<a href={item.html_url}>
288-
{/*Name Project*/}
289-
<h1>{item.name}</h1>
290-
</a>
291-
{/*Description*/}
292-
<p>{item.description}</p>
293-
294-
{/*Homepage*/}
295-
<a href={item.homepage}>
296-
<h3>Homepage</h3>
297-
</a>
298-
{/*Stacks Icon*/}
299-
{item.topics.map((icon) => {
300-
return (
301-
<StackIcon key={icon} className="stack_Icon" iconItem={icon} />
302-
)
303-
})}
304267

305-
</div>
306-
307-
)
308-
})
309-
}
310-
</div>
311-
);
312-
313-
}
314-
export default App;
315-
```
316-
317-
#### <a href="https://typicode.github.io/husky/#/"><img alt="Javascript" width="35" height="35" src="https://user-images.githubusercontent.com/59892368/219095850-0a4e6f54-d524-4deb-be2c-fda358aba84d.svg"><a/>
268+
#### <a href="https://typicode.github.io/husky/#/"><img alt="Javascript" width="35" height="35" src="https://user-images.githubusercontent.com/59892368/210762527-ae3afe1f-fe36-46a9-98ad-35dbae4d1adf.svg"><a/> <a href="https://typicode.github.io/husky/#/"><img alt="Javascript" width="35" height="35" src="https://user-images.githubusercontent.com/59892368/219095611-551d532a-30fc-4873-b00e-0a8bbf8bb5ec.svg"><a/>
318269

319270
```typescript
320271
import './App.css';
@@ -354,7 +305,7 @@ hook config.
354305
{/*Stacks Icon and Stacks Label*/}
355306
{item.topics.map((icon) => {
356307
return (
357-
<div style={{display:'flex', justifyContent:'center'}}>
308+
<div key={icon} style={{display:'flex', justifyContent:'center'}}>
358309
<StackIcons key={icon} className="stack_Icon" itemTopics={icon} />
359310
<StackLabels key={icon} itemTopics={icon} />
360311
</div>
@@ -372,15 +323,11 @@ hook config.
372323
}
373324
export default App;
374325
```
375-
376-
<!------------------------------------Framework Settings-->
377-
378-
## Framework Settings.
326+
327+
<br>
328+
<!------------------------------------Framework Settings--> ## Framework Settings.
379329
380330
381-
382-
383-
384331
<img alt="NextJS" width="50" height="50" src="https://github.com/DIGOARTHUR/github-automated-repos/assets/59892368/6b213e2e-213a-489d-bbda-1dec9dcda585">
385332
386333

0 commit comments

Comments
 (0)