QuantumJS
Edit Page
Using the CLI / API
This page explains how use the command line interface (CLI) and the API for creating documentation.
Configuring Quantum
To use the CLI and API, you'll need a file called quantum.config.js. This file contains the pipeline definition as well as config for which files to build.
A basic example that provides the html elements (such as <div>) can be seen below:
Example
quantum.config.js (Javascript)
const html = require('quantum-html')

module.exports = {
  port: 9999,
  pipeline: [
    html.fileTransform()
],
pages: '**/*.um'
}
More Information
More details of what options can be used in the config, as well as a full-featured example can be found on the quantum.config.js page.
Using the config with the CLI
If your config file is called quantum.config.js, you can just run this in the same directory as the config file:
Example
Console
# Build the site once
quantum build

# OR

# Build the site and watch for changes
quantum watch
If the config file has a different name the --config option can be used when building a quantum site:
Example
Console
quantum --config="quantum.config.production.js" build

# OR

quantum --config="quantum.config.production.js" watch
Using the config with the API
To use the config with the quantum api, you can require the config file in your script:
Example
Javascript
const config = require('./quantum.config.js')
const quantum = require('quantum-core')

// Build the site once
quantum.api.build(config)

// OR

// Build the site and watch for changes
quantum.api.watch(config)