move styleTag and inlineCSS to html.js
This commit is contained in:
parent
f602022f84
commit
cae50a7a93
3
cli.js
3
cli.js
|
@ -109,9 +109,6 @@ if (!argv.html && !argv.body) {
|
|||
cli.exit(1);
|
||||
}
|
||||
|
||||
argv.inlineCSS = CSS.inline(argv);
|
||||
argv.styleTag = CSS.style(argv);
|
||||
|
||||
if (!argv.files) {
|
||||
let gemtext;
|
||||
try {
|
||||
|
|
7
html.js
7
html.js
|
@ -94,12 +94,15 @@ export function body(tokens, options) {
|
|||
}
|
||||
|
||||
export function toHTML(gemtext, options) {
|
||||
options.inlineCSS = options.inlineCSS || CSS.inline(options);
|
||||
options.styleTag = options.styleTag || CSS.style(options);
|
||||
|
||||
const tokens = tokenize(gemtext);
|
||||
|
||||
if (options.body) return body(tokens, options);
|
||||
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="${options.language}" dir="${
|
||||
<html lang="${options.html}" dir="${
|
||||
options.dir
|
||||
}" style='${options.inlineCSS("html")}'>
|
||||
<head>${head(
|
||||
|
@ -152,6 +155,8 @@ function description(tokens, options) {
|
|||
export const GMI_EXT = /\.gmi$/;
|
||||
|
||||
export function streamHTML(options) {
|
||||
options.inlineCSS = options.inlineCSS || CSS.inline(options);
|
||||
options.styleTag = options.styleTag || CSS.style(options);
|
||||
return map((file, cb) => {
|
||||
if (!GMI_EXT.test(file.path)) return cb(null);
|
||||
file.contents = Buffer.from(
|
||||
|
|
Loading…
Reference in a new issue