diff --git a/Makefile b/Makefile index 8e440f2..b409aeb 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,9 @@ -build: gmi-web.1 gmi.css.5 +build: gmi-web.1 npm install gmi-web.1: gmi-web.1.scd scdoc < $< > $@ -gmi.css.5: gmi.css.5.scd - scdoc < $< > $@ - example/test.html: example/test.gmi ./test.sh diff --git a/cli.js b/cli.js index 3d4c399..c1e45f3 100755 --- a/cli.js +++ b/cli.js @@ -40,7 +40,8 @@ const cli = yargs(process.argv.slice(2)) requiresArg: true, }, descriptions: { - type: "boolean", + type: "number", + default: 0, }, css: { default: "full", @@ -69,13 +70,15 @@ const cli = yargs(process.argv.slice(2)) hidden: true, default: false, }, - }); - + }) + .group(["html", "body"], "Core:") + .group(["author", "descriptions", "css", "mode", "dir"], "HTML:") + .group(["image", "audio", "video"], "Inline Media:"); const CSS_VARS = CSS.rootVariables(CSS.FULL); Object.keys(CSS_VARS).map((key) => { cli.option(key, { default: CSS_VARS[key] }); - cli.option(key, "core"); - cli.option(key, "none"); + cli.conflicts(key, "core"); + cli.conflicts(key, "none"); return key; }); cli.group(Object.keys(CSS_VARS), "CSS:"); @@ -84,9 +87,6 @@ const argv = cli .conflicts("author", "body") .conflicts("descriptions", "body") .conflicts("html", "body") - .group(["html", "body"], "Core:") - .group(["author", "descriptions", "css", "mode", "dir"], "HTML:") - .group(["image", "audio", "video"], "Inline Media:") .alias("html", "language") .alias("html", "lang") .showHelpOnFail(true) diff --git a/gmi-web.1 b/gmi-web.1 index 4f9341b..aa4121a 100644 --- a/gmi-web.1 +++ b/gmi-web.1 @@ -13,9 +13,9 @@ gmi-web - a bridge between Gemini and HTML .P .SH SYNOPSIS .P -\fBgmi-web\fR [--html \fILANG\fR|--body] <\fIOPTIONS\fR> < [\fIFILE\fR] +\fBgmi-web\fR \fIOPTIONS\fR < \fIFILE\fR .P -\fBgmi-web\fR [--html \fILANG\fR|--body] <\fIOPTIONS\fR> [\fIFILES\fR] +\fBgmi-web\fR \fIOPTIONS\fR \fIFILES\fR .P .SH DESCRIPTION .P @@ -36,8 +36,7 @@ to adjust the document text direction from "ltr" to "rtl". .P Use \fB--descriptions\fR \fILIMIT\fR to apply the first non-empty text line of each file as the description tag. \fILIMIT\fR will be used to truncate the text -with an ellipsis at that number of characters, otherwise the whole line will -be used. +with an ellipsis at that number of characters. .P Use \fB--author\fR \fINAME\fR to set the author tag on every file. .P @@ -62,7 +61,7 @@ with CSS 2.1's Normal Flow and inline elements. Pointing to a .css \fIFILE\fR will use those styles. .P Choosing \fBnone\fR will not include any style information including when paired -with \fB--body\fR where it will NOT apply the core inline styles. +with \fB--body\fR where it will not apply the core inline styles. .P .RE \fB[--image|--audio|--video]\fR \fIEXTENSIONS\fR @@ -80,7 +79,7 @@ gmi-web --html en \\ .fi .RE .P -\fB--config\fR [\fIJSON\fR] +\fB--config\fR \fIJSON\fR .RS 4 All the options documented here and by \fB--help\fR may be captured in a .json file and passed to \fB--config\fR instead of as flags on the command-line. diff --git a/gmi-web.1.scd b/gmi-web.1.scd index bdd8652..1afb41b 100644 --- a/gmi-web.1.scd +++ b/gmi-web.1.scd @@ -6,9 +6,9 @@ gmi-web - a bridge between Gemini and HTML # SYNOPSIS -*gmi-web* [--html _LANG_|--body] <_OPTIONS_> < [_FILE_] +*gmi-web* _OPTIONS_ < _FILE_ -*gmi-web* [--html _LANG_|--body] <_OPTIONS_> [_FILES_] +*gmi-web* _OPTIONS_ _FILES_ # DESCRIPTION @@ -26,8 +26,7 @@ mobile-friendly fashion! Use *--descriptions* _LIMIT_ to apply the first non-empty text line of each file as the description tag. _LIMIT_ will be used to truncate the text - with an ellipsis at that number of characters, otherwise the whole line will - be used. + with an ellipsis at that number of characters. Use *--author* _NAME_ to set the author tag on every file. @@ -46,7 +45,7 @@ gmi-web --html en \\ will use those styles. Choosing *none* will not include any style information including when paired - with *--body* where it will NOT apply the core inline styles. + with *--body* where it will not apply the core inline styles. *[--image|--audio|--video]* _EXTENSIONS_ Include media extensions inline. You can provide multiple extensions per flag @@ -59,7 +58,7 @@ gmi-web --html en \\ --audio mp3 ogg < doc.gmi ``` -*--config* [_JSON_] +*--config* _JSON_ All the options documented here and by *--help* may be captured in a .json file and passed to *--config* instead of as flags on the command-line. diff --git a/gmi.css.5 b/gmi.css.5 deleted file mode 100644 index 6b70082..0000000 --- a/gmi.css.5 +++ /dev/null @@ -1,102 +0,0 @@ -.\" Generated by scdoc 1.10.1 -.\" Complete documentation for this program is not available as a GNU info page -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.nh -.ad l -.\" Begin generated content: -.TH "gmi.css" "5" "2021-02-12" "1.0.0-rc.2" -.P -.SH NAME -.P -\fBgmi.css\fR - stylesheet for Gemini generated HTML. -.P -.SH VARIABLES -.P -.nf -.RS 4 ---body-width: 48rem; ---foreground: black; ---background: white; ---p-size: 1\&.25rem; ---p-indent: 0rem; ---p-line-height: 1\&.5; ---a-size: var(--p-size); ---pre-size: 1rem; ---pre-line-height: 1; ---h1-size: 3rem; ---h2-size: 2\&.25rem; ---h3-size: 1\&.5rem; ---heading-line-height: 1\&.25; ---ul-size: var(--p-size); ---ul-line-height: 1\&.25; ---blockquote-size: var(--p-size); ---blockquote-line-height: 1\&.25; ---mono: Consolas, monaco, monospace; ---serif: georgia, times, serif; ---sans-serif: -apple-system, BlinkMacSystemFont, "avenir next", avenir, - helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, - sans-serif; -.fi -.RE -.P -Any of the variables can be customized by adding a style attribute to the - element. -.P -.nf -.RS 4 - -.fi -.RE -.P -The \fB--foreground\fR and \fB--background\fR variables will be inverted when -\fBprefers-color-scheme\fR is "dark". -https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme -.P -.SH USAGE -.P -The simplest way to use gmi.css is to include a link to it in the of -your document. -.P -.nf -.RS 4 - -.fi -.RE -.P -It could also be minimized and/or included directly in a