This repository contains the source files for the documentation site that can be found here:
https://docs.chocolatey.org/en-us/
This site is built using Astro.
Listed below are some of the areas we consider important when writing. We have two goals:
To help with these goals, please refer to our guides on writing documentation and the use of language and grammar.
There are multiple options to build the site:
Ensure that you have Node v20+ installed by running node -v
. There is a .\setup.ps1
file in the root of this repository that uses Chocolatey to install or upgrade Node to the correct version.
After confirming the required Node version, run the following command from a terminal:
yarn dev
This will compile the site, and bring up a preview on http:localhost:5086
. Any changes you make will automatically be hot reloaded.
Follow these steps to open the project in a Dev Container:
Dev Containers: Open Folder in Container...
.Dev Containers: Close Remote Connection
command from the Command Palette.From a terminal, run the following:
docker build -t chocolatey-docs-container .
Once this is complete, run the following from the same terminal:
docker run -p 5086:5086 -v $(pwd):/app chocolatey-docs-container
This will compile the site, and bring up a preview on http:localhost:5086
. Any changes you make will automatically be hot reloaded.
Building the site for production is a good practice before submitting a pull request. An error of any kind will be flagged in the production build and it will fail.
From a terminal, run the following:
yarn build
Once this is complete, run the following from the same terminal:
yarn preview
This will start a server to show what the site will look like in production. Changes made to source files will not be reflected in this preview.
If you are having build errors with 'copyTheme' errored after
, try removing the node_modules
directory and clearing your yarn cache with yarn cache clean
.
If you receive the error The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached
then you can increase the number by running echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
. See this GitHub comment for more information.
The following VS Code extensions are recommended to get the best development experience:
The Chocolatey Design System and choco-astro contain information on how to understand several Astro concepts:
.mdx
and .astro
file types.<Callout />
Component to display notes and important information.<CollapseButton />
Component to display a button that triggers a collapsed element.<Iframe />
Component to display videos with defined aspect ratios.<Tabs />
Component to display content in tabbed interface.<Xref />
Component to link to other documents within this repository.Mermaid via an Astro integration allows an easy way to display information with diagrams written in markdown. Find more information on usage at the choco-astro repository.
To run all the Playwright tests, first run the following command:
yarn build
Once this has completed, run:
yarn playwright
This will run all Playwright tests and report any errors for further investigation.
Come join in the conversation about Chocolatey in our Community Chat Room.
Please make sure you've read over and agree with the etiquette regarding communication.
Search uses Algolia DocSearch as backend.