Organize documentation arrangement
authorHarmon <Harmon758@gmail.com>
Fri, 25 Feb 2022 16:05:16 +0000 (10:05 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 25 Feb 2022 16:05:16 +0000 (10:05 -0600)
Improve index / table of contents categorization

12 files changed:
docs/api.rst
docs/asyncstream.rst
docs/client.rst
docs/index.rst
docs/models.rst [deleted file]
docs/pagination.rst [deleted file]
docs/stream.rst
docs/streamingclient.rst
docs/v1_models.rst [new file with mode: 0644]
docs/v1_pagination.rst [new file with mode: 0644]
docs/v2_models.rst [new file with mode: 0644]
docs/v2_pagination.rst [new file with mode: 0644]

index 500a8232ea93243bfe9e22836f84dcf09e435212..34116bf61973937a7d223066466d58a5ca570912 100644 (file)
@@ -4,9 +4,9 @@
 
 .. include:: parameters.rst
 
-**************************************************
-:class:`tweepy.API` --- Twitter API v1.1 Reference
-**************************************************
+************
+:class:`API`
+************
 
 .. autoclass:: API
 
index dd9025b1a808c44c8a8c41122c19f509c4e27185..da4123a9d410010c43c0983613a1ccb76bd3eb16 100644 (file)
@@ -2,9 +2,9 @@
 
 .. currentmodule:: tweepy.asynchronous
 
-**************************************************************************
-:class:`tweepy.asynchronous.AsyncStream` --- Asynchronous Stream Reference
-**************************************************************************
+********************
+:class:`AsyncStream`
+********************
 
 .. autoclass:: AsyncStream
    :members:
index 75865eace803cd4978123c21c805f198d1611bfe..0f20459cb2e2e11b654b3ef34b13a9a447c3555e 100644 (file)
@@ -2,9 +2,9 @@
 
 .. currentmodule:: tweepy
 
-***************************************************
-:class:`tweepy.Client` --- Twitter API v2 Reference
-***************************************************
+***************
+:class:`Client`
+***************
 
 .. autoclass:: Client
 
index d3e9d659a53c447e1f82225da8246ee6d98f5b0b..fe1bfb6cb7ead7ff67962fa0366ca4916fecd341 100644 (file)
@@ -14,17 +14,37 @@ Contents:
    install.rst
    getting_started.rst
    authentication.rst
+   logging.rst
+   streaming.rst
+
+.. toctree::
+   :caption: Twitter API v1.1 Reference
+
    api.rst
-   client.rst
-   models.rst
    stream.rst
-   streamingclient.rst
    asyncstream.rst
    exceptions.rst
+   v1_models.rst
+   v1_pagination.rst
+
+.. toctree::
+   :maxdepth: 1
+
    extended_tweets.rst
-   logging.rst
-   pagination.rst
-   streaming.rst
+
+.. toctree::
+   :caption: Twitter API v2 Reference
+
+   client.rst
+   streamingclient.rst
+   exceptions.rst
+   v2_models.rst
+   v2_pagination.rst
+
+.. toctree::
+   :caption: Meta
+   :maxdepth: 2
+
    changelog.md
    development.rst
    examples.rst
diff --git a/docs/models.rst b/docs/models.rst
deleted file mode 100644 (file)
index a40269b..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-.. _models_reference:
-
-****************
-Models Reference
-****************
-
-.. tabs::
-
-   .. group-tab:: API v1.1
-
-      .. class:: tweepy.models.BoundingBox
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/geo#bounding-box
-
-      .. class:: tweepy.models.DirectMessage
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/guides/message-create-object
-
-      .. class:: tweepy.models.Friendship
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show#example-response
-
-      .. class:: tweepy.models.List
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show#example-response
-
-      .. class:: tweepy.models.Media
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/entities#media
-
-      .. class:: tweepy.models.Place
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/geo#place
-
-      .. class:: tweepy.models.Relationship
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup#example-response
-
-      .. class:: tweepy.models.SavedSearch
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-show-id#example-response
-
-      .. class:: tweepy.models.SearchResults
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/api-reference/get-search-tweets#example-response
-
-      .. class:: tweepy.models.Status
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/tweet
-
-      .. class:: tweepy.models.User
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/user
-
-   .. group-tab:: API v2
-
-      .. versionadded:: 4.0
-
-      .. class:: tweepy.List
-
-         .. versionadded:: 4.4
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/lists
-
-      .. class:: tweepy.Media
-
-         .. versionchanged:: 4.5
-            Added ``url`` field
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/media
-
-      .. class:: tweepy.Place
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/place
-
-      .. class:: tweepy.Poll
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/poll
-
-      .. class:: tweepy.ReferencedTweet
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
-
-      .. class:: tweepy.Space
-
-         .. versionadded:: 4.1
-
-         .. versionchanged:: 4.4
-            Added ``ended_at`` and ``topic_ids`` fields
-
-         .. versionchanged:: 4.6
-            Added ``subscriber_count`` field
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/space
-
-      .. class:: tweepy.Tweet
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
-
-      .. class:: tweepy.User
-
-         :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user
diff --git a/docs/pagination.rst b/docs/pagination.rst
deleted file mode 100644 (file)
index 48dae16..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-.. _pagination_guide:
-
-.. currentmodule:: tweepy
-
-**********
-Pagination
-**********
-
-.. tabs::
-
-    .. group-tab:: API v1.1
-
-        .. autoclass:: Cursor
-            :members:
-
-    .. group-tab:: API v2
-
-        .. autoclass:: Paginator
-            :members:
-
-Example
-=======
-
-.. tabs::
-
-    .. group-tab:: API v1.1
-
-        ::
-
-            import tweepy
-
-            auth = tweepy.OAuth2AppHandler("Consumer Key here", "Consumer Secret here")
-            api = tweepy.API(auth)
-
-            for status in tweepy.Cursor(api.search_tweets, "Tweepy",
-                                        count=100).items(250):
-                print(status.id)
-
-            for page in tweepy.Cursor(api.get_followers, screen_name="TwitterDev",
-                                      count=200).pages(5):
-                print(len(page))
-
-    .. group-tab:: API v2
-
-        ::
-
-            import tweepy
-
-            client = tweepy.Client("Bearer Token here")
-
-            for response in tweepy.Paginator(client.get_users_followers, 2244994945,
-                                             max_results=1000, limit=5):
-                print(response.meta)
-
-            for tweet in tweepy.Paginator(client.search_recent_tweets, "Tweepy",
-                                          max_results=100).flatten(limit=250):
-                print(tweet.id)
index 73b18ef6cf09d814f117da8dc0cfd25b4c9b7df8..c92a12cde10a6f6d40fc1f774627a382b3fed109 100644 (file)
@@ -2,9 +2,9 @@
 
 .. currentmodule:: tweepy
 
-*****************************************************
-:class:`tweepy.Stream` --- Twitter API v1.1 Reference
-*****************************************************
+***************
+:class:`Stream`
+***************
 
 .. autoclass:: Stream
    :members:
index 048f96b07175a7e5a5ccbbe994ca8c00556883f7..06e0c7c0767ba8cb6775b5ea613c791733cce474 100644 (file)
@@ -2,9 +2,9 @@
 
 .. currentmodule:: tweepy
 
-************************************************************
-:class:`tweepy.StreamingClient` --- Twitter API v2 Reference
-************************************************************
+************************
+:class:`StreamingClient`
+************************
 
 .. autoclass:: StreamingClient
    :members:
diff --git a/docs/v1_models.rst b/docs/v1_models.rst
new file mode 100644 (file)
index 0000000..5e4706b
--- /dev/null
@@ -0,0 +1,49 @@
+.. _v1_models_reference:
+
+******
+Models
+******
+
+.. class:: tweepy.models.BoundingBox
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/geo#bounding-box
+
+.. class:: tweepy.models.DirectMessage
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/guides/message-create-object
+
+.. class:: tweepy.models.Friendship
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show#example-response
+
+.. class:: tweepy.models.List
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show#example-response
+
+.. class:: tweepy.models.Media
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/entities#media
+
+.. class:: tweepy.models.Place
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/geo#place
+
+.. class:: tweepy.models.Relationship
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup#example-response
+
+.. class:: tweepy.models.SavedSearch
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-show-id#example-response
+
+.. class:: tweepy.models.SearchResults
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/api-reference/get-search-tweets#example-response
+
+.. class:: tweepy.models.Status
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/tweet
+
+.. class:: tweepy.models.User
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/user
diff --git a/docs/v1_pagination.rst b/docs/v1_pagination.rst
new file mode 100644 (file)
index 0000000..37adbda
--- /dev/null
@@ -0,0 +1,28 @@
+.. _v1_pagination_guide:
+
+.. currentmodule:: tweepy
+
+**********
+Pagination
+**********
+
+.. autoclass:: Cursor
+    :members:
+
+Example
+=======
+
+::
+
+    import tweepy
+
+    auth = tweepy.OAuth2AppHandler("Consumer Key here", "Consumer Secret here")
+    api = tweepy.API(auth)
+
+    for status in tweepy.Cursor(api.search_tweets, "Tweepy",
+                                count=100).items(250):
+        print(status.id)
+
+    for page in tweepy.Cursor(api.get_followers, screen_name="TwitterDev",
+                                count=200).pages(5):
+        print(len(page))
diff --git a/docs/v2_models.rst b/docs/v2_models.rst
new file mode 100644 (file)
index 0000000..0923791
--- /dev/null
@@ -0,0 +1,52 @@
+.. _v2_models_reference:
+
+******
+Models
+******
+
+.. versionadded:: 4.0
+
+.. class:: tweepy.List
+
+   .. versionadded:: 4.4
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/lists
+
+.. class:: tweepy.Media
+
+   .. versionchanged:: 4.5
+      Added ``url`` field
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/media
+
+.. class:: tweepy.Place
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/place
+
+.. class:: tweepy.Poll
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/poll
+
+.. class:: tweepy.ReferencedTweet
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
+
+.. class:: tweepy.Space
+
+   .. versionadded:: 4.1
+
+   .. versionchanged:: 4.4
+      Added ``ended_at`` and ``topic_ids`` fields
+
+   .. versionchanged:: 4.6
+      Added ``subscriber_count`` field
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/space
+
+.. class:: tweepy.Tweet
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
+
+.. class:: tweepy.User
+
+   :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user
diff --git a/docs/v2_pagination.rst b/docs/v2_pagination.rst
new file mode 100644 (file)
index 0000000..0146515
--- /dev/null
@@ -0,0 +1,27 @@
+.. _v2_pagination_guide:
+
+.. currentmodule:: tweepy
+
+**********
+Pagination
+**********
+
+.. autoclass:: Paginator
+    :members:
+
+Example
+=======
+
+::
+
+    import tweepy
+
+    client = tweepy.Client("Bearer Token here")
+
+    for response in tweepy.Paginator(client.get_users_followers, 2244994945,
+                                        max_results=1000, limit=5):
+        print(response.meta)
+
+    for tweet in tweepy.Paginator(client.search_recent_tweets, "Tweepy",
+                                    max_results=100).flatten(limit=250):
+        print(tweet.id)