Generating Your Documentation Website
Once you have defined your products in products.js and configured Prodcat in prodcat.config.js, the next step is to generate your documentation website.
The prodcat generate Command
The core command for building your documentation is prodcat generate. This command reads your configuration and product data, then uses your templates to create the necessary Markdown files for Docusaurus.
prodcat generate
How it Works
- Reads
prodcat.config.js: Prodcat first loads your configuration settings. - Reads
products.js: It then fetches your product definitions. - Generates Markdown Files: For each product defined, Prodcat creates a dedicated Markdown file in your
productsOutputPath(e.g.,website/docs/products/my-product.md) using theproductPagetemplate. It also creates a main directory page (e.g.,website/docs/products/index.md) using theproducts-directorytemplate. - Updates Docusaurus Navigation: Prodcat intelligently updates your
docusaurus.config.jsandsidebars.jsfiles to include the newly generated product pages in your website's navigation.
Optional Flags
--config <path>: Specify a custom path to yourprodcat.config.jsfile.--output <path>: Override theproductsOutputPathdefined in your config.--navbar-label <label>: Override thedefaultNavbarLabelfor the product directory link.--navbar-position <position>: Override thedefaultNavbarPosition.
What to do next?
After running prodcat generate, navigate into your Docusaurus website directory and run npm start to preview your site locally:
cd website
npm start
Your browser will open to your new, updated documentation website!