Skip to content

Commit 2d7556a

Browse files
authored
Added setup guides for VS Code (#172)
1 parent 3ee40cc commit 2d7556a

File tree

3 files changed

+98
-4
lines changed

3 files changed

+98
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Editing with VS Code
3+
description: How to use Visual Studio Code to contribute to the Zen Browser documentation.
4+
---
5+
6+
Visual Studio Code (VS Code) is a popular and powerful code editor that works well for editing Zen Browser documentation, especially with the right extensions.
7+
8+
## Prerequisites
9+
10+
- [**Visual Studio Code**](https://code.visualstudio.com/) installed on your machine.
11+
- *Note: Popular forks of VS Code, such as [VSCodium](https://vscodium.com/), should also work well.*
12+
13+
## Recommended Extension: MDX
14+
15+
To get the best experience editing `.mdx` files in VS Code, we recommend installing the official MDX extension.
16+
17+
- **Extension Name:** MDX
18+
- **Publisher:** unifiedjs
19+
- **Marketplace Link:** [MDX - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx)
20+
21+
### Benefits
22+
23+
- **Syntax Highlighting:** Provides accurate syntax highlighting for both Markdown and JSX components within `.mdx` files.
24+
- **IntelliSense:** Offers autocompletion and suggestions for MDX syntax and potentially imported components.
25+
- **Error Checking:** Helps identify syntax errors in your MDX code.
26+
27+
### Installation
28+
29+
1. Open VS Code.
30+
2. Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window or by pressing `Ctrl+Shift+X` (Windows/Linux) or `Cmd+Shift+X` (macOS).
31+
3. Search for `mdx`.
32+
4. Click **Install** on the MDX extension by unifiedjs.
33+
34+
## Steps
35+
36+
1. **Open the Repository Folder**:
37+
- In VS Code, go to `File > Open Folder...` (or `File > Open...` on macOS).
38+
- Navigate to the cloned `docs` repository folder on your local machine and open it.
39+
40+
2. **Start Editing**:
41+
- Open VS Code's File Explorer (left sidebar) and navigate to these key directories:
42+
- **`content/docs/`** - Contains all documentation `.mdx` files you'll be editing
43+
- **`public/assets/`** - Stores images and static assets referenced in documentation
44+
- _**`src/`** - Contains site source code (no editing needed here)_
45+
- Select any `.mdx` file to begin editing. With the MDX extension installed, you'll get:
46+
- Syntax highlighting for Markdown and JSX
47+
- IntelliSense suggestions
48+
- Error checking
49+
<Callout type="warn" title="Image Paths">
50+
When adding images, reference them from `/assets` (not `/public/assets`). Example:
51+
```
52+
![Example Image](/assets/user-manual/image.png)
53+
```
54+
</Callout>
55+
56+
3. **Using Fumadocs Components**:
57+
- Our documentation uses [Fumadocs UI](https://fumadocs.vercel.app/docs/ui) components like `<Callout />`, `<Tabs />`, `<Steps />`, etc.
58+
- You can use these components directly within your `.mdx` files.
59+
- **Global Components:** Components like `<Callout />` are globally available and don't require an explicit import.
60+
- **Imported Components:** Components like `<Tabs />` or `<Steps />` need to be imported at the top of the `.mdx` file. Check existing files or the Fumadocs documentation for import examples.
61+
```ts
62+
import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
63+
import { Steps, Step } from 'fumadocs-ui/components/steps';
64+
```
65+
- Refer to the [Fumadocs UI Documentation](https://fumadocs.vercel.app/docs/ui) for details on available components and their usage.
66+
67+
4. **Run the Development Server** (Recommended):
68+
- Open a terminal within VS Code (`Terminal > New Terminal`).
69+
- Run the command `npm run dev`.
70+
- This will start the development server, usually accessible at `http://localhost:3000`.
71+
- The site will automatically update in your browser as you save changes to the `.mdx` files.
72+
73+
4. **Follow Contribution Steps**:
74+
- Once you've made your changes, follow the standard contribution steps outlined in the main [Docs Contribution Guide](/contribute/docs#writing-guidelines): commit your changes, push them to your fork, and create a pull request.
75+
76+
Using VS Code with the MDX extension provides a robust environment for contributing to the Zen Browser documentation.

content/docs/contribute/docs.mdx renamed to content/docs/contribute/docs/index.mdx

+15-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Before you begin, ensure you have the following tools installed:
1212
- [**Git**](https://git-scm.com/): Version control system to clone the repository and manage your code.
1313
- [**Node.js**](https://nodejs.org/): Required for building the NextJS site.
1414
- [**npm**](https://www.npmjs.com/): Node package manager, which comes with Node.js.
15-
- **IDE of your choice**: You can use any text editor or IDE of your choice.
15+
- [**IDE of your choice**](/contribute/docs/editing-with-vscode): You can use any text editor or IDE of your choice.
1616

1717
## 1. Fork the Repository
1818

@@ -42,7 +42,7 @@ This command installs all the necessary packages listed in the `package.json` fi
4242

4343
## 4. Open the Project in IDE
4444

45-
Open the cloned repository folder in your IDE to begin editing:
45+
Open the cloned repository folder in your IDE to begin editing. If you're using Visual Studio Code, check out our [VS Code setup guide](/contribute/docs/editing-with-vscode) for detailed instructions.
4646

4747
1. Open IDE.
4848
2. Select "Open Folder" or "File > Open Folder".
@@ -77,7 +77,17 @@ yarn dev
7777

7878
This command starts a local server running on `http://localhost:3000` that you can access from your browser. The site will automatically reload whenever you make changes to the Markdown files.
7979

80-
## 7. Commit and Push Your Changes
80+
## 7. Check the Build
81+
82+
Before committing your changes, ensure the documentation site builds successfully:
83+
84+
```bash
85+
npm run build
86+
```
87+
88+
This command will build the static site. If there are any errors, fix them before proceeding.
89+
90+
## 8. Commit and Push Your Changes
8191

8292
Once you are satisfied with your changes, commit them to your local repository:
8393

@@ -92,7 +102,7 @@ Push your changes to your forked repository:
92102
git push origin main
93103
```
94104

95-
## 8. Create a Pull Request
105+
## 9. Create a Pull Request
96106

97107
After pushing your changes, go to the original Zen Browser Documentation Repository and submit a pull request:
98108

@@ -110,6 +120,7 @@ Your pull request will be reviewed by the maintainers, and you may be asked to m
110120
- [Fumadocs Documentation](https://fumadocs.vercel.app/docs/ui)
111121
- [Contribution Guidelines](/contribute/contributing)
112122
- [Code of Conduct](/contribute/code-of-conduct)
123+
- [Editing with VS Code](/contribute/docs/editing-with-vscode)
113124

114125
---
115126

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"title": "Docs",
3+
"pages": [
4+
"editing-with-vscode",
5+
"..."
6+
]
7+
}

0 commit comments

Comments
 (0)