Coralite CLI

This technical documentation provides an in-depth overview of the Coralite CLI, its command-line options, and usage examples.

Command Structure

The basic command structure for the Coralite CLI is as follows:

bash
Code copied!
node --experimental-vm-modules coralite [options]

Options

The Coralite CLI accepts several options to configure its behavior. Here's a detailed list of available options:

Examples

1. Generate a site with default options:

bash
Code copied!
coralite -t ./templates -p ./pages -o ./dist

2. Ignore specific elements during parsing and run in dry-run mode:

bash
Code copied!
coralite -t ./templates -p ./pages -o ./dist --ignore-attribute data-ignore=true class=test-only --dry-run

Technical Details

Under the hood, the Coralite CLI does the following:

  1. Parses command-line options using the commander library.
  2. Validates and processes provided options (e.g., splits ignore attribute key-value pairs).
  3. Calls the core coralite function with the parsed options.
  4. Based on the --dry-run option, either displays generated document information or writes rendered HTML files to the specified output directory.