1.0.7 • Published 4 months ago

gramax-cli v1.0.7

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
4 months ago

gramax-cli

Gramax CLI is a versatile command-line tool designed to help developers generate static sites effortlessly from source directories created using the Gramax editor. Below is the official documentation to get you started.

Key Features

  • Static Site Generation: Create static websites from specified directories with a single command.

  • Error Checking: Validate catalogs and identify issues before deployment.

Installation

You can use Gramax CLI in two ways: without installation via npx or by installing it globally.

Run Without Installation

Use npx to run Gramax CLI without installing it:

npx gramax-cli <command> [options]

Install Globally

Install Gramax CLI globally for frequent usage:

npm install -g gramax-cli

After installation, you can run the CLI from anywhere:

gramax-cli <command> [options]

Commands Overview

Build Command

The build command generates a static site from the specified source directory.

gramax-cli build --source <path> --destination <path> [--skip-check]

Options

OptionDescriptionDefault
--source, -sPath to the source directory created using the Gramax editor.Current working directory
--destination, -dPath where the generated static site will be saved../build
--skip-checkSkips validation checks during the build process.false

Configuration

Customize the build process using a gramax.config.yaml file in the source directory or environment variables.

Example gramax.config.yaml:

build:
  logo:
    imageUrl: "https://example.com/logo.png"
    linkUrl: "https://example.com"
  metrics:
    yandex:
      metricCounter: 12345678
    matomo:
      siteId: 1
      matomoUrl: "https://example.com/matomo"
      matomoContainerUrl: "https://example.com/container"

Environment Variable Overrides:

  • LOGO_LINK_URL

  • LOGO_IMAGE_URL

  • YANDEX_METRIC_COUNTER

  • MATOMO_SITE_ID

  • MATOMO_URL

  • MATOMO_CONTAINER_URL

Example

Generate a static site from ./content and save it to ./output:

gramax-cli build --source ./content --destination ./output

Check Command

The check command validates the specified catalog directory for errors.

gramax-cli check --destination <path> [--output <path>]

Options

OptionDescriptionDefault
--destination, -dPath to the catalog directory for validation.Current working directory
--output, -oPath where the validation log file will be saved.Not specified

Example

Run a check on ./catalog and save the validation log to ./error-log.txt:

gramax-cli check --destination ./catalog --output ./error-log.txt

Export Command

The export command exports the specified catalog directory to a document format (docx or pdf).

gramax-cli export --source <path> --output <path> [--format <format>] [--yes]

Options

OptionDescriptionDefault
--source, -sPath to the catalog directory for export.Current working directory
--output, -oPath where the generated file will be saved../export
--format, -fExport format: docx or pdf.docx
--yes, -ySkip confirmation.false

Example

Export catalog from ./content to ./output.docx:

gramax-cli export --source ./content --output ./output.docx

Export catalog to PDF format:

gramax-cli export --source ./content --output ./output.pdf --format pdf

Utility Commands

Version Command

Display the current version of Gramax CLI:

gramax-cli --version

Help Command

View all available commands and their options:

gramax-cli --help

License

Gramax CLI is licensed under the GNU General Public License v3.0.

1.0.7

4 months ago

1.0.6

6 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

1.1.0

8 months ago