Skip to content

Commit 8c047e7

Browse files
authored
Site Refactoring (#720)
* chore(deps): bump dependencies & switch to pnpm * feat: replace TutorialAuthors & Contributors by TutorialCredits * feat: add prettier * refactor: prettier * fix: broken exponent
1 parent a24b3ab commit 8c047e7

File tree

752 files changed

+24182
-28020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

752 files changed

+24182
-28020
lines changed

.github/issue_template.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ If you want to request a topic on LeetCode The Hard Way
44

55
- State the topic
66

7-
If you want to take the assignment as well
7+
If you want to take the assignment as well
88

99
- Suggest the markdown location
1010
- Suggest a few LC problems on this topic
1111

12+
## Solution
1213

13-
## Solution
14-
15-
You **DON'T** need to create an issue and ask for assignment. Just create a pull request. Issues created for solutions will be closed directly.
14+
You **DON'T** need to create an issue and ask for assignment. Just create a pull request. Issues created for solutions will be closed directly.

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Provide summary of changes with issue number if any.
66

77
**If you haven't fulfilled the below requirements or even delete the entire checklist, your PR won't be reviewed and will be closed without notice. Regular contributors (with 10+ PRs) can skip this part.**
88

9-
### General
9+
### General
1010

1111
- [ ] This Pull Request is all my own work. (You'll be blacklisted if you are caught for plagiarism.)
1212
- [ ] I've read [CONTRIBUTING.md](https://github.com/wingkwong/leetcode-the-hard-way/blob/main/CONTRIBUTING.md)
@@ -18,7 +18,7 @@ Provide summary of changes with issue number if any.
1818
### Tutorial
1919

2020
- [ ] I've read and followed the [Tutorial Template](https://github.com/wingkwong/leetcode-the-hard-way/blob/main/CONTRIBUTING.md#tutorial-template)
21-
- [ ] I've explained my topic well with 2 - 3 LC problems and no external problems are used.
21+
- [ ] I've explained my topic well with 2 - 3 LC problems and no external problems are used.
2222
- [ ] I've provided the full working solutions to the problems used in this tutorial.
2323
- [ ] I've provided suggested problems at the end with the given format. See [here](https://raw.githubusercontent.com/wingkwong/leetcode-the-hard-way/main/tutorials/math/number-theory/binary-exponentiation.md) as an example. If the target solution is not available, leave `solutionLink` blank.
2424
- [ ] I've given credits / references if I use external resources. (For an image, give credit under it. Otherwise, add a new section called References at the end (after Suggested Problems).)

.github/workflows/deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ jobs:
3636
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
3737
user_name: wingkwong
3838
user_email: [email protected]
39-

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"bracketSameLine": false,
3+
"printWidth": 80,
4+
"proseWrap": "never",
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

CONTRIBUTING.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,46 @@ Don't reply on markdown editor. Start the application locally to make and verify
66

77
```bash
88
cd leetcode-the-hard-way
9-
npm i
9+
npm i
1010
npm run start
1111
# By default, a browser window will open at http://localhost:3000/.
1212
```
1313

14-
## Before Creating a PR
14+
## Before Creating a PR
1515

1616
See the [Checklist](https://github.com/wingkwong/leetcode-the-hard-way/blob/main/.github/pull_request_template.md#checklist).
1717

1818
## Tutorial Template
1919

2020
Tutorials markdown files are stored under `./tutorials`.
2121

22-
````md
22+
```md
2323
---
2424
title: '<TITLE>'
2525
description: '<DESCRIPTION_OF_THE_TOPIC>'
2626
hide_table_of_contents: true
2727
---
2828

29-
<TutorialAuthors names="@<YOUR_ALIAS>"/>
29+
<TutorialCredits authors="@<YOUR_ALIAS>"/>
3030

3131
## Overview
3232

3333
// TODO: Overview of the topic
3434

35-
// DO NOT COPY FROM OTHER EXTERNAL SITES
36-
// DO NOT USE RANDOM EXAMPLES OR EXAMPLES FROM OTHER SITES
35+
// DO NOT COPY FROM OTHER EXTERNAL SITES // DO NOT USE RANDOM EXAMPLES OR EXAMPLES FROM OTHER SITES
3736

38-
// TODO: Complexity Analysis
39-
// TODO: Walk through the topic using 2 - 3 LC problems
37+
// TODO: Complexity Analysis // TODO: Walk through the topic using 2 - 3 LC problems
4038

41-
### Example : [<PROBLEM_ID> - <PROBLEM_TITLE>](<LC_LINK>)
39+
### Example : [<PROBLEM_ID> - <PROBLEM_TITLE>](LC_LINK)
4240

4341
> <PROBLEM STATEMENT>
4442

45-
// TODO: Your explanation
46-
// TODO: Your solution to the problem
43+
// TODO: Your explanation // TODO: Your solution to the problem
4744

4845
// TODO: add Suggested Problems (See the examples below to learn how to render)
49-
````
46+
```
5047

51-
Examples:
48+
Examples:
5249

5350
- [binary-exponentiation.md](https://raw.githubusercontent.com/wingkwong/leetcode-the-hard-way/main/tutorials/math/number-theory/binary-exponentiation.md)
5451

@@ -60,13 +57,11 @@ Examples:
6057
- File name format: `<PROBLEM_ID>-<PROBLEM_TITLE>-<DIFFICULTY>.md`, e.g. `0202-happy-number-easy.md`
6158

6259
````md
63-
// The Meta and Problem Statement can be generated by using a Chrome extension under `converter` locally.
64-
// If you do not know how to do it, leave it blank and @wingkwong will help add them.
60+
// The Meta and Problem Statement can be generated by using a Chrome extension under `converter` locally. // If you do not know how to do it, leave it blank and we will help add them.
6561

6662
## Approach 1: <APPROACH_NAME>
6763

68-
// TODO: Detailed Explanations / Line by Line Explanations in code
69-
// TODO: Complexity Analysis
64+
// TODO: Detailed Explanations / Line by Line Explanations in code // TODO: Complexity Analysis
7065

7166
<Tabs>
7267
<TabItem value="cpp" label="C++">
@@ -97,8 +92,7 @@ Examples:
9792

9893
## Approach 2: <APPROACH_NAME> (ADD IT IF NECESSARY)
9994

100-
// TODO: Detailed Explanations / Line by Line Explanations in code
101-
// TODO: Complexity Analysis
95+
// TODO: Detailed Explanations / Line by Line Explanations in code // TODO: Complexity Analysis
10296

10397
<Tabs>
10498
<TabItem value="cpp" label="C++">
@@ -128,7 +122,7 @@ Examples:
128122
</Tabs>
129123
````
130124

131-
Examples:
125+
Examples:
132126

133127
- [0191-number-of-1-bits-easy.md](https://raw.githubusercontent.com/wingkwong/leetcode-the-hard-way/main/solutions/0100-0199/0191-number-of-1-bits-easy.md)
134128

@@ -138,4 +132,4 @@ Examples:
138132

139133
- If your content includes variables or math equations, please highlight it with LaTex syntax. See [binary-exponentiation.md](https://raw.githubusercontent.com/wingkwong/leetcode-the-hard-way/main/tutorials/math/number-theory/binary-exponentiation.md) as an example.
140134

141-
- If you have used other resources from external sites, give references at the end.
135+
- If you have used other resources from external sites, give references at the end.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img align="left" width="240" height="360" src="https://user-images.githubusercontent.com/35857179/168307611-1b28018b-fc98-4cff-88a6-d8312ac7bce6.png">
44

5-
## About
5+
## About
66

77
Welcome to "LeetCode The Hard Way," the ultimate resource for those looking to improve their skills in data structures and algorithms! Our website is dedicated to providing comprehensive tutorials and detailed solutions to some of the most challenging problems in LeetCode. Whether you're a student looking to ace your next exam or a professional seeking to level up your coding skills, our tutorials and solutions are designed to help you succeed. Our content covers a range of popular programming languages, so you can learn and practice using the language of your choice.
88

config.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"index_name": "leetcode-the-hard-way",
3-
"start_urls": ["https://leetcodethehardway.com/"],
4-
"selectors": {
5-
"lvl0": "",
6-
"lvl1": "h1",
7-
"lvl2": "h2",
8-
"lvl3": "h3",
9-
"text": "article div,article p,article theme-code-block"
10-
}
11-
}
2+
"index_name": "leetcode-the-hard-way",
3+
"start_urls": ["https://leetcodethehardway.com/"],
4+
"selectors": {
5+
"lvl0": "",
6+
"lvl1": "h1",
7+
"lvl2": "h2",
8+
"lvl3": "h3",
9+
"text": "article div,article p,article theme-code-block"
10+
}
11+
}

converter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# LeetCode The Hard Way - Converter
22

3-
Chrome Extension to convert LeetCode problems into LTHW format. Originally work is done by [crx-leetmark](https://github.com/crimx/crx-leetmark).
3+
Chrome Extension to convert LeetCode problems into LTHW format. Originally work is done by [crx-leetmark](https://github.com/crimx/crx-leetmark).

converter/background.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
2-
switch (msg.type) {
3-
case 'page_action_show':
4-
if (sender.tab && sender.tab.id)
5-
chrome.pageAction.show(sender.tab.id)
6-
sendResponse()
7-
return
8-
}
9-
})
2+
switch (msg.type) {
3+
case 'page_action_show':
4+
if (sender.tab && sender.tab.id) chrome.pageAction.show(sender.tab.id);
5+
sendResponse();
6+
return;
7+
}
8+
});

0 commit comments

Comments
 (0)