{repo.repoName}
61 |76 | {repo.id !== currentRepoId && ( 77 |
├── .all-contributorsrc ├── .eslintignore ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md └── workflows │ └── ci.yml ├── .gitignore ├── .husky ├── pre-commit └── pre-push ├── .nvmrc ├── .prettierignore ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── public ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── index.html ├── manifest.json └── robots.txt ├── src ├── App.css ├── App.js ├── Components │ ├── Footer.js │ ├── Navbar.js │ ├── NoData.js │ ├── Page.js │ ├── ScrollToTop.js │ ├── ScrollToTopBtn.js │ └── Spinner.js ├── Pages │ ├── Home │ │ ├── Contributor.js │ │ ├── Features.js │ │ ├── HeroSec.js │ │ └── index.js │ ├── ResourceREADME │ │ ├── OtherReposByAuthorModal.js │ │ ├── PdfContainer.js │ │ ├── ReadmeUtilsBtn.js │ │ ├── code-blocks.js │ │ └── index.js │ └── Resources │ │ ├── ResourceCard.js │ │ ├── ResourceCards.js │ │ ├── SearchInput.js │ │ ├── Suggestion.js │ │ └── index.js ├── assets │ └── no_data.svg ├── context │ ├── resources │ │ ├── resourceContext.js │ │ ├── resourceReducer.js │ │ └── resourceState.js │ ├── theme │ │ ├── themeContext.js │ │ ├── themeReducer.js │ │ └── themeState.js │ └── types.js ├── data │ ├── contributors.js │ └── resourcesData.js ├── index.css ├── index.js └── serviceWorker.js └── yarn.lock /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "Binu42", 10 | "name": "Binu kumar", 11 | "avatar_url": "https://avatars2.githubusercontent.com/u/45959932?v=4", 12 | "profile": "http://www.binu.live", 13 | "contributions": [ 14 | "infra", 15 | "code", 16 | "test", 17 | "maintenance", 18 | "ideas" 19 | ] 20 | }, 21 | { 22 | "login": "jaydeepkhatri", 23 | "name": "Jaydeep Khatri", 24 | "avatar_url": "https://avatars0.githubusercontent.com/u/29619945?v=4", 25 | "profile": "https://jaydeepkhatri.me/", 26 | "contributions": [ 27 | "content" 28 | ] 29 | }, 30 | { 31 | "login": "zoltanszogyenyi", 32 | "name": "Zoltán Szőgyényi", 33 | "avatar_url": "https://avatars1.githubusercontent.com/u/8052108?v=4", 34 | "profile": "https://themesberg.com", 35 | "contributions": [ 36 | "content" 37 | ] 38 | }, 39 | { 40 | "login": "jackdolgin", 41 | "name": "Jack Dolgin", 42 | "avatar_url": "https://avatars0.githubusercontent.com/u/29798528?v=4", 43 | "contributions": [ 44 | "content" 45 | ] 46 | }, 47 | { 48 | "login": "hdquemada", 49 | "name": "Hector Quemada", 50 | "avatar_url": "https://avatars3.githubusercontent.com/u/44162051?v=4", 51 | "profile": "https://github.com/hdquemada", 52 | "contributions": [ 53 | "content" 54 | ] 55 | }, 56 | { 57 | "login": "pkumars397", 58 | "name": "Prashant Kumar", 59 | "avatar_url": "https://avatars1.githubusercontent.com/u/45540448?v=4", 60 | "profile": "https://github.com/pkumars397", 61 | "contributions": [ 62 | "content" 63 | ] 64 | }, 65 | { 66 | "login": "harshloco", 67 | "name": "Harshpreet Singh", 68 | "avatar_url": "https://avatars1.githubusercontent.com/u/5271603?v=4", 69 | "profile": "https://github.com/harshloco", 70 | "contributions": [ 71 | "content" 72 | ] 73 | }, 74 | { 75 | "login": "VolailleInc", 76 | "name": "Abdul-Razak", 77 | "avatar_url": "https://avatars1.githubusercontent.com/u/36109125?v=4", 78 | "profile": "http://www.panafsoft.com", 79 | "contributions": [ 80 | "content" 81 | ] 82 | }, 83 | { 84 | "login": "jmannfeld", 85 | "name": "Jordan Mannfeld", 86 | "avatar_url": "https://avatars2.githubusercontent.com/u/16351524?v=4", 87 | "profile": "https://github.com/jmannfeld", 88 | "contributions": [ 89 | "content" 90 | ] 91 | }, 92 | { 93 | "login": "Lord-Aman", 94 | "name": "Aman", 95 | "avatar_url": "https://avatars1.githubusercontent.com/u/65647302?v=4", 96 | "profile": "https://github.com/Lord-Aman", 97 | "contributions": [ 98 | "content" 99 | ] 100 | }, 101 | { 102 | "login": "Muhammed-Rahif", 103 | "name": "Muhammed Rahif", 104 | "avatar_url": "https://avatars.githubusercontent.com/u/73386156?v=4", 105 | "profile": "http://muhammed-rahif.github.io", 106 | "contributions": [ 107 | "data", 108 | "content" 109 | ] 110 | }, 111 | { 112 | "login": "eltociear", 113 | "name": "Ikko Ashimine", 114 | "avatar_url": "https://avatars.githubusercontent.com/u/22633385?v=4", 115 | "profile": "https://bandism.net/", 116 | "contributions": [ 117 | "content" 118 | ] 119 | } 120 | ], 121 | "contributorsPerLine": 7, 122 | "projectName": "webDevsCom", 123 | "projectOwner": "WebDevsCom", 124 | "repoType": "github", 125 | "repoHost": "https://github.com", 126 | "skipCi": true 127 | } 128 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/** -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | "extends": ["plugin:react/recommended", "airbnb"], 7 | "globals": { 8 | "Atomics": "readonly", 9 | "SharedArrayBuffer": "readonly" 10 | }, 11 | "parserOptions": { 12 | "ecmaFeatures": { 13 | "jsx": true 14 | }, 15 | "ecmaVersion": 2018, 16 | "sourceType": "module" 17 | }, 18 | "plugins": ["react"], 19 | "rules": { 20 | "trailing-comma": 0 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI/CD 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | node-version: [12.x] 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v2 17 | - name: Set up Node.js ${{ matrix.node-version }} 18 | uses: actions/setup-node@v1 19 | with: 20 | node-version: ${{ matrix.node-version }} 21 | 22 | - name: Install dependencies 23 | run: npm install 24 | 25 | - name: Build 26 | run: npm run build 27 | 28 | - name: Deploy 29 | uses: s0/git-publish-subdir-action@develop 30 | env: 31 | REPO: git@github.com:WebDevsCom/webDevsCom.github.io.git 32 | BRANCH: master 33 | FOLDER: build 34 | SSH_PRIVATE_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | # Local Netlify folder 26 | .netlify -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run lint:test -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run prepush -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 14.17.0 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /build 2 | /coverage 3 | /node_modules/** -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "endOfLine": "lf", 3 | "semi": true, 4 | "singleQuote": false, 5 | "tabWidth": 2, 6 | "trailingComma": "all", 7 | "bracketSpacing": false 8 | } 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at kbinu42@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contribute 2 | 3 | > Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. 4 | 5 | If you're new to contribute to Open Source on GitHub, [this guide](https://guides.github.com/activities/contributing-to-open-source/) can help you get started. Please check out the [contribution guide](CONTRIBUTING.md) for more details on how issues and pull requests work. 6 | 7 | ### Steps to add Resources 8 | 9 | - go to [/src/data/resourcesData.js](https://github.com/WebDevsCom/webDevsCom/blob/master/src/data/resourcesData.js) 10 | - structure of Data to add 11 | 12 | ```javascript 13 | { 14 | id: 9, // +1 than last available resource data 15 | link: 16 | 'https://raw.githubusercontent.com/dipakkr/A-to-Z-Resources-for-Students/master/README.md', // raw url Link of Repo. Readme file 17 | repoName: 'A-to-Z-Resources-for-Students', // Available Repo. name 18 | description: 19 | 'Curated list of resources for college students. you should definitely check this out.', // Description of Resources 20 | repoOwnerName: 'dipakkr', // Repo. owner name(Id) or Repo. owner organisation 21 | repoOwner: 'Deepak Kumar', // Repo. owner full name or Repo. owner organisation 22 | category: ['web-dev', 'mob-dev', 'course', 'language'], // category from which resource belong (choose from below available categories) 23 | } 24 | ``` 25 | 26 | - available categories:- 27 | - web-dev 28 | - mob-dev 29 | - frontend 30 | - backend 31 | - language 32 | - project 33 | - course 34 | - podcast 35 | - interview 36 | - productive 37 | - data-science 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 web Developer Community 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WEBDEVSCOM 2 | 3 | [](#contributors-) 4 | 5 | 6 | > Community to help developers by providing them all kinds of free resources at one place. 7 | 8 | [](http://binu42.netlify.com/) 9 | [](https://app.netlify.com/sites/webdevscom/deploys) 10 |  11 | [](https://github.com/WebDevsCom/webDevsCom) 12 | [](https://github.com/prettier/prettier) 13 | 14 | #### [Looking for contributors in helping me to add this resources](https://github.com/WebDevsCom/webDevsCom/issues/9#issue-629936276) please not add more than 10 resources in one PR. 15 | 16 |
17 |
18 |
21 | View our Website on GitHub Pages | Website on Netlify. 22 |
23 | 24 | ## Main Libraries/Frameworks Used 25 | * [Bulma](https://bulma.io/documentation/components/card/) 26 | * [React](https://reactjs.org/) 27 | 28 | ## Installation 29 | if you have not installed nodeJS install it. then:- 30 |Binu kumar 🚇 💻 ⚠️ 🚧 🤔 |
94 | Jaydeep Khatri 🖋 |
95 | Zoltán Szőgyényi 🖋 |
96 | Jack Dolgin 🖋 |
97 | Hector Quemada 🖋 |
98 | Prashant Kumar 🖋 |
99 | Harshpreet Singh 🖋 |
100 |
Abdul-Razak 🖋 |
103 | Jordan Mannfeld 🖋 |
104 | Aman 🖋 |
105 | Muhammed Rahif 🔣 🖋 |
106 | Ikko Ashimine 🖋 |
107 |
11 | {text} 12 |
13 |40 | Do you want to contribute or add some resource Feel free to visit below 41 | links. 42 |
43 |Our contributors have aggregated all the information you need!
27 |38 | Take your UI/UX creative journey a little further. Find all 39 | the resources you need as a developer to create beautiful and 40 | memorable UI/UX. 41 |
42 |53 | Watch time tested and top coding channels on youtube. Learn 54 | from the best. Learn all the tricks of the game here. We have 55 | your back. 56 |
57 |68 | Here we give you links to resources of Frequently asked 69 | Interview Questions and their explainations with examples on 70 | how to answer them. 71 |
72 |84 | Pick from the pool of app development project ideas at all 85 | levels of programming. Learn and get Experience from Building 86 | them. 87 |
88 |99 | Have a look at our collection of top Developers Portfolio. We 100 | hope you will be inspired to put in more effort to acheive 101 | greatness. 102 |
103 |114 | Play around with a collection of hundreds of public APIs to 115 | ease your software and web development experiences. 116 |
117 |Contribute to this Open Source Project to Help Developers
127 |Special features of this website include...
176 |12 | 13 | Hello Developer, welcome home! 14 | 15 |
16 |20 | We have collected over 1000+ free resources to make your 21 | development journey hassle free Enjoy the experience. 22 |
23 |43 | Hello Developer, welcome home! 44 |
45 |49 | We have collected over 1000+ free resources to make your 50 | development journey hassle free Enjoy the experience. 51 |
52 |15 | {authorRepos[0].repoOwner} 16 |
17 |40 | {authorRepos[0].repoOwner} 41 |
42 | 47 | @ 48 | {authorRepos[0].repoOwnerName} 49 | 50 |53 | Resources available by 54 | {' '} 55 | {authorRepos[0].repoOwner} 56 |
57 | {authorRepos.map((repo) => ( 58 |{repo.repoName}
61 |
33 |
34 | {this.props.value}
35 |
36 |
37 | );
38 | }
39 | }
40 |
41 | CodeBlock.defaultProps = {
42 | language: '',
43 | };
44 |
45 | CodeBlock.propTypes = {
46 | value: PropTypes.string.isRequired,
47 | language: PropTypes.string,
48 | };
49 |
50 | export default CodeBlock;
51 |
--------------------------------------------------------------------------------
/src/Pages/ResourceREADME/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import ReactMarkdown from 'react-markdown';
3 | import Axios from 'axios';
4 | import Spinner from '../../Components/Spinner';
5 | import resources from '../../data/resourcesData';
6 | import CodeBlock from './code-blocks';
7 | import ReadmeUtilsBtn from './ReadmeUtilsBtn';
8 | import { slug } from 'github-slugger';
9 | import PdfContainer from './PdfContainer';
10 | import Page from '../../Components/Page';
11 | import NoData from '../../Components/NoData';
12 | import OtherReposByAuthorModal from './OtherReposByAuthorModal';
13 |
14 | const ResourceREADME = (props) => {
15 | const [markdown, setMarkdown] = useState('');
16 | const [repoInfo, setRepoInfo] = useState({});
17 | const [loading, setLoading] = useState(true);
18 | const [bookmarks, setBookMarks] = useState([]);
19 | const [isBookMarked, setBookMarked] = useState(false);
20 | const [isModalOpen, setModalOpen] = useState(false);
21 | const [authorRepos, setAuthorRepos] = useState([]);
22 |
23 | useEffect(() => {
24 | setBookMarks(JSON.parse(localStorage.getItem('bookmarks')));
25 | let BookMarked =
26 | bookmarks?.find((bookMarkId) => repoInfo?.id === bookMarkId);
27 | setBookMarked(BookMarked ? true : false);
28 |
29 | // Todo: need to make it better sometime later.
30 | if (loading === false) {
31 | const repos = [];
32 | resources.forEach((resource) => {
33 | if (resource.repoOwnerName === repoInfo?.repoOwnerName) {
34 | repos.push(resource);
35 | }
36 | });
37 |
38 | setAuthorRepos(repos);
39 |
40 | const h1 = document.querySelectorAll('#markdown h1');
41 | for (var i = 0; i < h1.length; i++) {
42 | h1[i].className = 'title is-2';
43 | h1[i].setAttribute('id', slug(h1[i].innerHTML));
44 | }
45 |
46 | const h2 = document.querySelectorAll('#markdown h2');
47 | for (i = 0; i < h2.length; i++) {
48 | h2[i].className = 'title is-3';
49 | h2[i].setAttribute('id', slug(h2[i].innerHTML));
50 | }
51 |
52 | const h3 = document.querySelectorAll('#markdown h3');
53 | for (i = 0; i < h3.length; i++) {
54 | h3[i].className = 'title is-4';
55 | h3[i].setAttribute('id', slug(h3[i].innerHTML));
56 | }
57 |
58 | const strong = document.querySelectorAll('#markdown strong');
59 | for (i = 0; i < strong.length; i++) {
60 | strong[i].setAttribute('id', slug(strong[i].innerHTML));
61 | }
62 |
63 | const table = document.querySelectorAll('#markdown table');
64 | for (i = 0; i < table.length; i++)
65 | table[i].className =
66 | 'table is-hoverable is-dark is-fullwidth is-striped';
67 |
68 | const images = document.querySelectorAll('img');
69 | for (i = 0; i < images.length; i++) {
70 | if (images[i].src.includes(window.location.origin)) {
71 | images[i].setAttribute(
72 | 'src',
73 | `https://raw.githubusercontent.com/${repoInfo.repoOwnerName}/${repoInfo.repoName
74 | }/master${images[i].src
75 | .replace(window.location.origin, '')
76 | .replace(window.location.pathname, '')
77 | .replace('/resources', '')}`
78 | );
79 | }
80 | }
81 |
82 | var el = document.querySelectorAll('#markdown a');
83 | for (i = 0; i < el.length; i++) {
84 | if (
85 | el[i].href.includes('./') ||
86 | (el[i].href.includes('.md') &&
87 | el[i].href.includes(window.location.origin))
88 | ) {
89 | el[i].setAttribute(
90 | 'href',
91 | `https://github.com/${repoInfo.repoOwnerName}/${repoInfo.repoName
92 | }/blob/master${el[i].href
93 | .replace(window.location.origin, '')
94 | .replace(window.location.pathname, '')
95 | .replace('/resources', '')}`
96 | );
97 | el[i].setAttribute('target', '_blank');
98 | } else if (!el[i].href.includes('#')) {
99 | el[i].setAttribute('target', '_blank');
100 | } else if (el[i].href.includes('#')) {
101 | el[i].setAttribute('href', el[i].href.toLowerCase());
102 | }
103 | }
104 | }
105 | // eslint-disable-next-line
106 | }, [loading, repoInfo]);
107 |
108 | const bookmarkIt = () => {
109 | setBookMarked(true);
110 | if (bookmarks === null) {
111 | localStorage.setItem('bookmarks', JSON.stringify([repoInfo.id]));
112 | } else {
113 | bookmarks.push(repoInfo.id);
114 | setBookMarks(bookmarks);
115 | localStorage.setItem('bookmarks', JSON.stringify(bookmarks));
116 | }
117 | };
118 |
119 | const removeBookmark = () => {
120 | setBookMarked(false);
121 | const bookMarks =
122 | bookmarks && bookmarks.filter((bookmarkId) => bookmarkId !== repoInfo.id);
123 | setBookMarks(bookMarks);
124 | localStorage.setItem('bookmarks', JSON.stringify(bookMarks));
125 | };
126 |
127 | useEffect(() => {
128 | setLoading(true);
129 | setModalOpen(false);
130 | const id = props.match.params.id;
131 | const repo = resources.find(
132 | (resource) => String(resource.id) === String(id)
133 | );
134 | setRepoInfo(repo);
135 | if (repo) {
136 | Axios.get(repo.link).then((markdown) => {
137 | setMarkdown(markdown.data);
138 | setLoading(false);
139 | });
140 | }
141 | }, [props.match.params.id]);
142 |
143 | useEffect(() => {
144 | isModalOpen
145 | ? document.querySelector('html').classList.add('is-clipped')
146 | : document.querySelector('html').classList.remove('is-clipped');
147 | }, [isModalOpen]);
148 |
149 | if (!repoInfo)
150 | return 34 | {repoName} 35 |
36 |64 | {repoOwner} 65 |
66 | 71 | @ 72 | {repoOwnerName} 73 | 74 |
69 | setSearchText(e.target.value)}
73 | placeholder={`Search for ${placeholder}`}
74 | value={searchText}
75 | />
76 |
77 |