tweak
This commit is contained in:
parent
94abcfd542
commit
0e7b1f086e
60
README.md
60
README.md
|
@ -71,6 +71,36 @@ A command-line utility that pulls all of the above together into a unix-like API
|
|||
npm install --global gmi-web-cli && gmi-web --help
|
||||
```
|
||||
|
||||
## config
|
||||
|
||||
A JSON file can be passed to `--config` for conveniently applying any option without using the command-line flag. For example a `web.json` file with the following contents...
|
||||
|
||||
```json
|
||||
{
|
||||
"html": "en",
|
||||
"descriptions": 200,
|
||||
"foreground": "#137752",
|
||||
"background": "#F4F4F4"
|
||||
}
|
||||
```
|
||||
|
||||
...can be used like so:
|
||||
|
||||
```sh
|
||||
gmi-web --config web.json $(find ~/gmi/dst -name '*.gmi')
|
||||
```
|
||||
|
||||
## custom css
|
||||
|
||||
It is possible to use your own set of completely custom CSS rules _and_ variables by pointing to a file containing them.
|
||||
|
||||
```sh
|
||||
gmi-web --body --css custom.css < doc.gmi
|
||||
```
|
||||
|
||||
gmi-web auto-detects the need for the `<meta>` color-schemes and allows for using `--inline` to insert the declarations as `style` properties on their respective blocks. Variables defined in `:root` will be picked up and made available for configuration just like gmi-web.css.
|
||||
|
||||
|
||||
```
|
||||
gmi-web [files..]
|
||||
|
||||
|
@ -122,6 +152,7 @@ CSS:
|
|||
--ul-family [default: "var(--serif)"]
|
||||
--ul-size [default: "var(--p-size)"]
|
||||
--ul-height [default: "1.25"]
|
||||
--ul-style [default: "circle"]
|
||||
--quote-family [default: "var(--serif)"]
|
||||
--quote-size [default: "var(--p-size)"]
|
||||
--quote-height [default: "1.25"]
|
||||
|
@ -141,35 +172,6 @@ Examples:
|
|||
See the gmi-web(1) man page for more information.
|
||||
```
|
||||
|
||||
## config
|
||||
|
||||
A JSON file can be passed to `--config` for conveniently applying any option without using the command-line flag. For example a `web.json` file with the following contents...
|
||||
|
||||
```json
|
||||
{
|
||||
"html": "en",
|
||||
"descriptions": 200,
|
||||
"foreground": "#137752",
|
||||
"background": "#F4F4F4"
|
||||
}
|
||||
```
|
||||
|
||||
...can be used like so:
|
||||
|
||||
```sh
|
||||
gmi-web --config web.json $(find ~/gmi/dst -name '*.gmi')
|
||||
```
|
||||
|
||||
## custom css
|
||||
|
||||
It is possible to use your own set of completely custom CSS rules _and_ variables by pointing to a .css file containing them.
|
||||
|
||||
```sh
|
||||
gmi-web --body --css custom.css < doc.gmi
|
||||
```
|
||||
|
||||
gmi-web auto-detects the need for the `<meta>` color-schemes and allows for using `--inline` to insert the declarations as `style` properties on their respective blocks. Variables defined in `:root` will be picked up and made available for customization via command-line flags.
|
||||
|
||||
# license
|
||||
|
||||
gmi-web is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.
|
||||
|
|
12
cli.js
12
cli.js
|
@ -82,13 +82,13 @@ const cli = yargs(process.argv.slice(2))
|
|||
});
|
||||
|
||||
const CSS_VARS = CSS.rootVariables(CSS.load({ css: "gmi-web.css" }));
|
||||
Object.keys(CSS_VARS).map((key) => {
|
||||
cli.option(key, { default: CSS_VARS[key] });
|
||||
cli.conflicts(key, "core");
|
||||
cli.conflicts(key, "none");
|
||||
return key;
|
||||
Object.keys(CSS_VARS).forEach((key) => {
|
||||
const opt = key.replace("--", "")
|
||||
cli.option(opt, { default: CSS_VARS[key] });
|
||||
cli.conflicts(opt, "core");
|
||||
cli.conflicts(opt, "none");
|
||||
});
|
||||
cli.group(Object.keys(CSS_VARS), "CSS:");
|
||||
cli.group(Object.keys(CSS_VARS).map(key => key.replace("--", "")), "CSS:");
|
||||
|
||||
const argv = cli
|
||||
.conflicts("author", "body")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gmi-web-cli",
|
||||
"version": "1.0.0-rc.3",
|
||||
"version": "1.0.1-rc.3",
|
||||
"description": "A bridge between HTML and Gemini",
|
||||
"main": "html.js",
|
||||
"type": "module",
|
||||
|
|
Loading…
Reference in a new issue