clean
This commit is contained in:
parent
2ade53f268
commit
ddaf0c5ada
17
cli.js
17
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;
|
||||
|
||||
|
|
6
html.js
6
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 !== ""
|
||||
? `<meta name="color-scheme" content="dark light">`
|
||||
: ""
|
||||
}
|
||||
${options.css !== "" ? `<meta name="color-scheme" content="dark light">` : ""}
|
||||
${options.css !== "" ? `<style>${options.css}</style>` : ""}
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="${options.charset}">
|
||||
|
|
Loading…
Reference in a new issue