Skip to content

Commit

Permalink
feat: Added --auto-line-breaks option to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
akabekobeko committed Jan 18, 2021
1 parent 51afc52 commit 24fe380
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ const cli = meow(
$ echo <string> | vfm
Options
--style, -s Custom stylesheet path/URL
--partial, -p Output markdown fragments
--title Document title (ignored in partial mode)
--language Document language (ignored in partial mode)
--style, -s Custom stylesheet path/URL
--partial, -p Output markdown fragments
--title Document title (ignored in partial mode)
--language Document language (ignored in partial mode)
--auto-line-breaks Converts line breaks to <br>
Examples
$ vfm input.md
Expand All @@ -37,6 +38,9 @@ const cli = meow(
language: {
type: 'string',
},
autoLineBreaks: {
type: 'boolean',
},
},
},
);
Expand All @@ -49,6 +53,7 @@ function compile(input: string) {
style: cli.flags.style,
title: cli.flags.title,
language: cli.flags.language,
autoLineBreaks: cli.flags.autoLineBreaks,
}),
);
}
Expand All @@ -59,6 +64,7 @@ function main(
partial: { type: 'boolean'; alias: string };
title: { type: 'string' };
language: { type: 'string' };
autoLineBreaks: { type: 'boolean' };
}>,
) {
try {
Expand Down

0 comments on commit 24fe380

Please sign in to comment.