{"action":"created","comment":{"url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/comments/23955773","id":23955773,"diff_hunk":"@@ -572,6 +573,110 @@ class information, if relevant.\n         return title, target\n \n \n+class ChapelModuleIndex(Index):\n+    \"\"\"Provides Chapel module index based on chpl:module.\"\"\"\n+\n+    name = 'modindex'\n+    localname = l_('Chapel Module Index')\n+    shortname = l_('modules')\n+\n+    def generate(self, docnames=None):\n+        \"\"\"Returns entries for index given by ``name``. If ``docnames`` is given,\n+        restrict to entries referring to these docnames.\n+\n+        Retunrs tuple of ``(content, collapse)``. ``collapse`` is bool. When\n+        True, sub-entries should start collapsed for output formats that\n+        support collapsing.\n+\n+        ``content`` is a sequence of ``(letter, entries)`` tuples. ``letter``\n+        is the \"heading\" for the given ``entries``, in this case the starting\n+        letter.\n+\n+        ``entries`` is a sequence of single entries, where a single entry is a\n+        sequence ``[name, subtype, docname, anchor, extra, qualifier,\n+        description]``. These items are:\n+\n+        * ``name`` - name of the index entry to be displayed\n+        * ``subtype`` - sub-entry related type:\n+\n+          * 0 - normal entry\n+          * 1 - entry with sub-entries\n+          * 2 - sub-entry\n+\n+        * ``docname`` - docname where the entry is located\n+        * ``anchor`` - anchor for the entry within docname\n+        * ``extra`` - extra info for the entry\n+        * ``qualifier`` - qualifier for the description\n+        * ``description`` - description for the entry\n+\n+        Qualifier and description are not rendered in some output formats.\n+        \"\"\"\n+        content = {}\n+\n+        # list of prefixes to ignore\n+        ignores = self.domain.env.config['chapeldomain_modindex_common_prefix']\n+        ignores = sorted(ignores, key=len, reverse=True)\n+\n+        # list of all modules, sorted by module name\n+        modules = sorted(iteritems(self.domain.data['modules']),\n+                         key=lambda x: x[0].lower())\n+\n+        # sort out collapsible modules\n+        prev_modname = ''\n+        num_toplevels = 0\n+        for modname, (docname, synopsis, platforms, deprecated) in modules:\n+            # If given a list of docnames and current docname is not in it,\n+            # skip this docname for the index.\n+            if docnames and docname not in docnames:\n+                continue\n+\n+            for ignore in ignores:\n+                if modname.startswith(ignore):\n+                    modname = modname[len(ignore):]\n+                    stripped = ignore\n+                    break\n+            else:\n+                stripped = ''\n+\n+            # we stripped the whole module name?\n+            if not modname:\n+                modname, stripped = stripped, ''","path":"sphinxcontrib/chapeldomain.py","position":93,"original_position":93,"commit_id":"9e48d44fecb69a1372f76f1d7f761ebc0c20b7fa","original_commit_id":"9e48d44fecb69a1372f76f1d7f761ebc0c20b7fa","user":{"login":"lydia-duncan","id":2454710,"avatar_url":"https://avatars.githubusercontent.com/u/2454710?v=3","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false},"body":"Why is modname set to the stripped value, if the stripped value was obtained from matching against ignored names?  Doesn't that mean you're using a modname you were supposed to ignore?","created_at":"2015-02-02T20:32:29Z","updated_at":"2015-02-02T20:32:29Z","html_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain/pull/8#discussion_r23955773","pull_request_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/comments/23955773"},"html":{"href":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain/pull/8#discussion_r23955773"},"pull_request":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8","id":28420252,"html_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain/pull/8","diff_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain/pull/8.diff","patch_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain/pull/8.patch","issue_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues/8","number":8,"state":"open","locked":false,"title":"Add \"Chapel Module Index\" page with all modules listed.","user":{"login":"thomasvandoren","id":530981,"avatar_url":"https://avatars.githubusercontent.com/u/530981?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasvandoren","html_url":"https://github.com/thomasvandoren","followers_url":"https://api.github.com/users/thomasvandoren/followers","following_url":"https://api.github.com/users/thomasvandoren/following{/other_user}","gists_url":"https://api.github.com/users/thomasvandoren/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasvandoren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasvandoren/subscriptions","organizations_url":"https://api.github.com/users/thomasvandoren/orgs","repos_url":"https://api.github.com/users/thomasvandoren/repos","events_url":"https://api.github.com/users/thomasvandoren/events{/privacy}","received_events_url":"https://api.github.com/users/thomasvandoren/received_events","type":"User","site_admin":false},"body":"Add new ChapelModuleIndex that creates a list of all chapel modules\r\nsimilar to the python module index. It sorts them alphabetically and groups\r\nthem by first letter. Submodules are supported and get folded under the original\r\ntop level module.\r\n\r\nTo cross-reference the new Chapel Module Index, support a special role,\r\n`:chpl:chplref:`. It can be used like:\r\n\r\n```rst\r\n* :chpl:chplref:`chplmodindex`\r\n* :chpl:chplref:`See my modules <chplmodindex>`\r\n\r\n.. And it works with the default-domain (or primary_domain) settings.\r\n\r\n.. default-domain:: chpl\r\n\r\nSee the :chplref:`chplmodindex` for details.\r\n```\r\n","created_at":"2015-01-31T20:20:50Z","updated_at":"2015-02-02T20:32:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6262cdda944e0efff4f9746c91355c5e74d40a2a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/comments/{number}","comments_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues/8/comments","statuses_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/statuses/9e48d44fecb69a1372f76f1d7f761ebc0c20b7fa","head":{"label":"thomasvandoren:chpl-index","ref":"chpl-index","sha":"9e48d44fecb69a1372f76f1d7f761ebc0c20b7fa","user":{"login":"thomasvandoren","id":530981,"avatar_url":"https://avatars.githubusercontent.com/u/530981?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasvandoren","html_url":"https://github.com/thomasvandoren","followers_url":"https://api.github.com/users/thomasvandoren/followers","following_url":"https://api.github.com/users/thomasvandoren/following{/other_user}","gists_url":"https://api.github.com/users/thomasvandoren/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasvandoren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasvandoren/subscriptions","organizations_url":"https://api.github.com/users/thomasvandoren/orgs","repos_url":"https://api.github.com/users/thomasvandoren/repos","events_url":"https://api.github.com/users/thomasvandoren/events{/privacy}","received_events_url":"https://api.github.com/users/thomasvandoren/received_events","type":"User","site_admin":false},"repo":{"id":29890750,"name":"sphinxcontrib-chapeldomain","full_name":"thomasvandoren/sphinxcontrib-chapeldomain","owner":{"login":"thomasvandoren","id":530981,"avatar_url":"https://avatars.githubusercontent.com/u/530981?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasvandoren","html_url":"https://github.com/thomasvandoren","followers_url":"https://api.github.com/users/thomasvandoren/followers","following_url":"https://api.github.com/users/thomasvandoren/following{/other_user}","gists_url":"https://api.github.com/users/thomasvandoren/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasvandoren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasvandoren/subscriptions","organizations_url":"https://api.github.com/users/thomasvandoren/orgs","repos_url":"https://api.github.com/users/thomasvandoren/repos","events_url":"https://api.github.com/users/thomasvandoren/events{/privacy}","received_events_url":"https://api.github.com/users/thomasvandoren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thomasvandoren/sphinxcontrib-chapeldomain","description":"Chapel domain for Sphinx.","fork":true,"url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain","forks_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/forks","keys_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/teams","hooks_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/hooks","issue_events_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/issues/events{/number}","events_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/events","assignees_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/assignees{/user}","branches_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/branches{/branch}","tags_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/tags","blobs_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/git/refs{/sha}","trees_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/statuses/{sha}","languages_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/languages","stargazers_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/stargazers","contributors_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/contributors","subscribers_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/subscribers","subscription_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/subscription","commits_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/commits{/sha}","git_commits_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/git/commits{/sha}","comments_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/comments{/number}","issue_comment_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/issues/comments/{number}","contents_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/contents/{+path}","compare_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/merges","archive_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/downloads","issues_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/issues{/number}","pulls_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/pulls{/number}","milestones_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/milestones{/number}","notifications_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/labels{/name}","releases_url":"https://api.github.com/repos/thomasvandoren/sphinxcontrib-chapeldomain/releases{/id}","created_at":"2015-01-27T01:10:39Z","updated_at":"2015-01-28T18:12:35Z","pushed_at":"2015-01-31T22:48:54Z","git_url":"git://github.com/thomasvandoren/sphinxcontrib-chapeldomain.git","ssh_url":"git@github.com:thomasvandoren/sphinxcontrib-chapeldomain.git","clone_url":"https://github.com/thomasvandoren/sphinxcontrib-chapeldomain.git","svn_url":"https://github.com/thomasvandoren/sphinxcontrib-chapeldomain","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chapel-lang:master","ref":"master","sha":"89b38880abc6089e33140f086cd989215c40407f","user":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":29890321,"name":"sphinxcontrib-chapeldomain","full_name":"chapel-lang/sphinxcontrib-chapeldomain","owner":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain","description":"Chapel domain for Sphinx.","fork":false,"url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain","forks_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/forks","keys_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/teams","hooks_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/events","assignees_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/tags","blobs_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/subscription","commits_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues/comments/{number}","contents_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/merges","archive_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/downloads","issues_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/releases{/id}","created_at":"2015-01-27T00:57:13Z","updated_at":"2015-01-29T23:26:19Z","pushed_at":"2015-01-29T23:26:19Z","git_url":"git://github.com/chapel-lang/sphinxcontrib-chapeldomain.git","ssh_url":"git@github.com:chapel-lang/sphinxcontrib-chapeldomain.git","clone_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain.git","svn_url":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8"},"html":{"href":"https://github.com/chapel-lang/sphinxcontrib-chapeldomain/pull/8"},"issue":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues/8"},"comments":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/sphinxcontrib-chapeldomain/statuses/9e48d44fecb69a1372f76f1d7f761ebc0c20b7fa"}}}}