Skip to content

Commit 206b927

Browse files
authored
Merge pull request #85 from chrisweb/preview
Preview to main
2 parents cec58c7 + 7e138e9 commit 206b927

File tree

4 files changed

+52
-19
lines changed

4 files changed

+52
-19
lines changed

app/web_development/posts/vscode/page.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,28 @@ The easiest way to save a file in VSCode is to use the keyboard shortcut `Ctrl+S
177177
> [!MORE]
178178
> [VSCode "Editing basics" documentation](https://code.visualstudio.com/docs/editor/codebasics)
179179
180+
## Comment out / uncomment code
181+
182+
One of the must used shortcuts is probably the **comment out / uncomment toggle shortcut**
183+
184+
* first select the code you want to comment out or uncomment
185+
* then either use the shortcut `Ctrl+#` (macOS: `⌘#`, Linux: `Ctrl+#`)
186+
* or if you prefer using the command, [open the commend palette](#vscode-command-palette), start typing `Toggle Line Comment` until the command appears in the list and then select it.
187+
188+
VSCode will **comment out** out the select lines of code if they are NOT commented out yet, if they are commented out VSCode will uncomment them
189+
190+
VSCode will try to use language specific comments, meaning it will for example use `<!-- HTML comments -->` in HTML and `// single-line comments` in javascript (typescript).
191+
192+
> [!NOTE]
193+
> If you prefer using a multi-line comment, then use the related **toggle block comment** command shortcut `Ctrl+Shift+A` (macOS: `⇧⌘A`, Linux: `Ctrl+Shift+A`).
194+
180195
## Open a VSCode terminal
181196

182197
VSCode has a terminal (command line tool) that, by default, is closed. To open the terminal, click on **View** in the top navigation bar and then **Terminal**
183198

184199
Or use the keyboard shortcut `` Ctrl+` `` (macOS: `` ⌃` ``, Linux: `` Ctrl+` ``)
185200

186-
The third option is to use the command palette by pressing using the keyboard shortcut `Ctrl+Shift+p` (macOS: `⇧⌘P`, Linux: `Ctrl+Shift+P`) and then typing `view: toggle terminal`.
201+
The third option is to use the command palette, [open the commend palette](#vscode-command-palette), start typing `view toggle terminal` until the command appears in the list and then select it.
187202

188203
> [!MORE]
189204
> [VSCode "terminal" documentation](https://code.visualstudio.com/docs/terminal/basics)

app/web_development/tutorials/next-js-static-first-mdx-starterkit/mdx-plugins/page.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ This is when I bumped into something I assume is a bug on windows:
205205
Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
206206
```
207207

208-
Confirmed, on Mac the code works 🎉 but this also confirms there is a windows bug 😭 (TODO: I did not find a ticket for this bug, so I will finish and publish the tutorial, then check again if a ticket exists, if not create one, I found a similar PR but in an other area of Next.js, the solution is probably similar: [use pathToFileUrl to make esm import()s work with absolute windows paths](https://github.com/vercel/next.js/pull/64386/files))
208+
Confirmed, on Mac the code works 🎉 but this also confirms there is a windows bug 😭
209+
210+
I have opened an [Issue (#74564)](https://github.com/vercel/next.js/issues/74564) on GitHub regarding this problem and I suggested a fix in this [PR #74565](https://github.com/vercel/next.js/pull/74565)
209211

210212
### tldr
211213

next.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const nextConfig = (phase) => {
2626
})*/
2727

2828
// https://rehype-pretty-code.netlify.app/
29+
/** @type {import('rehype-pretty-code').Options} */
2930
const rehypePrettyCodeOptions = {
3031
// VSCode "SynthWave '84" theme
3132
theme: 'synthwave-84',
@@ -44,6 +45,7 @@ const nextConfig = (phase) => {
4445
}
4546

4647
// https://github.com/chrisweb/remark-table-of-contents#options
48+
/** @type {import('remark-table-of-contents').IRemarkTableOfContentsOptions} */
4749
const remarkTableOfContentsOptions = {
4850
containerAttributes: {
4951
id: 'articleToc',
@@ -73,11 +75,13 @@ const nextConfig = (phase) => {
7375
}
7476

7577
// https://github.com/remarkjs/remark-gfm
78+
/** @type {import('remark-gfm').Options} */
7679
const remarkGfmOptions = {
7780
singleTilde: false,
7881
}
7982

8083
// https://github.com/chrisweb/rehype-github-alerts
84+
/** @type {import('rehype-github-alerts').DefaultBuildType} */
8185
const myGithubAlertBuild = (alertOptions, originalChildren) => {
8286

8387
const alert = {
@@ -135,6 +139,7 @@ const nextConfig = (phase) => {
135139

136140
}
137141

142+
/** @type {import('rehype-github-alerts').IOptions} */
138143
const rehypeGithubAlertsOptions = {
139144
supportLegacy: false,
140145
build: myGithubAlertBuild,
@@ -169,6 +174,7 @@ const nextConfig = (phase) => {
169174
},
170175
})
171176

177+
/** @type {import('next').NextConfig} */
172178
const nextConfigOptions = {
173179
reactStrictMode: true,
174180
poweredByHeader: false,

package-lock.json

Lines changed: 27 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)