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
+50-22Lines changed: 50 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ Follow these steps to contribute to Elastic docs.
5
5
*[Prerequisites](#prerequisites)
6
6
*[Step 1: Install `docs-builder`](#step-one)
7
7
*[Step 2: Clone a content repository](#step-two)
8
-
*[Step 3: Serve the Documentation](#step-three)
9
-
*[Step 4: Write docs!](#step-four)
8
+
*[Step 3: Serve the documentation](#step-three)
9
+
*[Step 4: Write the docs](#step-four)
10
10
*[Step 5: Push your changes](#step-five)
11
11
12
12
## Prerequisites
@@ -82,50 +82,78 @@ If you get a `Permission denied` error, make sure that you aren't trying to run
82
82
::::
83
83
84
84
85
-
86
85
## Clone a content repository [#step-two]
87
86
88
87
:::{tip}
89
88
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.
90
89
:::
91
90
92
91
In this guide, we'll clone the [`docs-content`](https://github.com/elastic/docs-content) repository. The `docs-content` repository is the home for narrative documentation at Elastic. Clone this repo to a directory of your choice:
1.**Navigate to the `docs-builder` clone location:**
100
-
```sh
101
-
cd docs-content
102
-
```
99
+
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.
103
100
104
-
1.**Run the Binary:**
105
-
Run the binary with the `serve` command to build and serve the content set to http://localhost:3000. Specify the path to the `docset.yml` file that you want to build with `-p`.
101
+
To serve the local copy of the documentation in your browser, follow these steps:
106
102
107
-
For example, if `docs-builder` and `docs-content` are in the same top-level directory, you would run:
108
-
```sh
109
-
# macOS/Linux
110
-
./docs-builder serve -p ./migration-test
103
+
::::::{stepper}
111
104
112
-
# Windows
113
-
.\docs-builder serve -p .\migration-test
114
-
```
105
+
:::::{step} Go to the docs-builder clone location
106
+
107
+
```sh
108
+
cd docs-content
109
+
```
110
+
:::::
111
+
112
+
:::::{step} Run docs-builder
113
+
114
+
Run the `docs-builder` binary with the `serve` command to build and serve the content set to http://localhost:3000. Specify the path to the `docset.yml` file that you want to build with `-p`.
115
+
116
+
For example:
117
+
118
+
::::{tab-set}
115
119
120
+
:::{tab-item} macOS & Linux
121
+
122
+
```sh
123
+
docs-builder serve -p ./migration-test
124
+
```
125
+
:::
126
+
127
+
:::{tab-item} Windows
128
+
129
+
```powershell
130
+
docs-builder serve -p .\migration-test
131
+
```
132
+
:::
133
+
::::
134
+
:::::
135
+
136
+
:::::{step} Open the documentation in the browser
116
137
Now you should be able to view the documentation locally by navigating to http://localhost:3000.
138
+
:::::
139
+
::::::
117
140
118
-
## Step 4: Write docs [#step-four]
141
+
## Step 4: Write the docs [#step-four]
119
142
120
-
We write docs in markdown. See 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 pizazz to your docs.
143
+
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.
121
144
122
145
## Step 5: Push your changes [#step-five]
123
146
124
-
After you've made your changes locally,
147
+
After you've made your changes locally:
125
148
126
149
*[Push your commits](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository)
127
150
*[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)
128
151
129
-
## Step 5: View on elastic.co/docs
152
+
## Step 5: View the preview
153
+
154
+
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).
155
+
156
+
1. Select the pull request or branch.
157
+
2. Select the ↗ icon next to the timestamp.
130
158
131
-
soon...
159
+
The preview URL is in the form `https://docs-v3-preview.elastic.dev/elastic/<repository>/tree/branch`.
0 commit comments