Skip to content

Commit e32bb23

Browse files
authored
Complete locally.md docs and add macros (#1273)
* Complete locally.md docs and add macros * Update locally.md
1 parent 1d8ae49 commit e32bb23

File tree

1 file changed

+50
-22
lines changed

1 file changed

+50
-22
lines changed

docs/contribute/locally.md

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Follow these steps to contribute to Elastic docs.
55
* [Prerequisites](#prerequisites)
66
* [Step 1: Install `docs-builder`](#step-one)
77
* [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)
1010
* [Step 5: Push your changes](#step-five)
1111

1212
## Prerequisites
@@ -82,50 +82,78 @@ If you get a `Permission denied` error, make sure that you aren't trying to run
8282
::::
8383

8484

85-
8685
## Clone a content repository [#step-two]
8786

8887
:::{tip}
8988
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.
9089
:::
9190

9291
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:
92+
9393
```sh
9494
git clone https://github.com/elastic/docs-content.git
9595
```
9696

97-
## Serve the Documentation [#step-three]
97+
## Serve the documentation [#step-three]
9898

99-
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.
103100

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:
106102

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}
111104

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}
115119

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
116137
Now you should be able to view the documentation locally by navigating to http://localhost:3000.
138+
:::::
139+
::::::
117140

118-
## Step 4: Write docs [#step-four]
141+
## Step 4: Write the docs [#step-four]
119142

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.
121144

122145
## Step 5: Push your changes [#step-five]
123146

124-
After you've made your changes locally,
147+
After you've made your changes locally:
125148

126149
* [Push your commits](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository)
127150
* [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)
128151

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.
130158

131-
soon...
159+
The preview URL is in the form `https://docs-v3-preview.elastic.dev/elastic/<repository>/tree/branch`.

0 commit comments

Comments
 (0)