lintry

增加命令行主题参数

......@@ -14,8 +14,8 @@ program
.command('export <markdown_file> [html_file]')
.alias('e')
.description('export markdown to html')
.option('-A --abstract', 'abstract to current path')
.action(function (md, html) {
.option('-T --theme [theme_name]', 'css theme for html')
.action(function (md, html, options) {
//判断目标输出参数
if (!fs.existsSync(md)) {
console.error(chalk.red(md + ' is not found'));
......@@ -33,7 +33,8 @@ program
fs.ensureFileSync(output);
const viewer = new (require('../lib/view-markdown'))(process.cwd(), {inline: true});
let result = viewer.render(md, 'metro-lake');
let theme = options.theme || 'news';
let result = viewer.render(md, theme);
fs.writeFile(output, result);
console.log('html is exported to', chalk.green(output))
......