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: docs/contribute/locally.md
+35-29Lines changed: 35 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,21 @@
3
3
Follow these steps to contribute to Elastic docs.
4
4
5
5
*[Prerequisites](#prerequisites)
6
-
*[Step 1: Install `docs-builder`](#step-one)
7
-
*[Step 2: Clone a content repository](#step-two)
8
-
*[Step 3: Serve the documentation](#step-three)
9
-
*[Step 4: Write the docs](#step-four)
10
-
*[Step 5: Push your changes](#step-five)
6
+
*[Install `docs-builder`](#install-docs-builder)
7
+
*[Clone a content repository](#clone-content)
8
+
*[Build the docs](#build-the-docs)
9
+
*[Write the docs](#write-docs)
10
+
*[Push your changes](#push-changes)
11
11
12
-
## Prerequisites
12
+
## Prerequisites[#prerequisites]
13
13
14
14
To write and push updates to Elastic documentation, you need the following:
15
15
16
16
1.**A code editor**: we recommend [Visual Studio Code](https://code.visualstudio.com/download)
17
17
1.**Git installed on your machine**: learn how [here](https://github.com/git-guides/install-git)
18
18
1.**A GitHub account**: sign up [here](https://github.com/)
19
19
20
-
## Install `docs-builder`[#step-one]
20
+
## Install `docs-builder`[#install-docs-builder]
21
21
22
22
There are two different ways to install and run `docs-builder`:
23
23
@@ -54,8 +54,13 @@ This guide uses the first option. If you'd like to clone the repository and buil
54
54
```sh
55
55
docs-builder serve
56
56
```
57
+
57
58
The path to the `docset.yml` file that you want to build can be specified with `-p`.
58
59
60
+
:::{important}
61
+
Run `docs-builder` without `serve` to run a full build and detect errors.
62
+
:::
63
+
59
64
To download and install the binary file manually, refer to [Releases](https://github.com/elastic/docs-builder/releases) on GitHub.
60
65
61
66
If you get a `Permission denied` error, make sure that you aren't trying to run a directory instead of a file. Also, grant the binary file execution permissions using `chmod +x docs-builder`.
@@ -93,7 +98,7 @@ If you get a `Permission denied` error, make sure that you aren't trying to run
93
98
::::
94
99
95
100
96
-
## Clone a content repository [#step-two]
101
+
## Clone a content repository [#clone-content]
97
102
98
103
:::{tip}
99
104
Documentation lives in many repositories across Elastic. If you're unsure which repository to clone, you can use the "Edit this page" link on any documentation page to determine where the source file lives.
@@ -105,7 +110,28 @@ In this guide, we'll clone the [`docs-content`](https://github.com/elastic/docs-
We write docs in Markdown. Refer to our [syntax](../syntax/index.md) guide for the flavor of Markdown that we support and all of our custom directives that enable you to add a little extra pizzazz to your docs.
116
+
117
+
## Build the docs
118
+
119
+
Before pushing your changes, check that your changes build successfully.
120
+
121
+
```
122
+
docs-builder
123
+
```
124
+
125
+
The build process informs you of any critical errors or warnings. It also shows less critical issues as Hints. Make sure not to introduce any new build errors, warnings, or hints.
126
+
127
+
## Push your changes [#push-changes]
128
+
129
+
After you've made your changes locally:
130
+
131
+
*[Push your commits](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository)
132
+
*[Open 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)
133
+
134
+
## Local preview [#local-docs-preview]
109
135
110
136
Static-site generators like docs-builder can serve docs locally. This means you can edit the source and see the result in the browser in real time.
Now you should be able to view the documentation locally by navigating to http://localhost:3000.
149
175
:::::
150
176
::::::
151
-
152
-
## Write the docs [#step-four]
153
-
154
-
We write docs in Markdown. Refer to our [syntax](../syntax/index.md) guide for the flavor of Markdown that we support and all of our custom directives that enable you to add a little extra pizzazz to your docs.
155
-
156
-
## Push your changes [#step-five]
157
-
158
-
After you've made your changes locally:
159
-
160
-
*[Push your commits](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository)
161
-
*[Open 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)
162
-
163
-
## View the preview
164
-
165
-
You can open a docs preview from the Deployments page of the repository. For example, [https://github.com/elastic/docs-content/deployments](https://github.com/elastic/docs-content/deployments).
166
-
167
-
1. Select the pull request or branch.
168
-
2. Select the ↗ icon next to the timestamp.
169
-
170
-
The preview URL is in the form `https://docs-v3-preview.elastic.dev/elastic/<repository>/tree/branch`.
0 commit comments