Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
doc, tools: refactor html generation #6974
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9d4d22856ac6afeccdbfcfe25e1ad229052db0630722ce257f760f8805c0e6c109a3d7b222a7e6597882285d9660d9d4a62816104c58bfb1206a84aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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) |
| 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`; | ||
Member 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? ContributorAuthor 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: | ||
Uh oh!
There was an error while loading. Please reload this page.
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