我正在使用grunt-docco(https://github.com/DavidSouther/grunt-docco),它在Grunt工作流程中的项目上运行docco。
但是,我遇到了一个问题(https://github.com/DavidSouther/grunt-docco/issues/34),涉及将选项传递给Marked(https://github.com/chjj/marked),这是在Docco内部使用的。
我的问题是 - 有没有办法在创建docco实例时传递标记选项? docco做这样的事情的文档对我来说并不完全清楚,但我知道必须有某种方式。
如果可以,请帮忙!这是来自grunt任务的堆栈跟踪:
Running "docco:debug" (docco) task
docco: public/js/collections/SomeCollection1.js -> doc/SomeCollection1.html
docco: public/js/collections/SomeCollection2.js -> doc/SomeCollection2.html
docco: public/js/common.js -> doc/common.html
docco: public/js/config.js -> doc/config.html
docco: public/js/config/file-types.js -> doc/file-types.html
docco: public/js/controllers/GlobalController.js -> doc/GlobalController.html
docco: public/js/layouts/SomeLayout.js -> doc/SomeLayout.html
docco: public/js/layouts/AppLayout.js -> doc/AppLayout.html
Fatal error: Cannot read property 'javascript' of undefined
Please report this to https://github.com/chjj/marked.
TypeError: Cannot read property 'javascript' of undefined
Please report this to https://github.com/chjj/marked.
at Object.marked.setOptions.highlight (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/docco.js:105:34)
at Renderer.code (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/node_modules/marked/lib/marked.js:744:23)
at Parser.tok (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/node_modules/marked/lib/marked.js:953:28)
at Parser.parse (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/node_modules/marked/lib/marked.js:896:17)
at Function.Parser.parse (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/node_modules/marked/lib/marked.js:883:17)
at marked (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/node_modules/marked/lib/marked.js:1163:19)
at format (/home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/docco.js:119:40)
at /home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt-docco/node_modules/docco/docco.js:44:11
at fs.js:266:14
at /home/jenkins/jenkins/workspace/MyProject (Tech)/web-client/client/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js:90:5