Preview & Test

Preview your Mordoc documentation locally and verify changes before deployment.

After building your site, the next step is to preview and test it locally. This allows you to verify content, navigation, and layout before publishing your documentation.

Preview command

To start the local preview server, run:

Bash
npm run dev

This command starts a local server that serves your documentation in a web browser.

What does preview mode do?

Preview mode allows you to view your documentation site exactly as it would appear when deployed, but on your local machine.

When preview mode is running, Mordoc:

  • Serves pages generated by the build process
  • Loads styles, images, and browser-side JavaScript
  • Enables client-side navigation through the side navigation
  • Allows you to verify page structure and content

No files are published or uploaded during preview.

Accessing your site

Once the preview server is running, your site is available at:

http://localhost:3000

You can navigate through your documentation using the side navigation and links, just as an end user would.

Making changes and rebuilding

If you make changes to your content or configuration, those changes are not automatically reflected in the preview.

To see updates:

  1. Stop the preview server
  2. Run npm run build
  3. Start the preview server again using npm run dev

This ensures the preview always reflects the latest built version of your site.

What to verify during preview

Preview mode is the right time to check:

  • Page content and formatting
  • Side navigation structure and ordering
  • Links between pages
  • Images and other assets
  • Overall layout and readability

Next steps