|
| 1 | +# Documentation linting setup |
| 2 | + |
| 3 | +We use Vale to enforce our documentation style (Xorq + Google developer style guide). |
| 4 | + |
| 5 | +> [!NOTE] |
| 6 | +> The `.vale.ini` file and `styles/` directory are already in this repo. You only need to: |
| 7 | +> * Install the Vale CLI. |
| 8 | +> * (Optionally) hook it into your editor (VS Code). |
| 9 | +
|
| 10 | +## 1. Install the Vale CLI |
| 11 | + |
| 12 | +You need the `vale` CLI installed and available on your system `PATH`. |
| 13 | + |
| 14 | +### macOS (Homebrew) |
| 15 | + |
| 16 | +```bash |
| 17 | +brew install vale |
| 18 | +``` |
| 19 | + |
| 20 | +### Ubuntu / Linux (Snap) |
| 21 | + |
| 22 | +```bash |
| 23 | +# --classic is required so Vale can access files on your system |
| 24 | +sudo snap install vale --classic |
| 25 | +``` |
| 26 | + |
| 27 | +### Windows (Chocolatey or Winget) |
| 28 | + |
| 29 | +```bash |
| 30 | +choco install vale |
| 31 | +``` |
| 32 | + |
| 33 | +### Verify the installation |
| 34 | + |
| 35 | +Close your terminal, open a new one, and run: |
| 36 | + |
| 37 | +```bash |
| 38 | +vale --version |
| 39 | +``` |
| 40 | + |
| 41 | +If you see a version number, Vale is installed correctly. |
| 42 | + |
| 43 | +> [!IMPORTANT] |
| 44 | +> You do not need to run `vale sync` – the `styles/` folder is already committed in this repo. |
| 45 | +
|
| 46 | +## 2. VS Code integration (recommended) |
| 47 | + |
| 48 | +If you want to see Vale suggestions while you edit the docs, you can use the VS Code extension. |
| 49 | + |
| 50 | +### Step A: Install the extension |
| 51 | + |
| 52 | +1. Open VS Code in this project (for example, run `code .` from the repo root). |
| 53 | +2. Go to Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`). |
| 54 | +3. Search for "Vale VSCode" (by Chris Chinchilla) and install it. |
| 55 | + |
| 56 | +### Step B: Make sure the CLI is on `PATH` |
| 57 | + |
| 58 | +Open a terminal inside VS Code and check that VS Code can see `vale`. |
| 59 | + |
| 60 | +#### macOS / Linux (integrated terminal in VS Code) |
| 61 | + |
| 62 | +```bash |
| 63 | +vale --version |
| 64 | +``` |
| 65 | + |
| 66 | +#### Windows (PowerShell in VS Code) |
| 67 | + |
| 68 | +```bash |
| 69 | +vale --version |
| 70 | +``` |
| 71 | + |
| 72 | +> [!WARNING] |
| 73 | +> If that prints a version, the extension can use it. If not, follow step C and restart VS Code |
| 74 | +
|
| 75 | +### Step C: Configure Vale in VS Code |
| 76 | + |
| 77 | +To get live feedback as you edit the docs: |
| 78 | + |
| 79 | +1. In VS Code, open Settings (`Ctrl+,` / `Cmd+,`). |
| 80 | +2. In the search box, type "Vale CLI". |
| 81 | +3. Under User (or Workspace if you want it only for this project): |
| 82 | + * In Vale CLI: Config, enter: |
| 83 | + |
| 84 | +``` |
| 85 | +.vale.ini |
| 86 | +``` |
| 87 | + |
| 88 | + * Enable Vale CLI: Install Vale. |
| 89 | + * Set Vale CLI: Min Alert Level to `suggestion` from the dropdown. |
| 90 | +4. Reload VS Code. |
| 91 | + |
| 92 | +After this, when you open any `.qmd` or `.md` file under `docs/`, Vale will show suggestions inline (squiggly underlines) and in the Problems panel as you write. |
| 93 | + |
| 94 | +## 3. Run Vale from the CLI |
| 95 | + |
| 96 | +You can also run Vale manually from the repo root. |
| 97 | + |
| 98 | +### Lint the entire docs tree |
| 99 | + |
| 100 | +```bash |
| 101 | +vale docs/ |
| 102 | +``` |
| 103 | + |
| 104 | +### Lint a specific file |
| 105 | + |
| 106 | +```bash |
| 107 | +vale docs/tutorials/getting_started/quickstart.qmd |
| 108 | +``` |
| 109 | + |
| 110 | +> [!TIP] |
| 111 | +> Use this as a final check before opening a PR or pushing documentation changes. |
0 commit comments