getting closeeee

This commit is contained in:
Talon Poole 2021-01-29 23:27:39 +00:00
parent 8ea7873403
commit 6ec48f2605
5 changed files with 19 additions and 15 deletions

View file

@ -70,15 +70,13 @@ npm install -g git+https://codeberg.org/talon/gmi-web.git
man gmi-web
```
### example
Render .html for all the .gmi files in the current directory
```sh
gmi-web $(find . -name *.gmi)
gmi-web --lang en $(find . -name *.gmi)
```
## gmi.css
### gmi.css
Optimized for readability, predictability, mobile-friendliness and
ships with a handful of customizable variables. See `man 5 gmi.css`.
@ -96,7 +94,7 @@ Any of the variables can be customized by adding a style to the `<html>` elemen
When using `gmi-web(1)` they can be customized by providing _OPTIONS_ of the same name as the CSS variable.
```sh
gmi-web --foreground "#FFFFF" --background "#00000" *.gmi
gmi-web --lang en --foreground "#FFFFF" --background "#00000" *.gmi
```
# License

3
cli.js
View file

@ -31,7 +31,7 @@ const GMI_CSS_VARS = [
require("yargs")
.scriptName("gmi-web")
.command(
"$0 [files..]",
"$0 [--lang] [files..]",
"Convert .gmi to .html. See gmi-web(1) for more details.",
(yargs) =>
yargs
@ -67,7 +67,6 @@ require("yargs")
"gmi.css is included by default. Use --no-css to for the bare-minimum <style>",
}),
(argv) => {
console.log(argv)
const override = GMI_CSS_VARS.reduce((style, key) => {
if (argv[key]) {
style += `--${key}: ${argv[key]};`;

View file

@ -13,7 +13,7 @@ gmi-web - A bridge between Gemini and HTML.
.P
.SH SYNOPSIS
.P
\fBgmi-web\fR <\fIOPTIONS\fR> [\fIFILES\fR]
\fBgmi-web\fR [--lang] <\fIOPTIONS\fR> [\fIFILES\fR]
.P
.SH DESCRIPTION
.P
@ -22,12 +22,17 @@ and mobile-friendly fashion!
.P
.SH OPTIONS
.P
\fB--lang\fR
.RS 4
Required for <meta languge="">
.P
.RE
\fBCSS Variables\fR
.RS 4
Any variable documented in \fBgmi.css\fR(5) can be set via \fIOPTIONS\fR of the same
name.
.P
\fBgmi-web\fR --foreground "#FFFFF" --background "#00000" $(find . -name *.gmi)
\fBgmi-web\fR --lang "en" --foreground "#FFFFF" --background "#00000" $(find . -name *.gmi)
.P
.RE
\fB--images\fR \fB--audio\fR \fB--video\fR
@ -46,7 +51,7 @@ Render .html for all the .gmi files in the current directory
.P
.nf
.RS 4
gmi-web $(find \&. -name *\&.gmi)
gmi-web --lang en $(find \&. -name *\&.gmi)
.fi
.RE
.P

View file

@ -6,7 +6,7 @@ gmi-web - A bridge between Gemini and HTML.
# SYNOPSIS
*gmi-web* <_OPTIONS_> [_FILES_]
*gmi-web* [--lang] <_OPTIONS_> [_FILES_]
# DESCRIPTION
@ -15,14 +15,14 @@ and mobile-friendly fashion!
# OPTIONS
*--languge*
*--lang*
Required for <meta languge="">
*CSS Variables*
Any variable documented in *gmi.css*(5) can be set via _OPTIONS_ of the same
name.
*gmi-web* --foreground "#FFFFF" --background "#00000" $(find . -name \*.gmi)
*gmi-web* --lang "en" --foreground "#FFFFF" --background "#00000" $(find . -name \*.gmi)
*--images* *--audio* *--video*
Include the respective media inline.
@ -35,7 +35,7 @@ and mobile-friendly fashion!
Render .html for all the .gmi files in the current directory
```
gmi-web $(find . -name \*.gmi)
gmi-web --lang en $(find . -name \*.gmi)
```
# SEE ALSO

View file

@ -44,7 +44,9 @@ function head(file, title, options) {
}${
!options.canonical
? ""
: `<link rel="canonical" href="gemini://${options.canonical}/${file.replace(TOKENS_EXT, ".gmi")}">`
: `<link rel="canonical" href="gemini://${
options.canonical
}/${file.replace(TOKENS_EXT, ".gmi")}">`
}
<title>${title}</title>
</head>