Skip to content

Commit e4026c9

Browse files
adiati98BekahHW
andauthored
feat: update contributing guidelines (OpenSource-Communities#226)
* fix: replace instructions to install and run docsify with Docusaurus * fix: remove method 2 of running docsify * feat: add a note that the project is built with Docusaurus * feat: add an instruction to add front matter * fix: update instruction to add sidebar * fix: markdown link example * fix: broken links * fix: yaml format to follow the existing * fix: grammar * fix: markdown link example * fix: add /learn to the localhost path --------- Co-authored-by: BekahHW <34313413+BekahHW@users.noreply.github.com>
1 parent 1b78138 commit e4026c9

File tree

1 file changed

+46
-71
lines changed

1 file changed

+46
-71
lines changed

contributing/CONTRIBUTING.md

Lines changed: 46 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ We actively welcome your PRs. However, before working on changes, you must ensur
6565

6666
### Setup the Project Locally
6767

68-
1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [intro repository](github.com/open-sauced/intro) to your own GitHub account.
68+
1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [intro repository](https://github.com/open-sauced/intro) to your own GitHub account.
6969
2. [Clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) the forked repository to your local machine.
7070

7171
```bash
@@ -86,80 +86,32 @@ We actively welcome your PRs. However, before working on changes, you must ensur
8686

8787
Replace "YOUR-BRANCH-NAME" with a descriptive name for your branch — for example, `feat/add-submit-button`.
8888

89-
5. Run the project.
89+
5. Install the dependencies and run the project.
9090

91-
### Running the Project Locally
91+
### Local Development
9292

93-
Running the project locally is essential to see your changes in real-time and test them thoroughly when you're contributing.
94-
95-
We recommend one of these two methods for running the project on your local machine:
96-
97-
1. Using the [docsify CLI](https://docsify.js.org/#/).
98-
2. Leveraging Visual Studio Code's [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) extension.
99-
100-
#### Method 1: Using the docsify CLI
101-
102-
1. **Install Node.js**.
93+
> [!NOTE]
94+
> This project is built with [Docusaurus](https://docusaurus.io/).
10395
104-
You can download it from the official [Node.js website](https://nodejs.org/).
105-
106-
2. **Install docsify globally**.
107-
108-
It's highly recommended to install docsify globally. In your terminal, run the following command:
109-
110-
```bash
111-
npm install -g docsify-cli
112-
```
96+
Running the project locally is essential to see your changes in real-time and test them thoroughly when you're contributing.
11397

114-
3. **Run the project**.
98+
1. **Install the dependencies and run the project locally**.
11599

116100
```bash
117-
docsify serve docs
101+
npm ci
102+
npm start
118103
```
119104

120-
This command will start a local development server, and you can access the project in your web browser at `http://localhost:3000`.
105+
After the local development server is ready, it will automatically open the project at `http://localhost:3000/learn` on your browser.
121106

122-
4. **Make and test changes**.
107+
2. **Make and test changes**.
123108

124109
With the local server running, you can make changes to the files and immediately see the results in your browser. Test your changes thoroughly.
125110

126-
5. **Stop the server**.
111+
3. **Stop the server**.
127112

128113
After completing and testing the changes, you can stop the local server by pressing `Ctrl + C` in the terminal.
129114

130-
#### Method 2: Using Live Server Extension on Visual Studio Code (VS Code)
131-
132-
Live Server extension allows you to launch a local development server and preview your changes in real time in your browser.
133-
134-
1. **Install Visual Studio Code**.
135-
136-
Download [Visual Studio Code](https://code.visualstudio.com/) and install it if you haven't.
137-
138-
2. **Open the project in VS Code**.
139-
140-
Launch VS Code, open the project folder by selecting "File" > "Open Folder", and choose the project directory.
141-
142-
3. **Install the Live Server extension**.
143-
144-
- Click "View" on the top bar of the VS Code.
145-
- Click "Extensions".
146-
147-
Alternatively, press the shortcut `Ctrl + Shift + X` to open the "Extensions" menu.
148-
149-
- Search for "Live Server" by Ritwick Dey and install it.
150-
151-
4. **Launch the Live Server**.
152-
153-
Click the "Go Live" button in the bottom-right corner of the VS Code window. It will open a new tab on your browser at a local address. Then, click the "docs" folder to see the project in live mode.
154-
155-
5. **Make and test changes**.
156-
157-
With the Live Server running, you can make changes to the files using VS Code, and the changes will be automatically reflected in your browser. Test your changes thoroughly.
158-
159-
6. **Stop the Live Server**.
160-
161-
When you're done testing or making changes, you can stop the Live Server by clicking the "Port: 5500" button in the VS Code status bar at the bottom-right corner.
162-
163115
## Working with the Content
164116

165117
The contents of our courses are written in [Markdown](https://www.markdownguide.org/), a lightweight and easy-to-use markup language that allows you to format text in a readable and visually appealing way.
@@ -168,7 +120,7 @@ Please read the "[Using Markdown for This Project](#using-markdown-for-this-proj
168120

169121
### Adding Definitions to the Glossary
170122

171-
If you add definitions to the "Glossary" chapter in the [Intro to Open Source](./intro-to-oss/glossary.md) or [Becoming a Maintainer](./becoming-a-maintainer/glossary.md) course, ensure the definitions are added **alphabetically**.
123+
If you add definitions to the "Glossary" chapter in the [Intro to Open Source](../docs/intro-to-oss/glossary.md) or [Becoming a Maintainer](../docs/becoming-a-maintainer/glossary.md) course, ensure the definitions are added **alphabetically**.
172124

173125
### Adding a New Section to a Chapter
174126

@@ -190,38 +142,61 @@ Follow these steps to add a new chapter to our course:
190142

191143
> **NOTE**: Be sure to follow naming conventions. Notice that file names are not capitalized, and there are hyphens in place of spaces between words.
192144
193-
2. **Write content**.
145+
2. **Add front matter**.
146+
147+
At the beginning of the file, add front matter that is enclosed by three dashes `---` with below variables:
148+
149+
- `id`: The ID is used to refer to a document when hand-writing sidebars. You can use the file name as an ID.
150+
- `title`: The chapter's title (`h1`).
151+
- `sidebar_label`: The title on the sidebar.
152+
- `keywords`: Keywords for the topics in the chapter.
153+
154+
Here is an example:
155+
156+
```yml
157+
---
158+
id: what-is-open-source
159+
title: "What is Open Source?"
160+
sidebar_label: "What is Open Source"
161+
keywords: ["what is open source", "open source definition", "open source licenses explained", "open source history", "open source evolution", "Open Source", "Open Source Community"]
162+
---
163+
```
164+
165+
3. **Write content**.
194166

195167
Open the newly created Markdown file in a text editor and write the content for your chapter using the Markdown syntax. You can include headings, text, images, links, lists, and other elements to present your information effectively.
196168

197169
> **NOTE**: There should only be **one** `heading 1` in each file.
198170
199-
3. **Test your changes**.
171+
4. **Test your changes**.
200172

201173
Before finalizing your new chapter, you should test your changes locally. You can build or render the project to ensure your new chapter appears as expected within the course structure.
202174

203-
4. **Update the sidebar**.
175+
5. **Update the sidebar**.
204176

205177
After you add a new chapter, you must also add it to the sidebar for the users to discover the content.
206178

207179
#### Adding New Chapters to the Sidebar
208180

209-
The sidebar in our course serves as a navigation menu. So, when you add a new chapter to the course, it's important to update the sidebar by including the link to the chapter. That way, users can navigate to the content seamlessly.
181+
The sidebar serves as a navigation menu. So, when you add a new chapter to a course, it's important to update the sidebar by including the link to the chapter. That way, users can navigate to the content seamlessly.
210182

211183
Follow these steps to add new chapters to the sidebar:
212184

213-
1. Open the `_sidebar.md` file in the course directory.
185+
1. Open the `sidebars.js` file located on the root.
214186
2. **Add the new chapter link**.
215187

216-
- Insert your new chapter in the list. If you're unsure where best to put it, you can comment on the issue and tag the `@open-sauced/docs` maintainers to ask for help.
188+
- Insert your new chapter in the `items` array of the related course. If you're unsure where best to put it, you can comment on the issue and tag the `@open-sauced/docs` maintainers to ask for help.
217189
- Use the below format to add the link to the new chapter:
218190

219-
```markdown
220-
- [Intro](intro.md)
191+
```text
192+
'FOLDER-NAME/ID',
221193
```
222194
223-
- Replace `Intro` with the title of your new chapter. _Be sure to capitalize the title_.
224-
- Replace `intro.md` with the name of the Markdown file of your new chapter.
195+
Replace `FOLDER-NAME` with the course's folder name and `ID` with the `id` in the file's front matter. For example:
196+
197+
```javascript
198+
'intro-to-oss/what-is-open-source',
199+
```
225200
226201
3. **Create a pull request**.
227202

0 commit comments

Comments
 (0)