ducksoupdev / gulp-site-generator

A static site generator using Gulp
183 stars 29 forks source link

Not passing a markdown parser to gulp-markdown-to-json? #21

Closed ringods closed 8 years ago

ringods commented 8 years ago

Shouldn't the code allow for passing a markdown parser to the gulp plugin? The documentation states clearly that you still have to add your own parser:

https://github.com/sparkartgroup/gulp-markdown-to-json#dependencies

The current state of the code doesn't pass anything:

https://github.com/ducksoupdev/gulp-site-generator/blob/be58dcd57b60407f05924c55330299d0e2719849/gulp/tasks/content.js#L10

Currently, I get this error:

> gulp

[15:46:57] Using gulpfile /pipeline/source/gulpfile.js
[15:46:57] Starting 'sass'...
[15:46:57] Starting 'copy-fonts'...
[15:46:57] Starting 'copy-css'...
[15:46:57] Starting 'concat-js'...
[15:46:57] Starting 'image-min'...
[15:46:57] Finished 'copy-fonts' after 35 ms
[15:46:57] Finished 'concat-js' after 30 ms
[15:46:57] Finished 'copy-css' after 55 ms
[15:46:57] Finished 'sass' after 98 ms
[15:46:57] Finished 'image-min' after 142 ms
[15:46:57] Starting 'copy-assets'...
[15:46:57] Finished 'copy-assets' after 4 ms
[15:46:57] Starting 'content'...
/pipeline/source/node_modules/gulp-markdown-to-json/lib/plugin.js:45
    if (!config.renderer || typeof config.renderer !== 'function') return callback(pluginError('Markdown renderer function required'));
               ^

TypeError: Cannot read property 'renderer' of undefined
    at DestroyableTransform._transform (/pipeline/source/node_modules/gulp-markdown-to-json/lib/plugin.js:45:16)
    at DestroyableTransform.Transform._read (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
    at DestroyableTransform.Writable.write (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11)
    at Transform.ondata (/pipeline/source/node_modules/readable-stream/lib/_stream_readable.js:542:20)
    at emitOne (events.js:96:13)
    at Transform.emit (events.js:188:7)
    at readableAddChunk (/pipeline/source/node_modules/readable-stream/lib/_stream_readable.js:213:18)
    at Transform.Readable.push (/pipeline/source/node_modules/readable-stream/lib/_stream_readable.js:172:10)
    at Transform.push (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:123:32)
    at afterTransform (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:79:51)
    at TransformState.afterTransform (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:58:12)
    at doReplace (/pipeline/source/node_modules/gulp-replace/index.js:52:18)
    at Transform.transform [as _transform] (/pipeline/source/node_modules/gulp-replace/index.js:74:7)
    at Transform._read (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at Transform._write (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/pipeline/source/node_modules/readable-stream/lib/_stream_writable.js:319:64)
    at writeOrBuffer (/pipeline/source/node_modules/readable-stream/lib/_stream_writable.js:308:5)
    at Transform.Writable.write (/pipeline/source/node_modules/readable-stream/lib/_stream_writable.js:246:11)
    at write (/pipeline/source/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
ducksoupdev commented 8 years ago

Hi, looks like the gulp-markdown-to-json plugin might have changed. Will investigate and report back.

ringods commented 8 years ago

@ducksoupdev the node tools/install script did not add the required dependencies to my package.json. So I added the manually without specifying any version. So i got the latest. Once I reverted to the same versions as in the package.json of this repo, all worked correctly.