-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
[WIP] doc: build manpages for each module #14164
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
Conversation
Makefile
Outdated
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.
I copied this from the HTML build logic, but it's now duplicated three times. Should we refactor this? I think yes, but my Make-fu is not very good...
Makefile
Outdated
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.
Do we actually need npm install
since node_modules
is vendored?
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.
would definitely prefer not having npm install
here.
tools/doc/man.js
Outdated
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.
Is this correct, given that I wrote this file from scratch?
|
tools/doc/generate.js
Outdated
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.
Shouldn't this be before the console.log()
?
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.
@mscdex lol, you'd think :D
I was looking at case 'json':
when I wrote that, trying to mirror surrounding code style; perhaps that one's wrong too?
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.
Probably.
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.
I'll push a fix tomorrow then
tools/doc/man.js
Outdated
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.
Why are domain
, process
, punycode
, and v8
included here? They are all require()
-able.
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.
@mscdex a lot of these are here because they had some structural issue that the build tool couldn't handle - stability information in an unexpected place, etc. I'm planning to go back and fix a lot of these (see the "open issues" list in the description)
tools/doc/man.js
Outdated
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.
Note that with this change we now have two Markdown engines in use. This is unideal obviously, but truthfully I don't think it's a huge issue. I also think it probably makes sense to convert other uses of marked
to Remark anyway, since the latter has much better tooling. But we can do that later.
tools/doc/man.js
Outdated
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.
I should make this line not so long but it's 1 AM and I want to go to bed. Tomorrow!
tools/doc/man.js
Outdated
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.
I actually like this style better (and functionally it doesn't super matter since we just throw either way) but it seems like this should probably just pass an Error to next()
... if people disagree with that assessment though I'd prefer to keep it this way. It's more concise and obvious what's happening.
tools/doc/man.js
Outdated
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 way of building nodes is kinda fugly but I'm not sure there's a better way. https://github.com/eush77/unist-builder perhaps?
tools/doc/man.js
Outdated
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 is really hacky and leaves around empty files. Not good.
@mscdex re: const buffer = require('buffer'); isn't nearly as helpful as Buffer.from('string');
Buffer.alloc();
// etc. |
@strugee I disagree about |
/cc @nodejs/documentation |
Since this is a "WIP to solicit feedback" let's talk about webpackeing the new tooling? I see 379 new files, while only 3 are outside of
|
I'm quite worried about how difficult this may be to keep up-to-date? Perhaps we should start generating docs like libuv does, it generated both webpages and man pages, although the quality of both is a bit less... idk probably not a great solution unless we generate roff syntax from markdown. |
This is definitely an interesting idea that is worth exploring, but I do share @Fishrock123's concerns about maintainability. As is, updating the docs and keeping them up to date is a bit of a hassle. |
@mscdex okay! I don't feel strongly about it. You'd certainly know better than I ;)
@refack can you clarify what you mean by this? Why would we use Webpack? Even the atomicity problem isn't all that big (at least, AFAICT) since we vendor @Fishrock123 are you thinking about this code becoming out-of-sync with the documentation's structure? That's definitely a legit concern which you guys will be able to answer better than I :) I did, however, try to make sure that if something goes wrong, there's at least a good blowup. That's why all the assertions are in there.
That's what this patch does, unless I'm misunderstanding you? |
Just throwing ideas... Having a single file for something that we want to treat as a black box has some benefits:
|
@Fishrock123 @jasnell so should I keep going with this? Don't want to spend any more time on it if it won't be merged due to maintainability concerns :) I'm also pretty confused by:
Unless I'm misunderstanding something this is what this PR already does? The existing Markdown documents are transformed into roff syntax automatically. |
@Fishrock123 @jasnell ping? |
@strugee ... my apologies, I lost track of this. Personally, I love this idea, I'm just concerned about the maintenance. The PR itself is also a bit difficult to review with the added tools dependencies. So I would say, let's definitely proceed, but can I ask you to split the commits into multiple? One that contains the various new dependencies, and one that contains the new code added? Then I'll take another look. I really appreciate you working on this! |
Ping @strugee |
2d70a77
to
5417c7c
Compare
5417c7c
to
613b62c
Compare
Hey, sorry! Thanks for the ping. I split up the commit and am hoping to do some polishing on this during the weekend 👍 |
/cc @jasnell |
Looking good so far. |
Ping @strugee |
Just an update, this is still on my radar but I was on break this past weekend and had a bunch of midterm papers due the week before so I'm pretty behind on all my technical work :P Hopefully will have time soon... not sure when though 👍 |
@strugee ... sounds good. We'll keep this open |
Ping @strugee |
@BridgeAR hey, so sorry to leave this hanging open. I'm on break starting Friday; getting this to the finish line will be my first priority then 👍 |
At this point I think it's time to just admit I won't have time/motivation to finish this and close this PR. Sorry to keep it hanging open for so long, I feel pretty silly :( If anyone wants to pick this up again I'd be happy to answer questions about the codebase. |
Build manpages alongside JSON and HTML documentation. WIP to solicit feedback - does this direction make sense? Does anyone have opinions already on how this looks?
Fixes #8903
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc
Open issues
domain
,punycode
off thedontBuild
list)dontBuild
list)node_modules
change into a separate commit? The diff is kinda unreadable otherwisenode-debugger(3)
,node-buffer(3)
,node-n-api(3)
,node-console(3)
,node-modules(3)
,node-process(3)
,node-timers(3)
don't make much sense since they're notrequire()
able modulesdontBuild
list to what it actually should be (for examplenode-errors(3)
really should be built, but crashes right now)node-events(3)
SYNOPSIS (and maybe other similar pages?)require()
the modulenode(1)
point to things likenode-debugger(3)
when it makes sensenode(1)
node-roadmap(1)
and/ornode-all(3)
, à la zsh?node-debugger(1)
instead ofnode-debugger(3)
?BSDMakefile
also need to be updated?http.3
instead ofnode-http.3
)