0

I'm using grunt-docco (https://github.com/DavidSouther/grunt-docco) which runs docco on a project in a Grunt workflow.

However, I've ran into an issue (https://github.com/DavidSouther/grunt-docco/issues/34) involving passing options to Marked (https://github.com/chjj/marked), which is used inside of Docco.

My question is -- is there a way to pass marked options when creating a docco instance? The documentation for docco to do something like this isn't entirely clear to me, but I know there must be some way.

Please help if you can! Here is the stack trace from the grunt task:

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
streetlight
  • 5,968
  • 13
  • 62
  • 101
  • Okay, update! This issue is being caused by an update in highlight.js and docco. See: https://github.com/jashkenas/docco/pull/258 – streetlight Jan 09 '14 at 15:46
  • However, if anyone knows how to pass custom options in, please answer! I think it could be good otherwise and help people in the future. – streetlight Jan 09 '14 at 15:46

0 Answers0