Skip to content

Commit 6945015

Browse files
authored
Add step for building the docs (#1474)
* Add step for building the docs * Add callout and update ToC * Fix anchor
1 parent 377ddc0 commit 6945015

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

docs/contribute/locally.md

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
Follow these steps to contribute to Elastic docs.
44

55
* [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)
1111

12-
## Prerequisites
12+
## Prerequisites [#prerequisites]
1313

1414
To write and push updates to Elastic documentation, you need the following:
1515

1616
1. **A code editor**: we recommend [Visual Studio Code](https://code.visualstudio.com/download)
1717
1. **Git installed on your machine**: learn how [here](https://github.com/git-guides/install-git)
1818
1. **A GitHub account**: sign up [here](https://github.com/)
1919

20-
## Install `docs-builder` [#step-one]
20+
## Install `docs-builder` [#install-docs-builder]
2121

2222
There are two different ways to install and run `docs-builder`:
2323

@@ -54,8 +54,13 @@ This guide uses the first option. If you'd like to clone the repository and buil
5454
```sh
5555
docs-builder serve
5656
```
57+
5758
The path to the `docset.yml` file that you want to build can be specified with `-p`.
5859

60+
:::{important}
61+
Run `docs-builder` without `serve` to run a full build and detect errors.
62+
:::
63+
5964
To download and install the binary file manually, refer to [Releases](https://github.com/elastic/docs-builder/releases) on GitHub.
6065

6166
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
9398
::::
9499

95100

96-
## Clone a content repository [#step-two]
101+
## Clone a content repository [#clone-content]
97102

98103
:::{tip}
99104
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-
105110
git clone https://github.com/elastic/docs-content.git
106111
```
107112

108-
## Serve the documentation [#step-three]
113+
## Write the docs [#write-docs]
114+
115+
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]
109135

110136
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.
111137

@@ -148,23 +174,3 @@ docs-builder serve -p .\migration-test
148174
Now you should be able to view the documentation locally by navigating to http://localhost:3000.
149175
:::::
150176
::::::
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

Comments
 (0)