vigour-io / doc

A collection of tools to help make great docs with minimal effort
ISC License
0 stars 0 forks source link

running vdoc on doc repo errors #22

Open DanilloCorvalan opened 8 years ago

DanilloCorvalan commented 8 years ago

error log:

Unhandled rejection Error: Invalid JSON
    at /usr/local/lib/node_modules/vigour-doc/lib/plugins/badges.js:34:21
    at Array.map (native)
    at Object.badges (/usr/local/lib/node_modules/vigour-doc/lib/plugins/badges.js:24:36)
    at /usr/local/lib/node_modules/vigour-doc/lib/start.js:30:75
    at tryCatcher (/usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/promise.js:628:18)
    at /usr/local/lib/node_modules/vigour-doc/node_modules/bluebird/js/release/nodeback.js:42:21
    at /usr/local/lib/node_modules/vigour-doc/node_modules/vigour-fs/lib/server.js:128:7
    at /usr/local/lib/node_modules/vigour-doc/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)

When remove code examples on readme it works :)

shawninder commented 8 years ago

Ah yes I had forgotten this one. We need to ignore the vdoc placeholder comments that are in a code block or blockquote...

shawninder commented 8 years ago

This might need some serious regular expression skills.. Or maybe it's time to switch to real parsing, using something like markdown-parser, which produces a markdown abstract syntax tree. With an AST, it should be extremely simple to differentiate real comments from comments inside a code block.

Of course we would then have to make sure the parser we use understands github-flavoured-markdown, not just the basic version...

shawninder commented 8 years ago

See https://github.com/vigour-io/doc/issues/23