Skip to content

docs: incorrect man page link in html modules doc #5686

Description

@sbc100

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.

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    moduleIssues and PRs related to the module subsystem.
    on Mar 13, 2016
  2. jvcjunior commented on Mar 14, 2016

    @jvcjunior

    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?

  3. Fishrock123 commented on Mar 14, 2016

    @Fishrock123
    Contributor

    @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 [man(2)]() maybe?

    cc @nodejs/documentation for advice

  4. added
    toolsIssues and PRs related to the tools directory.
    and removed
    moduleIssues and PRs related to the module subsystem.
    on Mar 14, 2016
  5. claudiorodriguez commented on Mar 14, 2016

    @claudiorodriguez
    Contributor

    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).

  6. mithun-daa commented on Mar 14, 2016

    @mithun-daa
    Contributor

    Just out of curiosity, how do I convert the mardown files to html locally?

  7. Fishrock123 commented on Mar 14, 2016

    @Fishrock123
    Contributor

    @mithun-daa make doc (assuming you are on Unix and have make)

    See https://github.com/nodejs/node/blob/master/Makefile#L238-L249 for the source, or if on windows

  8. mithun-daa commented on Mar 14, 2016

    @mithun-daa
    Contributor

    Another way to solve it would be not to convert to links (linkManPages) when the tok.type === code.

    function parseText(lexed) {
      lexed.forEach(function(tok) {
        if (tok.text && tok.type !== 'code') {
          tok.text = linkManPages(tok.text);
        }
      });
    }
  9. Fishrock123 commented on Mar 15, 2016

    @Fishrock123
    Contributor

    (Removing label so that @jvcjunior can tackle this)

    @mithun-daa Hmm, what if it were in a code comment?

  10. mithun-daa commented on Mar 15, 2016

    @mithun-daa
    Contributor

    @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.

  11. Fishrock123 commented on Mar 15, 2016

    @Fishrock123
    Contributor

    I wasn't sure, but fair enough. :)

  12. mithun-daa commented on Mar 15, 2016

    @mithun-daa
    Contributor

    @jvcjunior This should be a straight enough fix. Let me know if you can do it. If not I'll send in a PR.

  13. jvcjunior commented on Mar 15, 2016

    @jvcjunior

    @mithun-daa Don't worry about me. You can do this. No problem at all. ;)

  14. mithun-daa commented on Mar 15, 2016

    @mithun-daa
    Contributor

    Sent PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.toolsIssues and PRs related to the tools directory.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions