-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
docs: incorrect man page link in html modules doc #5686
Comments
Hi, I am new in the open source world and would like to help with this. I think it is easy and it would be my second experience contributing to an open source project. Can I do this? |
@jvcjunior Sure, It's some regex parsing. The code can be found at https://github.com/nodejs/node/blob/master/tools/doc/html.js#L183-L198 It's possible that we should instead put some extra formatting around what should be man links, something like cc @nodejs/documentation for advice |
We could either add some extra formatting (which would require changing all man links in all the docs, not sure how many there are), or change the doc markdown-to-html tool so that linkManPages is not called within code blocks (by tracking tok.type, sort of like parseLists does). That wouldn't solve the problem in a definitive fashion of course, it just changes less files, and the two can be done in parallel, even. It mostly depends on how many man links there are lying around. If there ain't that many, I'd say go for changing the format, and change the regex in the tool and the links in the markdown (you'll need to rebase the PR periodically). |
Just out of curiosity, how do I convert the |
@mithun-daa See https://github.com/nodejs/node/blob/master/Makefile#L238-L249 for the source, or if on windows |
Another way to solve it would be not to convert to links ( function parseText(lexed) {
lexed.forEach(function(tok) {
if (tok.text && tok.type !== 'code') {
tok.text = linkManPages(tok.text);
}
});
} |
(Removing label so that @jvcjunior can tackle this) @mithun-daa Hmm, what if it were in a code comment? |
@Fishrock123 Can code blocks have man page links? If I am not mistaken you cannot have any other markdown formatting inside a code block. I tried doing the same on some online markdown editors and it does not work. |
I wasn't sure, but fair enough. :) |
@jvcjunior This should be a straight enough fix. Let me know if you can do it. If not I'll send in a PR. |
@mithun-daa Don't worry about me. You can do this. No problem at all. ;) |
Do not call the linkManPages if the tok type is code
Sent PR |
Do not call the linkManPages if the tok type is code Fixes: #5686 PR-URL: #5721 Reviewed-By: James M Snell <[email protected]>
Do not call the linkManPages if the tok type is code Fixes: #5686 PR-URL: #5721 Reviewed-By: James M Snell <[email protected]>
Do not call the linkManPages if the tok type is code Fixes: #5686 PR-URL: #5721 Reviewed-By: James M Snell <[email protected]>
Do not call the linkManPages if the tok type is code Fixes: #5686 PR-URL: #5721 Reviewed-By: James M Snell <[email protected]>
In https://nodejs.org/dist/latest-v5.x/docs/api/modules.html#modules_modules
The following line appears:
var mySquare = square(2);
Which should just be:
var mySquare = square(2);
Looks like the thing that generates links to man pages automatically is a little overzealous.
The text was updated successfully, but these errors were encountered: