diff --git a/compiler/docs/template/bound-methods.rst b/compiler/docs/template/bound-methods.rst index 0057e071..4238df52 100644 --- a/compiler/docs/template/bound-methods.rst +++ b/compiler/docs/template/bound-methods.rst @@ -20,6 +20,12 @@ some of the required arguments. app.run() +.. contents:: Contents + :backlinks: none + :local: + +----- + .. currentmodule:: pyrogram Message diff --git a/compiler/docs/template/methods.rst b/compiler/docs/template/methods.rst index a0c6df92..5a287f87 100644 --- a/compiler/docs/template/methods.rst +++ b/compiler/docs/template/methods.rst @@ -13,6 +13,12 @@ This page is about Pyrogram methods. All the methods listed here are bound to a with app: app.send_message("haskell", "hi") +.. contents:: Contents + :backlinks: none + :local: + +----- + .. currentmodule:: pyrogram.Client Utilities diff --git a/compiler/docs/template/types.rst b/compiler/docs/template/types.rst index 5c91e68f..2c79c11d 100644 --- a/compiler/docs/template/types.rst +++ b/compiler/docs/template/types.rst @@ -13,8 +13,13 @@ This page is about Pyrogram types. All types listed here are accessible through **Optional** fields may not exist when irrelevant -- i.e.: they will contain the value of ``None`` and aren't shown when, for example, using ``print()``. -.. currentmodule:: pyrogram +.. contents:: Contents + :backlinks: none + :local: +----- + +.. currentmodule:: pyrogram Users & Chats ------------- diff --git a/docs/source/api/client.rst b/docs/source/api/client.rst index d28b7f61..4190af5b 100644 --- a/docs/source/api/client.rst +++ b/docs/source/api/client.rst @@ -17,6 +17,8 @@ This page is about the Client class, which exposes high-level methods for an eas with app: app.send_message("me", "Hi!") +----- + Details ------- diff --git a/docs/source/api/decorators.rst b/docs/source/api/decorators.rst index fd397cc4..2fc856bc 100644 --- a/docs/source/api/decorators.rst +++ b/docs/source/api/decorators.rst @@ -24,6 +24,12 @@ functions. app.run() +.. contents:: Contents + :backlinks: none + :local: + +----- + .. currentmodule:: pyrogram Index diff --git a/docs/source/api/errors.rst b/docs/source/api/errors.rst index fad571e3..5c443cf3 100644 --- a/docs/source/api/errors.rst +++ b/docs/source/api/errors.rst @@ -15,6 +15,12 @@ follow the usual *PascalCase* convention. except FloodWait as e: ... +.. contents:: Contents + :backlinks: none + :local: + +----- + 303 - SeeOther -------------- diff --git a/docs/source/api/handlers.rst b/docs/source/api/handlers.rst index 1ae0961b..e66b66bd 100644 --- a/docs/source/api/handlers.rst +++ b/docs/source/api/handlers.rst @@ -20,6 +20,12 @@ For a much more convenient way of registering callback functions have a look at app.run() +.. contents:: Contents + :backlinks: none + :local: + +----- + .. currentmodule:: pyrogram Index diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 32827c76..b064e10b 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -13,7 +13,8 @@ This FAQ page provides answers to common questions about Pyrogram and, to some e .. contents:: Contents :backlinks: none :local: - :depth: 1 + +----- What is Pyrogram? ----------------- diff --git a/docs/source/glossary.rst b/docs/source/glossary.rst index de9d354d..a0e970ae 100644 --- a/docs/source/glossary.rst +++ b/docs/source/glossary.rst @@ -8,6 +8,11 @@ general. Some words may as well link to dedicated articles in case the topic is If you think something interesting could be added here, feel free to propose it by opening a `Feature Request`_. +.. contents:: Contents + :backlinks: none + :local: + +----- Terms ----- diff --git a/docs/source/intro/install.rst b/docs/source/intro/install.rst index edd43161..5312e44a 100644 --- a/docs/source/intro/install.rst +++ b/docs/source/intro/install.rst @@ -11,6 +11,12 @@ We recommend using the latest versions of both Python 3 and pip. Pyrogram supports **Python 3** only, starting from version 3.5.3. **PyPy** is supported too. +.. contents:: Contents + :backlinks: none + :local: + +----- + Install Pyrogram ---------------- diff --git a/docs/source/intro/setup.rst b/docs/source/intro/setup.rst index b3aa1836..f5bf607b 100644 --- a/docs/source/intro/setup.rst +++ b/docs/source/intro/setup.rst @@ -4,6 +4,12 @@ Project Setup We have just :doc:`installed Pyrogram `. In this page we'll discuss what you need to do in order to set up a project with the library. Let's see how it's done. +.. contents:: Contents + :backlinks: none + :local: + +----- + API Keys -------- diff --git a/docs/source/license.rst b/docs/source/license.rst index 43f59d73..512f2c5b 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -12,4 +12,4 @@ In other words: you can use and integrate Pyrogram into your own code --- either different license, or even proprietary --- without being required to release the source code of your own applications. However, any modifications to the library itself are required to be published for free under the same LGPLv3+ license. -.. _GNU Lesser General Public License v3 or later (LGPLv3+): https://github.com/pyrogram/pyrogram/blob/develop/COPYING.lesser \ No newline at end of file +.. _GNU Lesser General Public License v3 or later (LGPLv3+): https://github.com/pyrogram/pyrogram/blob/develop/COPYING.lesser diff --git a/docs/source/powered-by.rst b/docs/source/powered-by.rst index 4af4fc27..a696cebc 100644 --- a/docs/source/powered-by.rst +++ b/docs/source/powered-by.rst @@ -9,6 +9,12 @@ This is a collection of remarkable projects made with Pyrogram. If you'd like to propose a project that's worth being listed here, feel free to open a `Feature Request`_. +.. contents:: Contents + :backlinks: none + :local: + +----- + Projects Showcase ----------------- diff --git a/docs/source/start/auth.rst b/docs/source/start/auth.rst index ca1ddd8f..0bbd4c5e 100644 --- a/docs/source/start/auth.rst +++ b/docs/source/start/auth.rst @@ -4,6 +4,12 @@ Authorization Once a :doc:`project is set up <../intro/setup>`, you will still have to follow a few steps before you can actually use Pyrogram to make API calls. This section provides all the information you need in order to authorize yourself as user or bot. +.. contents:: Contents + :backlinks: none + :local: + +----- + User Authorization ------------------ diff --git a/docs/source/start/errors.rst b/docs/source/start/errors.rst index bd82bf73..a9707d08 100644 --- a/docs/source/start/errors.rst +++ b/docs/source/start/errors.rst @@ -8,6 +8,12 @@ to control the behaviour of your application. Pyrogram errors all live inside th from pyrogram import errors +.. contents:: Contents + :backlinks: none + :local: + +----- + RPCError -------- @@ -94,6 +100,6 @@ The value is stored in the ``x`` attribute of the exception object: from pyrogram.errors import FloodWait try: - ... + ... # Your code except FloodWait as e: time.sleep(e.x) # Wait "x" seconds before continuing diff --git a/docs/source/start/invoking.rst b/docs/source/start/invoking.rst index 5cb6817b..74b313e4 100644 --- a/docs/source/start/invoking.rst +++ b/docs/source/start/invoking.rst @@ -4,6 +4,12 @@ Calling Methods At this point, we have successfully :doc:`installed Pyrogram <../intro/install>` and :doc:`authorized ` our account; we are now aiming towards the core of the library. It's time to start playing with the API! +.. contents:: Contents + :backlinks: none + :local: + +----- + Basic Usage ----------- diff --git a/docs/source/start/updates.rst b/docs/source/start/updates.rst index 056fcb3d..4f010e27 100644 --- a/docs/source/start/updates.rst +++ b/docs/source/start/updates.rst @@ -4,6 +4,12 @@ Handling Updates Calling :doc:`API methods ` sequentially is cool, but how to react when, for example, a new message arrives? This page deals with updates and how to handle such events in Pyrogram. Let's have a look at how they work. +.. contents:: Contents + :backlinks: none + :local: + +----- + Defining Updates ---------------- diff --git a/docs/source/support-pyrogram.rst b/docs/source/support-pyrogram.rst index 81a0e533..2505585e 100644 --- a/docs/source/support-pyrogram.rst +++ b/docs/source/support-pyrogram.rst @@ -9,6 +9,8 @@ found it to be useful, give Pyrogram a `Star on GitHub`_. Your appreciation mean Star

+----- + Donate ------ diff --git a/docs/source/topics/advanced-usage.rst b/docs/source/topics/advanced-usage.rst index 1460a3d8..a56e0da1 100644 --- a/docs/source/topics/advanced-usage.rst +++ b/docs/source/topics/advanced-usage.rst @@ -8,6 +8,12 @@ Telegram API. In this section, you'll be shown the alternative way of communicating with Telegram using Pyrogram: the main "raw" Telegram API with its functions and types. +.. contents:: Contents + :backlinks: none + :local: + +----- + Telegram Raw API ---------------- diff --git a/docs/source/topics/bots-interaction.rst b/docs/source/topics/bots-interaction.rst index ad993050..97a72e05 100644 --- a/docs/source/topics/bots-interaction.rst +++ b/docs/source/topics/bots-interaction.rst @@ -3,6 +3,12 @@ Bots Interaction Users can interact with other bots via plain text messages as well as inline queries. +.. contents:: Contents + :backlinks: none + :local: + +----- + Inline Bots ----------- diff --git a/docs/source/topics/config-file.rst b/docs/source/topics/config-file.rst index a28025db..b6faee05 100644 --- a/docs/source/topics/config-file.rst +++ b/docs/source/topics/config-file.rst @@ -4,6 +4,12 @@ Configuration File As already mentioned in previous pages, Pyrogram can be configured by the use of an INI file. This page explains how this file is structured, how to use it and why. +.. contents:: Contents + :backlinks: none + :local: + +----- + Introduction ------------ diff --git a/docs/source/topics/create-filters.rst b/docs/source/topics/create-filters.rst index 6ae6e98c..060357de 100644 --- a/docs/source/topics/create-filters.rst +++ b/docs/source/topics/create-filters.rst @@ -9,6 +9,12 @@ for example) you can use :meth:`~pyrogram.Filters.create`. At the moment, the built-in filters are intended to be used with the :class:`~pyrogram.MessageHandler` only. +.. contents:: Contents + :backlinks: none + :local: + +----- + Custom Filters -------------- diff --git a/docs/source/topics/debugging.rst b/docs/source/topics/debugging.rst index 153c0927..7284884a 100644 --- a/docs/source/topics/debugging.rst +++ b/docs/source/topics/debugging.rst @@ -4,6 +4,12 @@ Debugging When working with the API, chances are you'll stumble upon bugs, get stuck and start wondering how to continue. Nothing to actually worry about -- that's normal -- and luckily for you, Pyrogram provides some commodities to help you in this. +.. contents:: Contents + :backlinks: none + :local: + +----- + Caveman Debugging ----------------- diff --git a/docs/source/topics/more-on-updates.rst b/docs/source/topics/more-on-updates.rst index f23e692e..1bffaeef 100644 --- a/docs/source/topics/more-on-updates.rst +++ b/docs/source/topics/more-on-updates.rst @@ -4,6 +4,12 @@ More on Updates Here we'll show some advanced usages when working with :doc:`update handlers <../start/updates>` and :doc:`filters `. +.. contents:: Contents + :backlinks: none + :local: + +----- + Handler Groups -------------- diff --git a/docs/source/topics/mtproto-vs-botapi.rst b/docs/source/topics/mtproto-vs-botapi.rst index b0e46a7f..3668d0da 100644 --- a/docs/source/topics/mtproto-vs-botapi.rst +++ b/docs/source/topics/mtproto-vs-botapi.rst @@ -6,6 +6,12 @@ already superior to, what is usually called, the official Bot API, in many respe why Pyrogram might be a better choice for your project by comparing the two APIs, but first, let's make it clear what actually is the MTProto and the Bot API. +.. contents:: Contents + :backlinks: none + :local: + +----- + What is the MTProto API? ------------------------ diff --git a/docs/source/topics/proxy.rst b/docs/source/topics/proxy.rst index 761899e6..cde55cc7 100644 --- a/docs/source/topics/proxy.rst +++ b/docs/source/topics/proxy.rst @@ -4,6 +4,12 @@ SOCKS5 Proxy Pyrogram supports proxies with and without authentication. This feature allows Pyrogram to exchange data with Telegram through an intermediate SOCKS5 proxy server. +.. contents:: Contents + :backlinks: none + :local: + +----- + Usage ----- diff --git a/docs/source/topics/scheduling.rst b/docs/source/topics/scheduling.rst index 3cb95ec7..c5f410bb 100644 --- a/docs/source/topics/scheduling.rst +++ b/docs/source/topics/scheduling.rst @@ -8,6 +8,12 @@ Since there's no built-in task scheduler in Pyrogram, this page will only show e with the main Python schedule libraries such as ``schedule`` and ``apscheduler``. For more detailed information, you can visit and learn from each library documentation. +.. contents:: Contents + :backlinks: none + :local: + +----- + Using ``schedule`` ------------------ diff --git a/docs/source/topics/serializing.rst b/docs/source/topics/serializing.rst index b4d66f46..8e6f29de 100644 --- a/docs/source/topics/serializing.rst +++ b/docs/source/topics/serializing.rst @@ -5,6 +5,12 @@ Serializing means converting a Pyrogram object, which exists as Python class ins easily shared and stored anywhere. Pyrogram provides two formats for serializing its objects: one good looking for humans and another more compact for machines that is able to recover the original structures. +.. contents:: Contents + :backlinks: none + :local: + +----- + For Humans - str(obj) --------------------- diff --git a/docs/source/topics/session-settings.rst b/docs/source/topics/session-settings.rst index dd777bda..a97dbc06 100644 --- a/docs/source/topics/session-settings.rst +++ b/docs/source/topics/session-settings.rst @@ -20,6 +20,12 @@ That's how a session looks like on the Android app, showing the three main piece - ``device_model``: **CPython 3.7.2** - ``system_version``: **Linux 4.15.0-23-generic** +.. contents:: Contents + :backlinks: none + :local: + +----- + Set Custom Values ----------------- diff --git a/docs/source/topics/smart-plugins.rst b/docs/source/topics/smart-plugins.rst index 7cfed47d..7ffe1cb2 100644 --- a/docs/source/topics/smart-plugins.rst +++ b/docs/source/topics/smart-plugins.rst @@ -9,6 +9,12 @@ different Pyrogram applications with **minimal boilerplate code**. Smart Plugins are completely optional and disabled by default. +.. contents:: Contents + :backlinks: none + :local: + +----- + Introduction ------------ diff --git a/docs/source/topics/storage-engines.rst b/docs/source/topics/storage-engines.rst index 44b4afa6..e7494e2b 100644 --- a/docs/source/topics/storage-engines.rst +++ b/docs/source/topics/storage-engines.rst @@ -5,6 +5,12 @@ Every time you login to Telegram, some personal piece of data are created and he and the server, Telegram). This session data is uniquely bound to your own account, indefinitely (until you logout or decide to manually terminate it) and is used to authorize a client to execute API calls on behalf of your identity. +.. contents:: Contents + :backlinks: none + :local: + +----- + Persisting Sessions ------------------- diff --git a/docs/source/topics/test-servers.rst b/docs/source/topics/test-servers.rst index 2f82f24c..451fc98a 100644 --- a/docs/source/topics/test-servers.rst +++ b/docs/source/topics/test-servers.rst @@ -18,6 +18,12 @@ Telegram's test servers without hassle. All you need to do is start a new sessio Don't worry about your contacts and chats, they will be kept untouched inside the production environment; accounts authorized on test servers reside in a different, parallel instance of a Telegram database. +.. contents:: Contents + :backlinks: none + :local: + +----- + Test Mode in Official Apps -------------------------- diff --git a/docs/source/topics/text-formatting.rst b/docs/source/topics/text-formatting.rst index 0194dc58..f4ac23e1 100644 --- a/docs/source/topics/text-formatting.rst +++ b/docs/source/topics/text-formatting.rst @@ -17,6 +17,12 @@ Pyrogram uses a custom Markdown dialect for text formatting which adds some uniq texts easier in both Markdown and HTML. You can send sophisticated text messages and media captions using a great variety of decorations that can also be nested in order to combine multiple styles together. +.. contents:: Contents + :backlinks: none + :local: + +----- + Basic Styles ------------ diff --git a/docs/source/topics/tgcrypto.rst b/docs/source/topics/tgcrypto.rst index 9dd4c8ac..a5d9f815 100644 --- a/docs/source/topics/tgcrypto.rst +++ b/docs/source/topics/tgcrypto.rst @@ -7,6 +7,12 @@ Library specifically written in C for Pyrogram [1]_ as a Python extension. TgCrypto is a replacement for the much slower PyAES and implements the crypto algorithms Telegram requires, namely **AES-IGE 256 bit** (used in MTProto v2.0) and **AES-CTR 256 bit** (used for CDN encrypted files). +.. contents:: Contents + :backlinks: none + :local: + +----- + Installation ------------ diff --git a/docs/source/topics/use-filters.rst b/docs/source/topics/use-filters.rst index de7a35a8..8806052e 100644 --- a/docs/source/topics/use-filters.rst +++ b/docs/source/topics/use-filters.rst @@ -7,6 +7,12 @@ comes from the server, but there's much more than that to come. Here we'll discuss about :class:`~pyrogram.Filters`. Filters enable a fine-grain control over what kind of updates are allowed or not to be passed in your callback functions, based on their inner details. +.. contents:: Contents + :backlinks: none + :local: + +----- + Single Filters --------------