Development setup
The basic steps for setting up a development are as follows.
Ensure you’re running node version
>=12.0.0, as specified by Docs Engine.Clone the docs site repo (
@username/my-docs-sitebelow):~/ $ git clone git@github.com:username/my-docs-site.gitcdintomy-docs-siteand runnpm install:~/ $ cd my-docs-site~/my-docs-site $ npm installRun the engine’s
bootstrapcommand:~/my-docs-site $ npm run bootstrapRun the local development server:
~/my-docs-site $ npm run developOpen
localhost:8000in your browser to see your docs site.
At this point, you can make changes to the Markdown files inside the content directory (e.g. my-docs-site/src/content) to build or improve your docs site.
Watch files for changes
If you are contributing to @cloudflare/cloudflare-docs, you can use a command that starts the local development server and watches files for changes, updating the development server files automatically. To use this command:
Go to the local repo's root directory and run
npm install:~/cloudflare-docs/products/docs-engine $ cd ../..~/cloudflare-docs $ npm installRun the
developcommand passing the product folder name (the name of aproducts/sub-folder) as an argument — for example,docs-engine:~/cloudflare-docs $ npm run develop -- docs-engineOpen
localhost:8000in your browser to see your docs site. In this example, when you update any files undercloudflare-docs/products/docs-engine, the development server automatically updates the rendered docs site.
Currently, this script is only available in the Cloudflare Developers documentation repository. If you are using the Docs Engine with a different documentation repository, you need to stop and restart npm run develop every time you make changes to files under src/content.

