#!/usr/bin/env node import path from "path"; import fs from "vinyl-fs"; import map from "map-stream"; import tokenize from "./tokenize.js"; import toHTML from "./to-html.js"; import yargs from "yargs"; // TODO: automatically pull these in from gmi.css (also for gmi.css(5)) const GMI_CSS_VARS = [ "foreground", "background", "p-size", "p-indent", "p-line-height", "a-size", "pre-size", "pre-line-height", "h1-size", "h2-size", "h3-size", "heading-line-height", "ul-size", "ul-line-height", "blockquote-size", "blockquote-line-height", "mono", "serif", "sans-serif", ]; yargs(process.argv.slice(2)) .scriptName("gmi-web") .config() .command( "$0 [files..]", "Convert .gmi to .html. See gmi-web(1) for more details.", (yargs) => yargs .positional("files", { describe: "The *.gmi files to convert", }) .required("files", true) .option("language", { alias: "lang", required: true, type: "string", describe: "Set the document meta language tag", }) .option("images", { type: "boolean", default: false, describe: "Include images", }) .option("audio", { type: "boolean", default: false, describe: "Include audio", }) .option("video", { type: "boolean", default: false, describe: "Include video", }) .option("css", { type: "boolean", default: true, describe: "gmi.css is included by default. Use --no-css for the bare minimum