Skip to main content

Documentation Preview

While writing and developing the documentation, you will want to build locally so you can see changes without making updates to the main repository. However, when you are ready to test for a pull request, compile for production as this will build the files that would be used for a live site and will reveal issues that may not be present when building locally.

Clear Local Build

This process will clear generated assets, caches, build artifacts from your docs folder. It's recommended to do so anytime there are issues with the Docusaurus site when building locally or compiling for production.

  1. Open a terminal in the root of the GP2040-CE project
  2. Run the following commands
cd site/
npm run docusaurus clear

Build Locally

This will build and serve your site locally with Webpack Dev Server.

note

Changes made to documents while the dev server is running will update the live site on save.

  1. Open a terminal in the root of the GP2040-CE project
  2. Run the following commands
cd site/
npm install
npm start
  1. In the default web browser, http://localhost:port should automatically open and allow you to preview the site.

Production Preview

This will compile your site for production, creating a build folder that would be used as a static site.

note

Changes made to documents while the dev server is running will not update the live site on save.

  1. Open a terminal in the root of the GP2040-CE project
  2. Run the following commands
cd site/
npm install
npm run build
npm run serve
  1. In the default web browser, http://localhost:port should automatically open and allow you to preview the site.