You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/style-guide/contributions.mdx
+26-61Lines changed: 26 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,89 +4,54 @@ description: |
4
4
sidebar:
5
5
order: 1
6
6
---
7
+
import { Details } from"~/components";
7
8
8
9
The [Cloudflare Docs](https://developers.cloudflare.com/) are open source and hosted on the [cloudflare-docs repository](https://github.com/cloudflare/cloudflare-docs) on GitHub. This means that anyone, including those who are not part of the Cloudflare organization, can contribute to them. We welcome all suggestions that help keep our docs high quality and up to date.
9
10
10
-
To contribute to our docs, you will need to [create an account on GitHub](https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github) (if you do not have one already) and log in. Then you have two options:
11
-
***[Create a GitHub issue](#create-a-github-issue)** if you want to quickly submit a general suggestion.
12
-
***[Create a GitHub pull request](#create-a-github-pull-request)** if you have a specific edit you want to make to a specific doc or docs. This option may require some setup, depending on what method you use.
11
+
To contribute to our docs, you will need to [create an account on GitHub](https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github) (if you do not have one already) and log in. Then you have three options:
12
+
*[GitHub issue](#create-a-github-issue): Quickly submit a general suggestion.
13
+
*[Quick edit (edit button)](#quick-edit): Quickly open a pull request. This is best if you want to edit a single page in your web browser, and do not need to preview your changes.
14
+
*[Full development](#full-development): Open a pull request. This is best if you want to edit multiple pages and preview your changes. This can be done in your web browser (with [Codespaces](https://docs.github.com/codespaces)) or on your local machine (with [Visual Studio Code](https://code.visualstudio.com/)).
13
15
14
16
In addition to using the [Cloudflare Style Guide](/style-guide/) for guidance on grammar and style, we recommend browsing our [components](/style-guide/components/) to add additional formatting such as [notes](/style-guide/documentation-content-strategy/component-attributes/notes-tips-warnings/) and [code blocks](/style-guide/components/code/).
15
17
16
18
## Create a GitHub issue
17
19
To create a GitHub issue:
18
-
1.[Log in to GitHub](https://github.com/login) and go to the [cloudflare-docs repo](https://github.com/cloudflare/cloudflare-docs).
20
+
1.[Log in to GitHub](https://github.com/login) and go to the [cloudflare-docs repository](https://github.com/cloudflare/cloudflare-docs).
19
21
2. Select **Issues** and then **New issue**.
20
22
3. Select the issue type, fill out the form, and select **Create**.
21
23
22
24
[Learn more about creating GitHub issues.](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-an-issue)
23
25
24
-
## Create a GitHub pull request
25
-
There are several methods you can use to create a pull request:
26
-
***[Edit page](#edit-page)**: This is best if you only want to edit one page, only want to use your web browser, and do not need to preview your changes.
27
-
***[Create with Codespace](#create-with-codespace)**: This is best if you want to edit multiple pages, only want to use your web browser, and want to preview your changes.
28
-
***[Edit locally](#edit-locally)**: This more advanced method requires setting up a local environment. Like the Codespace method, it allows you to edit multiple pages and preview your changes.
29
-
30
-
[Learn more about creating pull requests on GitHub.](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
31
-
32
-
### Edit page
33
-
To create a GitHub pull request using the edit page method:
26
+
## Quick edit
27
+
To quickly open a pull request using the edit button:
34
28
1.[Log in to GitHub](https://github.com/login).
35
-
2. Go to the page you want to edit in the [Cloudflare Docs](https://developers.cloudflare.com/). Every page in the Cloudflare Docs (including this one) has an **Edit** button on the right sidebar and an **Edit page** button on the very bottom of the page.
36
-
3. Select either **Edit** or **Edit page** on the page you want to edit.
29
+
2. Go to the page you want to edit in the [Cloudflare Docs](https://developers.cloudflare.com/)
30
+
3. Select <Detailsheader="**Edit** or **Edit page**">Every page in the Cloudflare Docs (including this one) has an **Edit** button on the right sidebar and an **Edit page** button on the very bottom of the page.
The first time you create a pull request in the cloudflare-docs repo, you will see a GitHub landing page that says "You need to fork this repository to propose changes." When you see this prompt, select **Fork this repository**. After you create the fork, all future pull requests for cloudflare-docs will write to a new branch in your fork.
34
+
The first time you create a pull request in the cloudflare-docs repo, you will see a GitHub landing page that says "You need to fork this repository to propose changes." Select **Fork this repository**. All of your future pull requests for cloudflare-docs will write to a new branch on your fork.
40
35
:::
41
36
4. Make your edits and select **Commit changes**.
42
37
5. In the form, update the **Commit message** with the product you changed in brackets and a brief description of your changes. For example “[Images] Fixed broken link."
43
38
6. Update the **Extended description** with more details about what you changed and why. The more details, the better.
To create a GitHub pull request using the create with Codespace method:
48
-
1.[Log in to GitHub](https://github.com/login) and go to the [cloudflare-docs repo](https://github.com/cloudflare/cloudflare-docs).
49
-
2. Select the **Code** dropdown > **Codespaces** tab > **Create codespace on production**. A Codespace will open on the main `production` branch.
50
-
3. Make sure you are on the latest version of `production`. To do so, select the **Source Control** icon in the sidebar > the ellipsis next to **Changes** > **Pull**.
51
-
4. Select the current branch (in this case, `production`) from the bar at the bottom of the window > type a name for your new branch > **Create new branch**.
52
-
:::note
53
-
You cannot make changes on the main `production` branch.
54
-
:::
55
-
5. Select the explorer icon in the left sidebar.
56
-
6. Go to **src** > **content** > **docs** > and locate and select the mdx file you want to edit. The page's markdown opens.
57
-
7. Make your edits.
58
-
8. To preview your changes, type `npm run dev` into the Codespace terminal. A link will appear in the terminal, `https://localhost:1111/`, where you can preview your changes. This link automatically updates with any new edits you make.
59
-
:::note
60
-
When using `npm run dev` for the first time, follow the prompts in your terminal to install [Astro](https://astro.build/) and `npm` to your Codespace. If you are not prompted or if you are experiencing errors, install `npm` yourself with the command `npm i`.
61
-
:::
62
-
9. To stage your changes, select **Source Control** in the left sidebar and select the plus sign next to the file name under **Changes**.
63
-
10. To commit your changes, enter a commit message in the text field that briefly describes your changes, and then select **Commit** > **Publish Branch** > **origin**.
64
-
11. Return to GitHub and select **Compare & pull request** next to your pull request.
65
-
12. Update the title with the product you changed in brackets and a brief description of your changes. For example, “[Images] Fixed broken link." For the description, add more details about what you changed and why. The more details, the better.
66
-
13. Select **Create pull request**.
67
-
68
-
[Learn more about GitHub Codespaces.](https://docs.github.com/en/codespaces/quickstart)
69
-
70
-
### Edit locally
71
-
To create a GitHub pull request using the edit locally method, first set up the following local environment:
72
-
* Install Node.js (version 22 or later). We recommend that you install Node.js and `npm` with [Volta](https://volta.sh/) because Volta makes it easy to manage and switch between Node versions. Alternatively, you can [install directly from Node.js](https://nodejs.org/en).
73
-
```bash
74
-
$ curl https://get.volta.sh | bash
75
-
$ volta install node@22
76
-
```
77
-
* Open the project directory and install all required dependencies. You can use `npm`, which came bundled with your Node.js installation, or any other package manager.
78
-
```bash
79
-
$ npm install
80
-
```
81
-
In addition to your project dependencies, a file called `package-lock.json` is also generated, which ensures that everyone uses the exact same dependency versions. Make sure to commit `package-lock.json` to git whenever it changes.
82
-
83
-
After setup, follow the same process as the **[Codespace method](#create-with-codespace)**:
84
-
1. Pull production
85
-
2. Create a new branch
86
-
3. Stage your changes
87
-
4. Commit your changes
88
-
5. Publish the changes
89
-
6. Create your pull request on GitHub
41
+
## Full development
42
+
To edit and open a pull request with the full development workflow:
43
+
1.[Log in to GitHub](https://github.com/login) and [fork the cloudflare-docs repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
44
+
2. If you are editing in your web browser (with [Codespaces](https://docs.github.com/en/codespaces)), move on to step 3.
45
+
<br/>If you are editing on your local machine (with [Visual Studio Code](https://code.visualstudio.com/)):
46
+
* (Required) Install [Node.js](https://nodejs.org/en) (version 22 or later).
47
+
* (Recommended, but not required) Install [Volta](https://volta.sh/) for easier package management.
48
+
* (Required) [Clone the fork to your local machine.](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
49
+
3.[Create a branch from your fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) (or from your clone).
50
+
3. Make your edits.
51
+
4. (Optional) Preview your edits. This requires installing `npm`. Follow the prompts to install it or run `npm install`. A link will appear in the terminal, `https://localhost:1111/`, where you can preview your edits. This link automatically updates with any new edits you make.
52
+
5.[Commit your changes](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-source-control-in-your-codespace).
53
+
6.[Push your commits](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) to your branch and then back to your fork.
54
+
7. Return to GitHub and [create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) from your committed changes. In the description form, add the product you changed in brackets and a brief description of your changes. For example “[Images] Fixed broken link."
90
55
91
56
## After you create an issue or PR
92
57
After you open an issue or PR, a member of the Cloudflare organization will review your suggestion. Here is what to expect:
0 commit comments