> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-run-filter-ui-updates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Development

> Preview and test documentation changes locally before publishing updates to the W&B Weave documentation site.

This guide is for documentation contributors who want to preview W\&B Weave documentation changes locally before they're published. By running the Mintlify CLI on your machine, you can verify your edits render correctly, catch broken links, and iterate quickly without waiting for a deployment.

<Info>
  **Prerequisite**: Install Node.js (version 19 or higher) before proceeding. <br />
  Upgrade to `docs.json` before proceeding and delete the legacy `mint.json` file.
</Info>

## Install and run Mintlify

Follow these steps to install and run Mintlify on your operating system:

1. Install Mintlify:

   <CodeGroup>
     ```bash npm theme={null}
     npm i -g mintlify
     ```

     ```bash yarn theme={null}
     yarn global add mintlify
     ```
   </CodeGroup>

2. Navigate to the docs directory (where the `docs.json` file is located) and start the local preview server:

   ```bash theme={null}
   mintlify dev
   ```

A local preview of your documentation is available at `http://localhost:3000`. You now have a running local environment that mirrors the published Weave docs site.

### Custom ports

By default, Mintlify uses port 3000. If port 3000 is already in use on your machine or you prefer to run multiple previews at once, use the `--port` flag to change the port Mintlify listens on. For example, to run Mintlify on port 3333, use this command:

```bash theme={null}
mintlify dev --port 3333
```

If you attempt to run Mintlify on a port that's already in use, it uses the next available port:

```text theme={null}
Port 3000 is already in use. Trying 3001 instead.
```

## Mintlify versions

Keep your CLI in sync with the production Mintlify version so your local preview matches what readers see on the published site. Each CLI release is associated with a specific version of Mintlify. If your local website doesn't align with the production version, update the CLI:

<CodeGroup>
  ```bash npm theme={null}
  npm i -g mintlify@latest
  ```

  ```bash yarn theme={null}
  yarn global upgrade mintlify
  ```
</CodeGroup>

## Validate links

Broken links degrade the reader experience, so check your changes for broken references before you open a pull request. The CLI can validate reference links in your documentation. To identify broken links, run `mintlify broken-links`:

```bash theme={null}
mintlify broken-links
```

## Deployment

<Tip>
  Unlimited editors available under the [Pro
  Plan](https://mintlify.com/pricing) and above.
</Tip>

If the deployment is successful, you should see a confirmation message indicating that all checks have passed.

## Code formatting

Consistent MDX formatting makes your changes easier to review and reduces accidental syntax errors. Use extensions in your IDE to recognize and format MDX. If you're a VSCode user, consider the [MDX VSCode extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting.

## Troubleshooting

The following sections describe common issues you may encounter when you run the Mintlify CLI locally, along with their resolutions.

<AccordionGroup>
  <Accordion title="Error: Could not load the &#x22;sharp&#x22; module using the darwin-arm64 runtime">
    This may be due to an outdated version of Node.js. Try the following:

    1. Remove the installed version of `mintlify`: `npm remove -g mintlify`.
    2. Upgrade to Node.js v19 or higher.
    3. Reinstall `mintlify`: `npm install -g mintlify`.
  </Accordion>

  <Accordion title="Issue: Encountering an unknown error">
    Solution: Go to the root of your device and delete the `~/.mintlify` folder. Afterward, run `mintlify dev` again.
  </Accordion>
</AccordionGroup>

Curious about what changed in the CLI version? For more information, see the [CLI changelog](https://www.npmjs.com/package/mintlify?activeTab=versions).
