-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
doc, tools: refactor html generation #6974
Closed
eljefedelrodeodeljefe
wants to merge
17
commits into
nodejs:master
from
eljefedelrodeodeljefe:doc/guides
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9d4d228
doc, tools: extract linkManPages
eljefedelrodeodeljefe 56ac6af
doc: extract parseText
eljefedelrodeodeljefe eccdbfc
doc, tools: extract toHTML
eljefedelrodeodeljefe fe25e1a
doc, tools: extract loadGtoc
eljefedelrodeodeljefe d229052
doc, tools: extract toID
eljefedelrodeodeljefe db06307
doc, tools: extract render
eljefedelrodeodeljefe 22ce257
doc, tools: extract parseLists
eljefedelrodeodeljefe f760f88
doc, tool: extract parseYAML
eljefedelrodeodeljefe 05c0e6c
doc, tools: extract linkJsTypeDocs
eljefedelrodeodeljefe 109a3d7
doc, tools: extract parseAPIHeader
eljefedelrodeodeljefe b222a7e
doc, tool: extract getSection
eljefedelrodeodeljefe 6597882
doc, tools: extrat buildToc
eljefedelrodeodeljefe 285d966
doc, tools: extract getId
eljefedelrodeodeljefe 0d9d4a6
doc, tools: meet dependencies
eljefedelrodeodeljefe 2816104
doc, tools: refactor tools -> satisfy eslint
eljefedelrodeodeljefe c58bfb1
doc, tools: have fs.writeFile gen html
eljefedelrodeodeljefe 206a84a
doc, tools: rebase from #6943
eljefedelrodeodeljefe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* [About these Docs](documentation.html) | ||
* [Usage & Example](synopsis.html) | ||
|
||
<div class="line"></div> | ||
|
||
* [Building Node With Ninja](building-node-with-ninja.html) | ||
|
||
<div class="line"></div> | ||
|
||
* [GitHub Repo & Issue Tracker](https://github.com/nodejs/node) | ||
* [Mailing List](http://groups.google.com/group/nodejs) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
const processIncludes = require('./preprocess.js'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const toHTML = require('./html.js').toHTML; | ||
|
||
// parse the args. | ||
// Don't use nopt or whatever for this. It's simple enough. | ||
|
@@ -48,11 +50,15 @@ function next(er, input) { | |
break; | ||
|
||
case 'html': | ||
require('./html.js')(input, inputFile, template, nodeVersion, | ||
function(er, html) { | ||
if (er) throw er; | ||
console.log(html); | ||
toHTML(input, inputFile, template, nodeVersion, (er, html) => { | ||
if (er) throw er; | ||
const filename = `./out/doc/api/${path.basename(inputFile, 'md')}html`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not a 100 % sure I like having the output paths hardcoded here:
So… what are the advantages of doing it this way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
fs.writeFile(filename, html, (err) => { | ||
if (err) | ||
console.log(err); | ||
console.log('generated:', filename); | ||
}); | ||
}); | ||
break; | ||
|
||
default: | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should best come with a comment stating the names of the additional globals