|
| 1 | +--- |
| 2 | +title: Contribute locally |
| 3 | +--- |
| 4 | + |
| 5 | +Follow these steps to contribute to Elastic docs. |
| 6 | +* [Step 1: Install `docs-builder`](#step-one) |
| 7 | +* [Step 2: Clone the `docs-content` repository](#step-two) |
| 8 | +* [Step 3: Serve the Documentation](#step-three) |
| 9 | +* [Step 4: Open a PR](#step-three) |
| 10 | + |
| 11 | +## Step 1: Install `docs-builder` [#step-one] |
| 12 | + |
| 13 | +::::{tab-set} |
| 14 | + |
| 15 | +:::{tab-item} macOS |
| 16 | + |
| 17 | +### macOS |
| 18 | + |
| 19 | +1. **Download the Binary:** |
| 20 | + Download the latest macOS binary from [releases](https://github.com/elastic/docs-builder/releases/latest/): |
| 21 | + ```sh |
| 22 | + curl -LO https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-mac-arm64.zip |
| 23 | + ``` |
| 24 | + |
| 25 | +2. **Extract the Binary:** |
| 26 | + Unzip the downloaded file: |
| 27 | + ```sh |
| 28 | + unzip docs-builder-mac-arm64.zip |
| 29 | + ``` |
| 30 | + |
| 31 | +3. **Run the Binary:** |
| 32 | + Use the `serve` command to start serving the documentation at http://localhost:5000. The path to the docset.yml file that you want to build can be specified with `-p`: |
| 33 | + ```sh |
| 34 | + ./docs-builder serve -p ./path/to/docs |
| 35 | + ``` |
| 36 | + |
| 37 | +::: |
| 38 | + |
| 39 | +:::{tab-item} Windows |
| 40 | + |
| 41 | +### Windows |
| 42 | + |
| 43 | +1. **Download the Binary:** |
| 44 | + Download the latest Windows binary from [releases](https://github.com/elastic/docs-builder/releases/latest/): |
| 45 | + ```sh |
| 46 | + Invoke-WebRequest -Uri https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-win-x64.zip -OutFile docs-builder-win-x64.zip |
| 47 | + ``` |
| 48 | + |
| 49 | +2. **Extract the Binary:** |
| 50 | + Unzip the downloaded file. You can use tools like WinZip, 7-Zip, or the built-in Windows extraction tool. |
| 51 | + ```sh |
| 52 | + Expand-Archive -Path docs-builder-win-x64.zip -DestinationPath . |
| 53 | + ``` |
| 54 | + |
| 55 | +3. **Run the Binary:** |
| 56 | + Use the `serve` command to start serving the documentation at http://localhost:5000. The path to the docset.yml file that you want to build can be specified with `-p`: |
| 57 | + ```sh |
| 58 | + .\docs-builder serve -p ./path/to/docs |
| 59 | + ``` |
| 60 | + |
| 61 | +::: |
| 62 | + |
| 63 | +:::{tab-item} Linux |
| 64 | + |
| 65 | +### Linux |
| 66 | + |
| 67 | +1. **Download the Binary:** |
| 68 | + Download the latest Linux binary from [releases](https://github.com/elastic/docs-builder/releases/latest/): |
| 69 | + ```sh |
| 70 | + wget https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-linux-x64.zip |
| 71 | + ``` |
| 72 | + |
| 73 | +2. **Extract the Binary:** |
| 74 | + Unzip the downloaded file: |
| 75 | + ```sh |
| 76 | + unzip docs-builder-linux-x64.zip |
| 77 | + ``` |
| 78 | + |
| 79 | +3. **Run the Binary:** |
| 80 | + Use the `serve` command to start serving the documentation at http://localhost:5000. The path to the docset.yml file that you want to build can be specified with `-p`: |
| 81 | + ```sh |
| 82 | + ./docs-builder serve -p ./path/to/docs |
| 83 | + ``` |
| 84 | + |
| 85 | +::: |
| 86 | + |
| 87 | +:::: |
| 88 | + |
| 89 | +## Clone the `docs-content` Repository [#step-two] |
| 90 | + |
| 91 | +Clone the `docs-content` repository to a directory of your choice: |
| 92 | +```sh |
| 93 | +git clone https://github.com/elastic/docs-content.git |
| 94 | +``` |
| 95 | + |
| 96 | +## Serve the Documentation [#step-three] |
| 97 | + |
| 98 | +1. **Navigate to the cloned repository:** |
| 99 | + ```sh |
| 100 | + cd docs-content |
| 101 | + ``` |
| 102 | + |
| 103 | +2. **Run the Binary:** |
| 104 | + Use the `serve` command to start serving the documentation at http://localhost:5000. The path to the `docset.yml` file that you want to build can be specified with `-p`: |
| 105 | + ```sh |
| 106 | + # macOS/Linux |
| 107 | + ./docs-builder serve -p ./migration-test |
| 108 | + |
| 109 | + # Windows |
| 110 | + .\docs-builder serve -p .\migration-test |
| 111 | + ``` |
| 112 | + |
| 113 | +Now you should be able to view the documentation locally by navigating to http://localhost:5000. |
| 114 | + |
| 115 | +## Step 4: Open a PR [#step-four] |
| 116 | + |
| 117 | +Open a PR. Good luck. |
| 118 | + |
| 119 | +## Step 5: View on elastic.co/docs |
| 120 | + |
| 121 | +soon... |
0 commit comments