| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This pull request will require a lot of discussion. Other puzzles:
$ grep -l '"ctors"' out/doc/api/*.json out/doc/api/all.json out/doc/api/crypto.json out/doc/api/stream.json $ git grep -l '## Constructor:' doc/api/*.md doc/api/inspector.md doc/api/stream.md doc/api/url.md doc/api/vm.md $ git grep -l '## new ' doc/api/*.md doc/api/assert.md doc/api/async_hooks.md doc/api/buffer.md doc/api/console.md doc/api/crypto.md doc/api/errors.md doc/api/http.md doc/api/net.md doc/api/perf_hooks.md doc/api/stream.md doc/api/string_decoder.md doc/api/tls.md doc/api/util.md doc/api/v8.md doc/api/vm.md doc/api/worker_threads.md My current code is rejecting the constructor for console as the first signature defines parameters that are included in the list list below (at least not as first level items): ### new Console(stdout[, stderr][, ignoreErrors])
### new Console(options)
<!-- YAML
...
-->
* `options` {Object}
* `stdout` {stream.Writable}
* `stderr` {stream.Writable}
* `ignoreErrors` {boolean} Ignore errors when writing to the underlying
streams. **Default:** `true`.
* `colorMode` {boolean|string} Set color support for this `Console` instance.
Setting to `true` enables coloring while inspecting values, setting to
`'auto'` will make color support depend on the value of the `isTTY` property
and the value returned by `getColorDepth()` on the respective stream.
**Default:** `'auto'`.
I can fix this up, but not seeing the Console constructor in the current output means that I'm flying blind. |
Sorry, something went wrong.
There was a problem hiding this comment.
Is this a brand new file or is it pulled from another source? brand new files do not require the copyright header to be added.
Sorry, something went wrong.
There was a problem hiding this comment.
Ultimately, it will be renamed to tools/doc/json2.js, and contains significant content from the original source.
Currently separate so that side by side comparisons of the output can be produced, via jsondiff.js, which will be removed when this effort is complete.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, thanks for clarification :-)
Sorry, something went wrong.
|
Latest issue: files like buffer.json sometimes parses stability correctly, e.g.: "stability": 2 And other times misses it entirely: "desc": "<p>Stability: 0 - Deprecated: Use\n..." The issue here is the embedded newline. The bug here is that stabilityExpr needs dotAll or equivalent. |
Sorry, something went wrong.
|
This pull request is no longer in progress, nor is it ready to land. It depends on #21782 and #21780. In addition to providing fixes to the bugs mentioned above and listed in jsondiff.js, it differs from the output currently produced in that backslashes won't show up in names (for an example, look for "name": "\_\_filename" in modules.json. Work remaining to be done before this lands: rename json2.js to json.js (overwriting the original source) and deleting jsondiff.js. For the moment, I'm leaving both sources and the diff tool with the thought that it would help reviewers. Once #21490 lands, further refactoring and cleanup is possible. |
Sorry, something went wrong.
|
Removed the blocked label. |
Sorry, something went wrong.
Sorry, something went wrong.
|
CI is all green. |
Sorry, something went wrong.
|
I've compared the diff in *.html results. It seems we have only this significant difference: some comments disappear in the new HTML docs, such as: <!--introduced_in=v...-->
<!-- type=misc -->
<!--type=class-->
<!--type=module-->
<!-- type=global -->
<!-- type=var -->
<!--type=event-->
<!--type=example-->
<!-- name=dgram -->
<!--name=esm-->
<!--name=fs-->
<!--name=module-->
<!--name=SIGINT, SIGHUP, etc.-->
<!--name=querystring-->
<!--name=vm-->Not sure if this is breaking in any aspect. Maybe we can ignore this change as these comments seem needed at the generation stage only. |
Sorry, something went wrong.
|
Ignorable note: json.js uses many iterations over elements using their properties with repetitive retrieving. Maybe it is worth to cache the properties once, especially if the element itself is not used. Say: nodes.forEach((node, i) => {-> nodes.forEach(({ type, value, children }, i) => {or: return nodes.map((node) => {-> return nodes.map(({ type, position, value, children }) => {etc. |
Sorry, something went wrong.
There was a problem hiding this comment.
Just some comment nits.
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: // Extract definitions.
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: output: { name: module }.
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: it seems this can be unwrapped.
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: extra space in parent. Sometimes.
Sorry, something went wrong.
There was a problem hiding this comment.
Ditto in description. If.
Sorry, something went wrong.
There was a problem hiding this comment.
Ditto in match. If.
Sorry, something went wrong.
There was a problem hiding this comment.
Stablility -> Stability
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, old debt: reduse -> reduce.
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, old debt: parse out -> parses out.
Sorry, something went wrong.
|
CC @nodejs/documentation @nodejs/build @nodejs/build-files: please, let us know if you plan to review this PR in the near future. Otherwise, I will land it, say, on Wednesday. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Rubber-stamp LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
RSLGTM
Sorry, something went wrong.
Sorry, something went wrong.
... but we can update to the latest :-)
|
rebased |
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #21697 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
|
Depends on #21616 to land on v10.x-staging |
Sorry, something went wrong.
PR-URL: #21697 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
PR-URL: nodejs#22749 Refs: nodejs#21697 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
work in progress. tools/doc/json2.js is a first pass attempt to convert tools/doc/json.js to a new markdown toolchain. The original intent was to produce functionally identical JSON, but some oddities have been found along the way. Examples: (highest priority first):
The current (soon to be previous?) processing is based on a stream of tokens and a state machine. The new process is based on a pipeline of processors that have access to a tree of tokens. Care has been taken to not modify the stream so that this processor can be added to the pipeline that produces HTML.
Checklist