|
1 | 1 | --- |
2 | | -title: Update the docs in your web browser |
| 2 | +title: Build the docs locally |
3 | 3 | --- |
| 4 | + |
| 5 | +1. Install dependencies |
| 6 | +2. Clone repositories |
| 7 | +3. Make changes |
| 8 | +4. Open a Pull Request |
| 9 | +5. Work with CI |
| 10 | +6. Get approvals and merge |
| 11 | +7. View your changes live on elastic.co |
| 12 | + |
| 13 | +Follow these instructions to get started with docs-builder on your machine. |
| 14 | + |
| 15 | +::::{tab-set} |
| 16 | + |
| 17 | +:::{tab-item} macOS |
| 18 | + |
| 19 | +### macOS Installation |
| 20 | + |
| 21 | +1. **Download the Binary:** |
| 22 | + Download the latest macOS binary from [releases](https://github.com/elastic/docs-builder/releases/latest/): |
| 23 | + ```sh |
| 24 | + curl -LO https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-mac-arm64.zip |
| 25 | + ``` |
| 26 | + |
| 27 | +2. **Extract the Binary:** |
| 28 | + Unzip the downloaded file: |
| 29 | + ```sh |
| 30 | + unzip docs-builder-mac-arm64.zip |
| 31 | + ``` |
| 32 | + |
| 33 | +3. **Run the Binary:** |
| 34 | + 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`: |
| 35 | + ```sh |
| 36 | + ./docs-builder serve -p ./path/to/docs |
| 37 | + ``` |
| 38 | + |
| 39 | +::: |
| 40 | + |
| 41 | +:::{tab-item} Windows |
| 42 | + |
| 43 | +### Windows Installation |
| 44 | + |
| 45 | +1. **Download the Binary:** |
| 46 | + Download the latest Windows binary from [releases](https://github.com/elastic/docs-builder/releases/latest/): |
| 47 | + ```sh |
| 48 | + Invoke-WebRequest -Uri https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-win-x64.zip -OutFile docs-builder-win-x64.zip |
| 49 | + ``` |
| 50 | + |
| 51 | +2. **Extract the Binary:** |
| 52 | + Unzip the downloaded file. You can use tools like WinZip, 7-Zip, or the built-in Windows extraction tool. |
| 53 | + ```sh |
| 54 | + Expand-Archive -Path docs-builder-win-x64.zip -DestinationPath . |
| 55 | + ``` |
| 56 | + |
| 57 | +3. **Run the Binary:** |
| 58 | + 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`: |
| 59 | + ```sh |
| 60 | + .\docs-builder serve -p ./path/to/docs |
| 61 | + ``` |
| 62 | + |
| 63 | +::: |
| 64 | + |
| 65 | +:::{tab-item} Linux |
| 66 | + |
| 67 | +### Linux Installation |
| 68 | + |
| 69 | +1. **Download the Binary:** |
| 70 | + Download the latest Linux binary from [releases](https://github.com/elastic/docs-builder/releases/latest/): |
| 71 | + ```sh |
| 72 | + wget https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-linux-x64.zip |
| 73 | + ``` |
| 74 | + |
| 75 | +2. **Extract the Binary:** |
| 76 | + Unzip the downloaded file: |
| 77 | + ```sh |
| 78 | + unzip docs-builder-linux-x64.zip |
| 79 | + ``` |
| 80 | + |
| 81 | +3. **Run the Binary:** |
| 82 | + 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`: |
| 83 | + ```sh |
| 84 | + ./docs-builder serve -p ./path/to/docs |
| 85 | + ``` |
| 86 | + |
| 87 | +::: |
| 88 | + |
| 89 | +:::: |
| 90 | + |
| 91 | +### Clone the `docs-content` Repository |
| 92 | + |
| 93 | +Clone the `docs-content` repository to a directory of your choice: |
| 94 | +```sh |
| 95 | +git clone https://github.com/elastic/docs-content.git |
| 96 | +``` |
| 97 | + |
| 98 | +### Serve the Documentation |
| 99 | + |
| 100 | +1. **Navigate to the cloned repository:** |
| 101 | + ```sh |
| 102 | + cd docs-content |
| 103 | + ``` |
| 104 | + |
| 105 | +2. **Run the Binary:** |
| 106 | + 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`: |
| 107 | + ```sh |
| 108 | + # macOS/Linux |
| 109 | + ./docs-builder serve -p ./migration-test |
| 110 | + |
| 111 | + # Windows |
| 112 | + .\docs-builder serve -p .\migration-test |
| 113 | + ``` |
| 114 | + |
| 115 | +Now you should be able to view the documentation locally by navigating to http://localhost:5000. |
0 commit comments