{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/51944811","id":51944811,"diff_hunk":"@@ -165,10 +175,32 @@ function parseLists(input) {\n }\n \n \n+// Syscalls which appear in the docs, but which only exist in BSD / OSX\n+var BSD_ONLY_SYSCALLS = ['lchmod'];\n+\n+// Handle references to man pages, eg \"open(2)\" or \"lchmod(2)\"\n+// Returns modified text, with such refs replace with HTML links, for example\n+// '<a href=\"http://man7.org/linux/man-pages/man2/open.2.html\">open(2)</a>'\n+function linkManPages(text) {\n+  return text.replace(/ ([a-z]+)\\((\\d)\\)/gm, function(match, name, number) {\n+    // name consists of lowercase letters, number is a single digit\n+    var displayAs = name + '(' + number + ')';\n+    if (BSD_ONLY_SYSCALLS.indexOf(name) > -1) {\n+      return ' <a href=\"http://www.freebsd.org/cgi/man.cgi?query=' + name +\n+        '&sektion=' + number + '\">' + displayAs + '</a>';\n+    } else {\n+      return ' <a href=\"http://man7.org/linux/man-pages/man' + number + '/' +\n+        name + '.' + number + '.html\">' + displayAs + '</a>';","path":"tools/doc/html.js","position":43,"original_position":43,"commit_id":"445a1e44d1d470d6b89e2d63a9d36fbdf92f7ec3","original_commit_id":"445a1e44d1d470d6b89e2d63a9d36fbdf92f7ec3","user":{"login":"dcposch","id":169280,"avatar_url":"https://avatars.githubusercontent.com/u/169280?v=3","gravatar_id":"","url":"https://api.github.com/users/dcposch","html_url":"https://github.com/dcposch","followers_url":"https://api.github.com/users/dcposch/followers","following_url":"https://api.github.com/users/dcposch/following{/other_user}","gists_url":"https://api.github.com/users/dcposch/gists{/gist_id}","starred_url":"https://api.github.com/users/dcposch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcposch/subscriptions","organizations_url":"https://api.github.com/users/dcposch/orgs","repos_url":"https://api.github.com/users/dcposch/repos","events_url":"https://api.github.com/users/dcposch/events{/privacy}","received_events_url":"https://api.github.com/users/dcposch/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-02-04T22:00:28Z","updated_at":"2016-02-04T22:00:28Z","html_url":"https://github.com/nodejs/node/pull/5073#discussion_r51944811","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/5073","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/51944811"},"html":{"href":"https://github.com/nodejs/node/pull/5073#discussion_r51944811"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/5073"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/5073","id":58278290,"html_url":"https://github.com/nodejs/node/pull/5073","diff_url":"https://github.com/nodejs/node/pull/5073.diff","patch_url":"https://github.com/nodejs/node/pull/5073.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/5073","number":5073,"state":"open","locked":false,"title":"doc: link to man pages","user":{"login":"dcposch","id":169280,"avatar_url":"https://avatars.githubusercontent.com/u/169280?v=3","gravatar_id":"","url":"https://api.github.com/users/dcposch","html_url":"https://github.com/dcposch","followers_url":"https://api.github.com/users/dcposch/followers","following_url":"https://api.github.com/users/dcposch/following{/other_user}","gists_url":"https://api.github.com/users/dcposch/gists{/gist_id}","starred_url":"https://api.github.com/users/dcposch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcposch/subscriptions","organizations_url":"https://api.github.com/users/dcposch/orgs","repos_url":"https://api.github.com/users/dcposch/repos","events_url":"https://api.github.com/users/dcposch/events{/privacy}","received_events_url":"https://api.github.com/users/dcposch/received_events","type":"User","site_admin":false},"body":"This changes the doc generator to automatically link references such as\r\n`open(2)` to a man page on man7.org or freebsd.org\r\n\r\nFixes #4375","created_at":"2016-02-04T12:14:20Z","updated_at":"2016-02-04T22:00:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e54103bf1d2d4a629f4d34e321227e2d36e789c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/5073/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/5073/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/5073/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/445a1e44d1d470d6b89e2d63a9d36fbdf92f7ec3","head":{"label":"dcposch:manpages","ref":"manpages","sha":"445a1e44d1d470d6b89e2d63a9d36fbdf92f7ec3","user":{"login":"dcposch","id":169280,"avatar_url":"https://avatars.githubusercontent.com/u/169280?v=3","gravatar_id":"","url":"https://api.github.com/users/dcposch","html_url":"https://github.com/dcposch","followers_url":"https://api.github.com/users/dcposch/followers","following_url":"https://api.github.com/users/dcposch/following{/other_user}","gists_url":"https://api.github.com/users/dcposch/gists{/gist_id}","starred_url":"https://api.github.com/users/dcposch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcposch/subscriptions","organizations_url":"https://api.github.com/users/dcposch/orgs","repos_url":"https://api.github.com/users/dcposch/repos","events_url":"https://api.github.com/users/dcposch/events{/privacy}","received_events_url":"https://api.github.com/users/dcposch/received_events","type":"User","site_admin":false},"repo":{"id":50025992,"name":"node","full_name":"dcposch/node","owner":{"login":"dcposch","id":169280,"avatar_url":"https://avatars.githubusercontent.com/u/169280?v=3","gravatar_id":"","url":"https://api.github.com/users/dcposch","html_url":"https://github.com/dcposch","followers_url":"https://api.github.com/users/dcposch/followers","following_url":"https://api.github.com/users/dcposch/following{/other_user}","gists_url":"https://api.github.com/users/dcposch/gists{/gist_id}","starred_url":"https://api.github.com/users/dcposch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcposch/subscriptions","organizations_url":"https://api.github.com/users/dcposch/orgs","repos_url":"https://api.github.com/users/dcposch/repos","events_url":"https://api.github.com/users/dcposch/events{/privacy}","received_events_url":"https://api.github.com/users/dcposch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcposch/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/dcposch/node","forks_url":"https://api.github.com/repos/dcposch/node/forks","keys_url":"https://api.github.com/repos/dcposch/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcposch/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcposch/node/teams","hooks_url":"https://api.github.com/repos/dcposch/node/hooks","issue_events_url":"https://api.github.com/repos/dcposch/node/issues/events{/number}","events_url":"https://api.github.com/repos/dcposch/node/events","assignees_url":"https://api.github.com/repos/dcposch/node/assignees{/user}","branches_url":"https://api.github.com/repos/dcposch/node/branches{/branch}","tags_url":"https://api.github.com/repos/dcposch/node/tags","blobs_url":"https://api.github.com/repos/dcposch/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcposch/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcposch/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcposch/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcposch/node/statuses/{sha}","languages_url":"https://api.github.com/repos/dcposch/node/languages","stargazers_url":"https://api.github.com/repos/dcposch/node/stargazers","contributors_url":"https://api.github.com/repos/dcposch/node/contributors","subscribers_url":"https://api.github.com/repos/dcposch/node/subscribers","subscription_url":"https://api.github.com/repos/dcposch/node/subscription","commits_url":"https://api.github.com/repos/dcposch/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcposch/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcposch/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcposch/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcposch/node/contents/{+path}","compare_url":"https://api.github.com/repos/dcposch/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcposch/node/merges","archive_url":"https://api.github.com/repos/dcposch/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcposch/node/downloads","issues_url":"https://api.github.com/repos/dcposch/node/issues{/number}","pulls_url":"https://api.github.com/repos/dcposch/node/pulls{/number}","milestones_url":"https://api.github.com/repos/dcposch/node/milestones{/number}","notifications_url":"https://api.github.com/repos/dcposch/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcposch/node/labels{/name}","releases_url":"https://api.github.com/repos/dcposch/node/releases{/id}","deployments_url":"https://api.github.com/repos/dcposch/node/deployments","created_at":"2016-01-20T11:35:10Z","updated_at":"2016-01-20T11:35:19Z","pushed_at":"2016-02-04T13:05:59Z","git_url":"git://github.com/dcposch/node.git","ssh_url":"git@github.com:dcposch/node.git","clone_url":"https://github.com/dcposch/node.git","svn_url":"https://github.com/dcposch/node","homepage":"https://nodejs.org","size":174149,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"c41c09375b217d9daec614edb590147b14ff9b21","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2016-02-04T21:41:04Z","pushed_at":"2016-02-04T21:37:07Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":207214,"stargazers_count":19959,"watchers_count":19959,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2467,"mirror_url":null,"open_issues_count":708,"forks":2467,"open_issues":708,"watchers":19959,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/5073"},"html":{"href":"https://github.com/nodejs/node/pull/5073"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/5073"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/5073/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/5073/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/5073/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/445a1e44d1d470d6b89e2d63a9d36fbdf92f7ec3"}}}}