You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/08/21 18:38:07 UTC

[40/50] git commit: updated refs/heads/1781-reorganize-and-improve-docs to 360107b

Don't group items in HTTP API reference.

We're cares about every resource.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ddfc1372
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ddfc1372
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ddfc1372

Branch: refs/heads/1781-reorganize-and-improve-docs
Commit: ddfc13720a2b28879908fd15a1bb8d84342a814c
Parents: c67cb93
Author: Alexander Shorin <kx...@apache.org>
Authored: Wed Aug 14 22:06:11 2013 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Wed Aug 21 20:29:40 2013 +0400

----------------------------------------------------------------------
 share/doc/ext/httpdomain.py | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ddfc1372/share/doc/ext/httpdomain.py
----------------------------------------------------------------------
diff --git a/share/doc/ext/httpdomain.py b/share/doc/ext/httpdomain.py
index f2051f4..255e85a 100644
--- a/share/doc/ext/httpdomain.py
+++ b/share/doc/ext/httpdomain.py
@@ -437,21 +437,6 @@ class HTTPIndex(Index):
     localname = 'CouchDB HTTP API Reference'
     shortname = 'api'
 
-    def __init__(self, *args, **kwargs):
-        super(HTTPIndex, self).__init__(*args, **kwargs)
-
-        self.ignore = [
-            [l for l in x.split('/') if l]
-            for x in self.domain.env.config['http_index_ignore_prefixes']]
-        self.ignore.sort(key=lambda x: -len(x))
-
-    def grouping_prefix(self, path):
-        letters = [x for x in path.split('/') if x]
-        for prefix in self.ignore:
-            if letters[:len(prefix)] == prefix:
-                return '/' + '/'.join(letters[:len(prefix) + 1])
-        return '/%s' % (letters[0] if letters else '',)
-
     def generate(self, docnames=None):
         content = {}
         items = ((method, path, info)
@@ -459,7 +444,7 @@ class HTTPIndex(Index):
                  for path, info in routes.items())
         items = sorted(items, key=lambda item: item[1])
         for method, path, info in items:
-            entries = content.setdefault(self.grouping_prefix(path), [])
+            entries = content.setdefault(path, [])
             entries.append([
                 method.upper() + ' ' + path, 0, info[0],
                 http_resource_anchor(method, path), '', '', info[1]
@@ -633,4 +618,3 @@ def setup(app):
         get_lexer_by_name('http')
     except ClassNotFound:
         app.add_lexer('http', HTTPLexer())
-    app.add_config_value('http_index_ignore_prefixes', [], None)