#!/usr/bin/env node const path = require("path"); const fs = require("vinyl-fs"); const map = require("map-stream"); const tokenize = require("./tokenize"); const toHTML = require("./to-html"); // 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", ]; require("yargs") .scriptName("gmi-web") .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("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 to for the bare-minimum