{"action":"created","comment":{"url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/comments/31871450","id":31871450,"diff_hunk":"@@ -0,0 +1,201 @@\n+import os\n+import json\n+import subprocess\n+\n+from sphinx.util.osutil import ensuredir\n+\n+from .base import AutoAPIBase, AutoAPIDomain\n+from ..settings import env\n+\n+\n+class JavaScriptDomain(AutoAPIDomain):\n+\n+    '''Auto API domain handler for Javascript\n+\n+    Parses directly from Javascript files.\n+\n+    :param app: Sphinx application passed in as part of the extension\n+    '''\n+\n+    def create_class(self, data):\n+        '''Return instance of class based on Javascript data\n+\n+        Data keys handled here:\n+\n+            type\n+                Set the object class\n+\n+            consts, types, vars, funcs\n+                Recurse into :py:meth:`create_class` to create child object\n+                instances\n+\n+        :param data: dictionary data from godocjson output\n+        '''\n+        obj_map = dict(\n+            (cls.type, cls) for cls\n+            in ALL_CLASSES\n+        )\n+        try:\n+            cls = obj_map[data['kind']]\n+        except KeyError:\n+            self.app.warn('Unknown Type: %s' % data)\n+        else:\n+            # Recurse for children\n+            obj = cls(data)\n+            if 'children' in data:\n+                for child_data in data['children']:\n+                    for child_obj in self.create_class(child_data):\n+                        obj.children.append(child_obj)\n+            yield obj\n+\n+    def read_file(self, path, **kwargs):\n+        '''Read file input into memory, returning deserialized objects\n+\n+        :param path: Path of file to read\n+        '''\n+        # TODO support JSON here\n+        # TODO sphinx way of reporting errors in logs?\n+\n+        try:\n+            parsed_data = json.loads(subprocess.check_output(['jsdoc', '-X', path]))\n+            return parsed_data\n+        except IOError:","path":"autoapi/domains/javascript.py","position":62,"original_position":62,"commit_id":"bd92f55fc7d7a015a94da4f45ef01c56b618452c","original_commit_id":"bd92f55fc7d7a015a94da4f45ef01c56b618452c","user":{"login":"agjohnson","id":1140183,"avatar_url":"https://avatars.githubusercontent.com/u/1140183?v=3","gravatar_id":"","url":"https://api.github.com/users/agjohnson","html_url":"https://github.com/agjohnson","followers_url":"https://api.github.com/users/agjohnson/followers","following_url":"https://api.github.com/users/agjohnson/following{/other_user}","gists_url":"https://api.github.com/users/agjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/agjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agjohnson/subscriptions","organizations_url":"https://api.github.com/users/agjohnson/orgs","repos_url":"https://api.github.com/users/agjohnson/repos","events_url":"https://api.github.com/users/agjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/agjohnson/received_events","type":"User","site_admin":false},"body":"Catch `OSError` or something from `subprocess` here, if `jsdoc` is not installed or in the PATH","created_at":"2015-06-06T20:53:32Z","updated_at":"2015-06-06T20:53:32Z","html_url":"https://github.com/rtfd/sphinx-autoapi/pull/6#discussion_r31871450","pull_request_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/comments/31871450"},"html":{"href":"https://github.com/rtfd/sphinx-autoapi/pull/6#discussion_r31871450"},"pull_request":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6","id":37095937,"html_url":"https://github.com/rtfd/sphinx-autoapi/pull/6","diff_url":"https://github.com/rtfd/sphinx-autoapi/pull/6.diff","patch_url":"https://github.com/rtfd/sphinx-autoapi/pull/6.patch","issue_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/6","number":6,"state":"open","locked":false,"title":"Add initial javascript support with jsdoc 3.","user":{"login":"ericholscher","id":25510,"avatar_url":"https://avatars.githubusercontent.com/u/25510?v=3","gravatar_id":"","url":"https://api.github.com/users/ericholscher","html_url":"https://github.com/ericholscher","followers_url":"https://api.github.com/users/ericholscher/followers","following_url":"https://api.github.com/users/ericholscher/following{/other_user}","gists_url":"https://api.github.com/users/ericholscher/gists{/gist_id}","starred_url":"https://api.github.com/users/ericholscher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericholscher/subscriptions","organizations_url":"https://api.github.com/users/ericholscher/orgs","repos_url":"https://api.github.com/users/ericholscher/repos","events_url":"https://api.github.com/users/ericholscher/events{/privacy}","received_events_url":"https://api.github.com/users/ericholscher/received_events","type":"User","site_admin":false},"body":"This is a very first pass at adding jsdoc support. ","created_at":"2015-06-06T20:09:20Z","updated_at":"2015-06-06T20:53:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60516f5571a84dc54600f3b9b177e2a29f01c505","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6/commits","review_comments_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6/comments","review_comment_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/6/comments","statuses_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/statuses/bd92f55fc7d7a015a94da4f45ef01c56b618452c","head":{"label":"rtfd:jsdoc","ref":"jsdoc","sha":"bd92f55fc7d7a015a94da4f45ef01c56b618452c","user":{"login":"rtfd","id":366329,"avatar_url":"https://avatars.githubusercontent.com/u/366329?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfd","html_url":"https://github.com/rtfd","followers_url":"https://api.github.com/users/rtfd/followers","following_url":"https://api.github.com/users/rtfd/following{/other_user}","gists_url":"https://api.github.com/users/rtfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfd/subscriptions","organizations_url":"https://api.github.com/users/rtfd/orgs","repos_url":"https://api.github.com/users/rtfd/repos","events_url":"https://api.github.com/users/rtfd/events{/privacy}","received_events_url":"https://api.github.com/users/rtfd/received_events","type":"Organization","site_admin":false},"repo":{"id":36524868,"name":"sphinx-autoapi","full_name":"rtfd/sphinx-autoapi","owner":{"login":"rtfd","id":366329,"avatar_url":"https://avatars.githubusercontent.com/u/366329?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfd","html_url":"https://github.com/rtfd","followers_url":"https://api.github.com/users/rtfd/followers","following_url":"https://api.github.com/users/rtfd/following{/other_user}","gists_url":"https://api.github.com/users/rtfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfd/subscriptions","organizations_url":"https://api.github.com/users/rtfd/orgs","repos_url":"https://api.github.com/users/rtfd/repos","events_url":"https://api.github.com/users/rtfd/events{/privacy}","received_events_url":"https://api.github.com/users/rtfd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rtfd/sphinx-autoapi","description":"A new approach to API documentation in Sphinx.","fork":false,"url":"https://api.github.com/repos/rtfd/sphinx-autoapi","forks_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/forks","keys_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/teams","hooks_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/hooks","issue_events_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/events{/number}","events_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/events","assignees_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/assignees{/user}","branches_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/branches{/branch}","tags_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/tags","blobs_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/statuses/{sha}","languages_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/languages","stargazers_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/stargazers","contributors_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/contributors","subscribers_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/subscribers","subscription_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/subscription","commits_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/contents/{+path}","compare_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/merges","archive_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/downloads","issues_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues{/number}","pulls_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls{/number}","milestones_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/milestones{/number}","notifications_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/labels{/name}","releases_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/releases{/id}","created_at":"2015-05-29T19:32:28Z","updated_at":"2015-06-04T18:19:34Z","pushed_at":"2015-06-06T20:20:20Z","git_url":"git://github.com/rtfd/sphinx-autoapi.git","ssh_url":"git@github.com:rtfd/sphinx-autoapi.git","clone_url":"https://github.com/rtfd/sphinx-autoapi.git","svn_url":"https://github.com/rtfd/sphinx-autoapi","homepage":"http://sphinx-autoapi.readthedocs.org/","size":976,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"rtfd:master","ref":"master","sha":"b0c4a8870cc1e41a23bc3bdc0d13b6d05b38f28d","user":{"login":"rtfd","id":366329,"avatar_url":"https://avatars.githubusercontent.com/u/366329?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfd","html_url":"https://github.com/rtfd","followers_url":"https://api.github.com/users/rtfd/followers","following_url":"https://api.github.com/users/rtfd/following{/other_user}","gists_url":"https://api.github.com/users/rtfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfd/subscriptions","organizations_url":"https://api.github.com/users/rtfd/orgs","repos_url":"https://api.github.com/users/rtfd/repos","events_url":"https://api.github.com/users/rtfd/events{/privacy}","received_events_url":"https://api.github.com/users/rtfd/received_events","type":"Organization","site_admin":false},"repo":{"id":36524868,"name":"sphinx-autoapi","full_name":"rtfd/sphinx-autoapi","owner":{"login":"rtfd","id":366329,"avatar_url":"https://avatars.githubusercontent.com/u/366329?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfd","html_url":"https://github.com/rtfd","followers_url":"https://api.github.com/users/rtfd/followers","following_url":"https://api.github.com/users/rtfd/following{/other_user}","gists_url":"https://api.github.com/users/rtfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfd/subscriptions","organizations_url":"https://api.github.com/users/rtfd/orgs","repos_url":"https://api.github.com/users/rtfd/repos","events_url":"https://api.github.com/users/rtfd/events{/privacy}","received_events_url":"https://api.github.com/users/rtfd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rtfd/sphinx-autoapi","description":"A new approach to API documentation in Sphinx.","fork":false,"url":"https://api.github.com/repos/rtfd/sphinx-autoapi","forks_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/forks","keys_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/teams","hooks_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/hooks","issue_events_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/events{/number}","events_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/events","assignees_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/assignees{/user}","branches_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/branches{/branch}","tags_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/tags","blobs_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/statuses/{sha}","languages_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/languages","stargazers_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/stargazers","contributors_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/contributors","subscribers_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/subscribers","subscription_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/subscription","commits_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/contents/{+path}","compare_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/merges","archive_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/downloads","issues_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues{/number}","pulls_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls{/number}","milestones_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/milestones{/number}","notifications_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/labels{/name}","releases_url":"https://api.github.com/repos/rtfd/sphinx-autoapi/releases{/id}","created_at":"2015-05-29T19:32:28Z","updated_at":"2015-06-04T18:19:34Z","pushed_at":"2015-06-06T20:20:20Z","git_url":"git://github.com/rtfd/sphinx-autoapi.git","ssh_url":"git@github.com:rtfd/sphinx-autoapi.git","clone_url":"https://github.com/rtfd/sphinx-autoapi.git","svn_url":"https://github.com/rtfd/sphinx-autoapi","homepage":"http://sphinx-autoapi.readthedocs.org/","size":976,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6"},"html":{"href":"https://github.com/rtfd/sphinx-autoapi/pull/6"},"issue":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/6"},"comments":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/rtfd/sphinx-autoapi/statuses/bd92f55fc7d7a015a94da4f45ef01c56b618452c"}}}}