@moaw/cli
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

@moaw/cli

NPM version Node version XO code style License

Command line tool to create, preview and export workshops using MOAW platform.

Installation

npm install -g @moaw/cli

Usage

Usage: moaw <command> [options]

Commands:
  n, new <name>      Create a new workshop
  s, serve [<path>]  Preview workshop in target path (default: .)
    -p, --port       Port to listen on (default: 4444)
    -h, --host       Host address to bind to (default: localhost)
    -o, --open       Open in browser (default: false)
  c, convert <file>  Convert asciidoc to markdown
    -a, --attr <json_file>  Attributes to use for conversion
    -d, --dest <file>       Destination file (default: workshop.md)
  b, build [<file>]  Build workshop and process file includes
    -d, --dest <file>       Destination file (default: <file>.build.md)
  l, link [<file>]   Get link to target file (default: workshop.md)
    -r, --repo       Set GitHub repo instead of fetching it from git
    -b, --branch <name>     Set branch name (default: current branch)

General options:
  -v, --version      Show version
  --help             Show this help

Asciidoc to Markdown conversion

AsciiDoc is a markup language that can offer more advanced features than Markdown. However, it is not supported directly by MOAW. This command allows you to convert an AsciiDoc file to Markdown file that can be used with MOAW.

moaw convert my-workshop.adoc -a attributes.json

The attributes.json file is a JSON file that contains the document attributes to use for the conversion.

As MOAW requires specific frontmatter metadata in the Markdown file, you can define this metadata in the attributes.json file using the meta key. For example:

{
  "meta": {
    "short_title": "My workshop",
    "description": "My workshop description",
    "tags": "tag1, tag2",
    "level": "beginner",
    "duration_minutes": 180,
    ...
  }
}

Note that not all AsciiDoc features are supported, and fall back to HTML generation will be used in that case. You can use the --verbose option to see if any unsupported feature is used.

Package Sidebar

Install

npm i @moaw/cli

Weekly Downloads

20

Version

1.4.0

License

MIT

Unpacked Size

1.7 MB

Total Files

51

Last publish

Collaborators

  • sinedied