tools: simplify tools/doc/preprocess.js#19539
Closed
vsemozhetbyt wants to merge 2 commits intonodejs:masterfrom
vsemozhetbyt:tools-doc-preprocess-simplify
Closed
tools: simplify tools/doc/preprocess.js#19539vsemozhetbyt wants to merge 2 commits intonodejs:masterfrom vsemozhetbyt:tools-doc-preprocess-simplify
vsemozhetbyt wants to merge 2 commits intonodejs:masterfrom
vsemozhetbyt:tools-doc-preprocess-simplify
Conversation
Contributor
Author
|
CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/289/ Let me know if we need full CI for this. |
trivikr
approved these changes
Mar 23, 2018
lpinca
approved these changes
Mar 23, 2018
tools/doc/preprocess.js
Outdated
| function processIncludes(inputFile, input, cb) { | ||
| const includes = input.match(includeExpr); | ||
| if (includes === null) return cb(null, input); | ||
| if (includes === null) return cb(null, input.replace(commentExpr, '')); |
Member
There was a problem hiding this comment.
Nit: I think dominant style is to put if body in a new line.
Contributor
Author
|
Added a fixup commit: put long |
Contributor
Author
|
Not sure if this can be fast-tracked. Feel free to add the label if so. |
watilde
approved these changes
Mar 23, 2018
vsemozhetbyt
added a commit
that referenced
this pull request
Mar 25, 2018
PR-URL: #19539 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
Contributor
Author
|
Landed in cde98ce |
targos
pushed a commit
that referenced
this pull request
Mar 27, 2018
PR-URL: #19539 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Aug 17, 2018
PR-URL: #19539 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesThis PR seems to be a big refactoring, but it is rather simple and trims the script down almost by half, streamlining the logic significantly.
Investigated status quo in
preprocess.jstools/doc/preprocess.jsseems to either contain artifacts from some very old doc system state or to be designed for a much more complicated doc system than the current one, just in case.preprocess.jshas two aims: strip@//comments in doc sources + replace@includedirectives with outer file content.preprocess.jsis designed to support repeated@includedirectives so it uses caching.preprocess.jsis designed to support nested@includedirectives so it calls its main exported function recursively.preprocess.jsis designed to support docs with various file extensions (.md,.markdown, etc).Investigated status quo in doc building system and doc sources
doc/api/_toc.mdhas@//comments .doc/api/index.mdanddoc/api/all.mdhave@includedirectives. None of these cases has repeated or nested directives, so neither caching nor recursive processing is needed here..mdextension.tools/doc/generate.js,preprocess.jsis also used intools/doc/html.jsandtest/doctool/test-doctool-html.js. Neither of these cases means repeated or nested directives as well.Simplification strategy
.mdfile extension.I've built the docs on Windows (using #19330) before and after these changes and both doc sets are identical +
doctooltests are OK.