CLI Usage Guide

The SquibView CLI (squibv) converts Markdown files into high-quality HTML documents with full support for math, diagrams, and interactive content.

Quick Start

# Convert a markdown file to HTML
npx squibv document.md

# Specify output file
npx squibv document.md -o output.html

# Create offline-ready HTML
npx squibv document.md --bundle-offline

Installation Options

NPX (Recommended)

# No installation required
npx squibv document.md

Global Installation

npm install -g squibview
squibv document.md

Project Installation

npm install squibview
npx squibv document.md

Command Syntax

squibv [options] [file]
squibv [options] build [file]  # Explicit build command

Options Reference

OptionShortDescriptionDefault
--input <source>-iInput file or “-” for stdinPositional arg
--output <dest>-oOutput file or “-” for stdoutinput.html
--standalone-sSelf-contained HTML (default)true
--css <file>Custom CSS fileBuilt-in styles
--bundle-offlineBundle all dependenciesCDN links
--watch-wWatch for changesOff
--quietSuppress progress messagesOff
--log <file>Log file for messagesstderr

Examples

Basic Conversion

# Convert README.md to README.html
squibv README.md

# Custom output name
squibv README.md -o documentation.html

# Read from stdinecho"# Hello World" | squibv -i - -o output.html

Advanced Features

# Bundle for offline use (larger file, no internet required)
squibv document.md --bundle-offline -o standalone.html

# Custom styling
squibv document.md --css custom-theme.css -o styled.html

# Development mode with auto-rebuild
squibv document.md --watch

# Quiet mode (suppress progress)
squibv document.md --quiet -o output.html

Batch Processing

# Convert multiple filesfor file in *.md; do
    squibv "$file" -o "${file%.md}.html"done# Using find
find . -name "*.md" -exec squibv {} -o {}.html \;

Output Options

Standalone vs Regular

Offline Bundling

The --bundle-offline option creates fully self-contained files:

squibv document.md --bundle-offline

Benefits:

Tradeoffs:

Content Support

Markdown Features

Enhanced Content

Example Content

# Sample Document

## Math
$$E = mc^2$$

## Diagram
```mermaid
graph TD
    A[Start] --> B[Process]
    B --> C[End]

Data

nameagecity
John25NYC
Jane30LA

Code

console.log('Hello, World!');

## Custom Styling

### Using Custom CSS
```bash
squibv document.md --css custom.css

CSS File Example

/* custom.css */body {
    font-family: 'Georgia', serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
}

.squibview-data-table {
    border-collapse: collapse;
    width: 100%;
}

.squibview-data-tableth,
.squibview-data-tabletd {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

Watch Mode

Monitor files for changes and auto-rebuild:

# Watch single file
squibv document.md --watch

# Watch with custom output
squibv document.md --watch -o docs/output.html

Perfect for development workflows where you want live updates.

Pipeline Integration

CI/CD Usage

# GitHub Actions example
- name: Generate Documentation
  run: npx squibv README.md -o docs/index.html --bundle-offline

Makefile Integration

docs: README.md
	npx squibv README.md -o docs/index.html

.PHONY: docs

Troubleshooting

Common Issues

File not found:

# Check file pathls -la document.md
squibv document.md

Permission errors:

# Check write permissionsls -la output-directory/

Large file warnings:

# For large files, increase memory if needed
NODE_OPTIONS="--max-old-space-size=4096" squibv large-document.md

Logging

# Enable detailed logging
squibv document.md --log build.log

# Check log filecat build.log

Next Steps