From ddaf0c5ada0725936cadb7e8a25e6924b1239e3e Mon Sep 17 00:00:00 2001 From: Talon Poole Date: Thu, 11 Feb 2021 23:49:39 +0000 Subject: [PATCH] clean --- cli.js | 17 +++++++++++------ html.js | 6 +----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cli.js b/cli.js index e80272b..490b4ad 100755 --- a/cli.js +++ b/cli.js @@ -12,9 +12,15 @@ const cli = yargs(process.argv.slice(2)) .command("$0 [files..]", "Convert text/gemini to text/html.", (yargs) => yargs .example("$0 --html en $(find ~/my-capsule -name '*.gmi')") + .example("$0 --foreground '#000000' --background '#EEEEEE' --html en < doc.gmi") .example("$0 --body < ~/my-capsule/index.gmi") + .example("$0 --image jpg --audio mp3 --image png --body < doc.gmi") + .epilog("See the gmi-web(1) man page for more information") ) .options({ + body: { + type: "boolean", + }, html: { type: "string", requiresArg: true, @@ -23,20 +29,20 @@ const cli = yargs(process.argv.slice(2)) choices: ["gmi.css", "base", "none"], default: "gmi.css", }, - body: { - type: "boolean", - }, }); cli.options({ image: { type: "array", + requiresArg: true, }, audio: { type: "array", + requiresArg: true, }, video: { type: "array", + requiresArg: true, }, }); @@ -71,12 +77,11 @@ const GMI_CSS_VARS = [ const argv = cli .conflicts("html", "body") .group(["html", "css", "body"], "Core:") - .group(GMI_CSS_VARS, "CSS Variables:") - .group(["images", "audio", "video"], "Inline Media:") + .group(GMI_CSS_VARS, "gmi.css:") + .group(["image", "audio", "video"], "Inline Media:") .alias("html", "language") .alias("html", "lang") .config() - .epilog("See the gmi-web(1) man page for more information!") .showHelpOnFail(true) .help().argv; diff --git a/html.js b/html.js index f130813..6aab7a0 100644 --- a/html.js +++ b/html.js @@ -29,11 +29,7 @@ export const BASE_CSS = "p,a,pre,h1,h2,h3,ul,blockquote,img,audio,video{display:block;max-width:100%;margin:0;padding:0;overflow-wrap:anywhere;}"; export function head(options) { return ` -${ - options.css !== "" - ? `` - : "" -} +${options.css !== "" ? `` : ""} ${options.css !== "" ? `` : ""}