Skip to content

Commit

Permalink
allow the --style option to be used multiple times elliotblackburn#207
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK32 committed Nov 27, 2024
1 parent 3e0b458 commit 5b00727
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const cli = meow(
style: {
type: 'string',
shortFlag: 's',
isMultiple: true,
},
header: {
type: 'string',
Expand Down Expand Up @@ -100,6 +101,7 @@ const destination =
cli.input[1] || source.slice(0, source.indexOf('.md')) + '.pdf';
const debug = cli.flags.debug || false;
let style = cli.flags.style;
let style_files = style.map(function(s) { return resolve(s); });
const header = cli.flags.header;
const headerHeight = cli.flags.hHeight;
const footer = cli.flags.footer;
Expand Down Expand Up @@ -130,7 +132,7 @@ const options = {
defaultStyle: true,
source: resolve(source),
destination: resolve(destination),
styles: style ? resolve(style) : null,
styles: style ? style_files : null,
header: header ? resolve(header) : null,
footer: footer ? resolve(footer) : null,
noEmoji: cli.flags.noEmoji || false,
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const headerLayoutPath = join(__dirname, '/layouts/header.hbs');
const footerLayoutPath = join(__dirname, '/layouts/footer.hbs');

function getAllStyles(options) {
const cssStyleSheets = [];
let cssStyleSheets = [];

// GitHub Markdown Style
if (options.ghStyle) {
Expand All @@ -46,7 +46,7 @@ function getAllStyles(options) {

// Optional user given CSS
if (options.styles) {
cssStyleSheets.push(options.styles);
cssStyleSheets = cssStyleSheets.concat(options.styles);
}

return {
Expand Down

0 comments on commit 5b00727

Please sign in to comment.