Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error found when generating JSON doc #5942

Closed
firedfox opened this issue Mar 29, 2016 · 2 comments
Closed

Error found when generating JSON doc #5942

firedfox opened this issue Mar 29, 2016 · 2 comments
Labels
doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory.

Comments

@firedfox
Copy link
Contributor

  • Version: master b1c0587
  • Platform: Darwin firedfox-mbp.local 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
  • Subsystem: tools

When I run tools/doc/generate.js to build JSON format docs, I see this error:

Input file = fs.markdown
/Users/firedfox/git/node/tools/doc/json.js:207
        throw new Error('invalid list - text without current item\n' +
        ^

Error: invalid list - text without current item
{"type":"text","text":"`callback` {Function}"}
[{"type":"list_start","ordered":false},{"type":"list_item_start"},{"type":"text","text":"`path` {String | Buffer}"},{"type":"list_item_end"},{"type":"list_item_start"},{"type":"text","text":"`options` {String | Object}"},{"type":"list_start","ordered":false},{"type":"list_item_start"},{"type":"text","text":"`encoding` {String} default = `'utf8'`"},{"type":"list_item_end"},{"type":"list_end"},{"type":"list_item_end"},{"type":"loose_item_start"},{"type":"text","text":"`callback` {Function}"},{"type":"list_item_end"},{"type":"loose_item_start"},{"type":"text","text":"`path` {String}"},{"type":"list_item_end"},{"type":"list_item_start"},{"type":"text","text":"`callback` {Function}"},{"type":"space"},{"type":"list_item_end"},{"type":"list_end"}]
    at /Users/firedfox/git/node/tools/doc/json.js:207:15
    at Array.forEach (native)
    at processList (/Users/firedfox/git/node/tools/doc/json.js:183:8)
    at /Users/firedfox/git/node/tools/doc/json.js:115:9
    at Array.forEach (native)
    at doJSON (/Users/firedfox/git/node/tools/doc/json.js:17:9)
    at next (/Users/firedfox/git/node/tools/doc/generate.js:42:27)
    at /Users/firedfox/git/node/tools/doc/preprocess.js:16:5
    at processIncludes (/Users/firedfox/git/node/tools/doc/preprocess.js:26:33)
    at preprocess (/Users/firedfox/git/node/tools/doc/preprocess.js:13:3)

It's caused by the following content in fs.markdown:

## fs.readdir(path[, options], callback)

* `path` {String | Buffer}
* `options` {String | Object}
  * `encoding` {String} default = `'utf8'`
* `callback` {Function}

* `path` {String}
* `callback` {Function}

Current processList function in tools/doc/json.js does not recognise the second path and callback's {"type":"loose_item_start"}. I'll make a PR to fix it.

@mscdex mscdex added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Mar 29, 2016
@firedfox firedfox changed the title JSON doc generate error Error found when generating JSON doc Mar 29, 2016
@eljefedelrodeodeljefe
Copy link
Contributor

Thanks for reporting and fixing. Just reviewed the PR.

@silverwind
Copy link
Contributor

Suggestion on preventing issues like this one in the future: #5955

evanlucas pushed a commit that referenced this issue Mar 30, 2016
Current processList function in tools/doc/json.js does not recognise
{"type":"loose_item_start"}. Fix it.

PR-URL: #5943
Fixes: #5942
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
evanlucas pushed a commit that referenced this issue Mar 31, 2016
Current processList function in tools/doc/json.js does not recognise
{"type":"loose_item_start"}. Fix it.

PR-URL: #5943
Fixes: #5942
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
MylesBorins pushed a commit that referenced this issue Apr 11, 2016
Current processList function in tools/doc/json.js does not recognise
{"type":"loose_item_start"}. Fix it.

PR-URL: #5943
Fixes: #5942
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants