0

我正在使用 grunt-docco ( https://github.com/DavidSouther/grunt-docco ) 在 Grunt 工作流程中的项目上运行 docco。

但是,我遇到了一个问题(https://github.com/DavidSouther/grunt-docco/issues/34),涉及将选项传递给标记(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
4

0 回答 0