npm package: @opentech-ux/lom-compiler-cli
Description: Compiler to generate playable HTML wireframe site from layout description model (LOM)
Author: Pierre-Louis JAEGER
Latest version: 1.0.4

# OpenTech UX LOM Compiler

[![npm version](https://badgen.net/npm/v/@opentech-ux/lom-compiler-cli)](https://www.npmjs.com/package/@opentech-ux/lom-compiler-cli)
[![npm license](https://badgen.net/npm/license/@opentech-ux/lom-compiler-cli)](https://www.npmjs.com/package/@opentech-ux/lom-compiler-cli)

- [OpenTech UX LOM Compiler](#opentech-ux-lom-compiler)
  - [Description](#description)
  - [Installation](#installation)
  - [Options](#options)
  - [Uses examples](#uses-examples)
  - [License](#license)

## Description

[JSON schema](https://opentech-ux.github.io/lom-format/) file compiler for generating an interactive
model of website navigation.

This compiler accepts custom files or files generated by the captor
[script](https://github.com/opentech-ux/lom-captor) containing the JSON schema format. Consequently,
generate a series of HTML files that represent a simulation of the navigation on a web site.

## Installation

```bash
# Project installation
npm install @opentech-ux/lom-compiler-cli

# Global installation
npm install -g @opentech-ux/lom-compiler-cli
```

## Options

You can pass the following options via CLI arguments.

| Description                                            | Short Command | Full Command | Default value                                      |
| ------------------------------------------------------ | ------------- | ------------ | -------------------------------------------------- |
| Select the file from which create the simulation       | -s            | --source     | "." (Gets all JSON files in the current directory) |
| Folder name where to save the compilation result files | -o            | --output     | "OpenTech-UX LOM Compiler"                         |

## Uses examples

- Initial project folder structure

  ```txt
  Project folder/
  ├─ data/
  │  ├─ json/
  │  │  ├─ basic-lom/
  │  │  │  ├─ basic.lom.json
  │  │  ├─ multi-lom/
  │  │  │  ├─ basic.lom.json
  │  │  │  ├─ script.lom.json
  ├─ script.lom.json
  ```

- Use examples in a the console

  - Without parameters

    ```bash
    lom-compiler
    ```

  - With source defined (file) and output (directory) defined

    ```bash
    lom-compiler -s ./data/json/basic-lom/basic.lom.json -o ./build/basic-lom
    ```

  - With source defined (directory) and output (folder name) defined

    ```bash
    lom-compiler -s ./data/json/multi-lom -o multi-lom
    ```

- Project folder structure after executing the examples

  ```txt
  Project folder/
  ├─ data/
  │  ├─ json/
  │  │  ├─ basic-lom/
  │  │  │  ├─ basic.lom.json
  │  │  ├─ multi-lom/
  │  │  │  ├─ basic.lom.json
  │  │  │  ├─ script.lom.json
  ├─ script.lom.json
  ├─ OpenTech-UX LOM Compiler/
  │  ├─ about/
  │  │  ├─ index.html
  │  ├─ contact/
  │  │  ├─ index.html
  │  ├─ index.html
  ├─ build/
  │  ├─ basic-lom/
  │  │  ├─ otherPage/
  │  │  │  ├─ index.html
  │  │  ├─ index.html
  │  ├─ script-lom/
  ├─ multi-lom/
  │  ├─ about/
  │  │  ├─ index.html
  │  ├─ contact/
  │  │  ├─ index.html
  │  ├─ otherPage/
  │  │  ├─ index.html
  │  ├─ index.html
  ```

## License

[APACHE 2.0](LICENSE)