diff --git a/cli.js b/cli.js index c454554..e53dcd1 100755 --- a/cli.js +++ b/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 { diff --git a/html.js b/html.js index bae2527..ff7dd86 100644 --- a/html.js +++ b/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 ` - ${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(