From 384aeae9ea660fa1784a7ed68bcd232a6a3001fe Mon Sep 17 00:00:00 2001 From: John-Kim Date: Thu, 8 Dec 2022 21:39:14 +0900 Subject: [PATCH] Fix CLI css, template, and marked options not honored. Fixes https://github.com/jashkenas/docco/issues/424. --- docco.js | 12 ++++++------ docco.litcoffee | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docco.js b/docco.js index 6c9aceac..4479f979 100644 --- a/docco.js +++ b/docco.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 2.6.1 +// Generated by CoffeeScript 2.7.0 (function() { // Docco // ===== @@ -285,8 +285,8 @@ // In this case, it is also neccessary to explicitly specify a stylesheet file. // These custom templates are compiled exactly like the predefined ones, but the `public` folder // is only copied for the latter. - if (options.template) { - if (!options.css) { + if (config.template) { + if (!config.css) { console.warn("docco: no stylesheet file specified"); } config.layout = null; @@ -296,11 +296,11 @@ config.public = path.join(dir, 'public'); } config.template = path.join(dir, 'docco.jst'); - config.css = options.css || path.join(dir, 'docco.css'); + config.css = config.css || path.join(dir, 'docco.css'); } config.template = _.template(fs.readFileSync(config.template).toString()); - if (options.marked) { - config.marked = JSON.parse(fs.readFileSync(options.marked)); + if (config.marked) { + config.marked = JSON.parse(fs.readFileSync(config.marked)); } config.sources = options.args.filter(function(source) { var lang; diff --git a/docco.litcoffee b/docco.litcoffee index 7c43a8d4..5d3331fe 100644 --- a/docco.litcoffee +++ b/docco.litcoffee @@ -253,19 +253,19 @@ In this case, it is also neccessary to explicitly specify a stylesheet file. These custom templates are compiled exactly like the predefined ones, but the `public` folder is only copied for the latter. - if options.template - unless options.css + if config.template + unless config.css console.warn "docco: no stylesheet file specified" config.layout = null else dir = config.layout = path.join __dirname, 'resources', config.layout config.public = path.join dir, 'public' if fs.existsSync path.join dir, 'public' config.template = path.join dir, 'docco.jst' - config.css = options.css or path.join dir, 'docco.css' + config.css = config.css or path.join dir, 'docco.css' config.template = _.template fs.readFileSync(config.template).toString() - if options.marked - config.marked = JSON.parse fs.readFileSync(options.marked) + if config.marked + config.marked = JSON.parse fs.readFileSync(config.marked) config.sources = options.args.filter((source) -> lang = getLanguage source, config