From 0914654ba69b9cf013f286e95315b69c57060b8c Mon Sep 17 00:00:00 2001
From: Dan <14043624+delivrance@users.noreply.github.com>
Date: Mon, 13 May 2019 18:04:44 +0200
Subject: [PATCH] Fix cross-reference links
---
docs/source/index.rst | 13 +++++++------
docs/source/intro/install.rst | 2 +-
docs/source/start/errors.rst | 20 ++++++++++----------
docs/source/start/updates.rst | 5 ++++-
docs/source/topics/advanced-usage.rst | 13 +++++--------
docs/source/topics/config-file.rst | 6 +++---
docs/source/topics/faq.rst | 4 ++--
docs/source/topics/more-on-updates.rst | 4 ++--
docs/source/topics/session-settings.rst | 4 ++--
docs/source/topics/smart-plugins.rst | 4 ++--
10 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 81b4213c..9ff0f720 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -23,7 +23,7 @@ Welcome to Pyrogram
•
- Changelog
+ Releases
•
@@ -55,7 +55,7 @@ Welcome to Pyrogram
app.run()
**Pyrogram** is an elegant, easy-to-use Telegram_ client library and framework written from the ground up in Python and
-C. It enables you to easily create custom apps using both user and bot identities (bot API alternative) via the
+C. It enables you to easily create custom apps for both user and bot identities (bot API alternative) via the
`MTProto API`_.
.. _Telegram: https://telegram.org
@@ -65,7 +65,8 @@ How the Documentation is Organized
----------------------------------
Contents are organized into self-contained topics and can be all accessed from the sidebar, or by following them in
-order using the Next button at the end of each page. Here below you can find a list of the most relevant pages.
+order using the Next button at the end of each page. Here below you can, instead, find a list of the most relevant
+pages.
Getting Started
^^^^^^^^^^^^^^^
@@ -86,9 +87,9 @@ API Reference
- `Available Methods`_ - A list of available high-level methods.
- `Available Types`_ - A list of available high-level types.
-.. _Client Class: core/client
-.. _Available Methods: core/methods
-.. _Available Types: core/types
+.. _Client Class: api/client
+.. _Available Methods: api/methods
+.. _Available Types: api/types
Topics
^^^^^^
diff --git a/docs/source/intro/install.rst b/docs/source/intro/install.rst
index 161c7d61..e2e4365a 100644
--- a/docs/source/intro/install.rst
+++ b/docs/source/intro/install.rst
@@ -88,5 +88,5 @@ If no error shows up you are good to go.
>>> pyrogram.__version__
'0.12.0'
-.. _TgCrypto: ../resources/tgcrypto.html
+.. _TgCrypto: ../topics/tgcrypto
.. _`Github repo`: http://github.com/pyrogram/pyrogram
diff --git a/docs/source/start/errors.rst b/docs/source/start/errors.rst
index d05206c9..1260672e 100644
--- a/docs/source/start/errors.rst
+++ b/docs/source/start/errors.rst
@@ -4,18 +4,18 @@ Error Handling
Errors are inevitable when working with the API, and they must be correctly handled with ``try..except`` blocks.
There are many errors that Telegram could return, but they all fall in one of these categories
-(which are in turn children of the :obj:`RPCError ` superclass):
+(which are in turn children of the ``RPCError`` superclass):
-- :obj:`303 - See Other `
-- :obj:`400 - Bad Request `
-- :obj:`401 - Unauthorized `
-- :obj:`403 - Forbidden `
-- :obj:`406 - Not Acceptable `
-- :obj:`420 - Flood `
-- :obj:`500 - Internal Server Error `
+- `303 - See Other <../api/errors#see-other>`_
+- `400 - Bad Request <../api/errors#bad-request>`_
+- `401 - Unauthorized <../api/errors#unauthorized>`_
+- `403 - Forbidden <../api/errors#forbidden>`_
+- `406 - Not Acceptable <../api/errors#not-acceptable>`_
+- `420 - Flood <../api/errors#flood>`_
+- `500 - Internal Server Error <../api/errors#internal-server-error>`_
As stated above, there are really many (too many) errors, and in case Pyrogram does not know anything yet about a
-specific one, it raises a special :obj:`520 Unknown Error ` exception and logs it
+specific one, it raises a special ``520 Unknown Error`` exception and logs it
in the ``unknown_errors.txt`` file. Users are invited to report these unknown errors.
Examples
@@ -44,7 +44,7 @@ Examples
pass
Exception objects may also contain some informative values.
-E.g.: :obj:`FloodWait ` holds the amount of seconds you have to wait
+E.g.: ``FloodWait`` holds the amount of seconds you have to wait
before you can try again. The value is always stored in the ``x`` field of the returned exception object:
.. code-block:: python
diff --git a/docs/source/start/updates.rst b/docs/source/start/updates.rst
index 0dcb08ad..85005b9c 100644
--- a/docs/source/start/updates.rst
+++ b/docs/source/start/updates.rst
@@ -4,10 +4,13 @@ Handling Updates
Calling `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.
+Defining Updates
+----------------
+
First, let's define what are these updates. As hinted already, updates are simply events that happen in your Telegram
account (incoming messages, new members join, button presses, etc...), which are meant to notify you about a new
specific state that changed. These updates are handled by registering one or more callback functions in your app using
-`Handlers <../pyrogram/Handlers.html>`_.
+`Handlers <../api/handlers>`_.
Each handler deals with a specific event and once a matching update arrives from Telegram, your registered callback
function will be called and its body executed.
diff --git a/docs/source/topics/advanced-usage.rst b/docs/source/topics/advanced-usage.rst
index 8b722b2a..970e07e0 100644
--- a/docs/source/topics/advanced-usage.rst
+++ b/docs/source/topics/advanced-usage.rst
@@ -125,12 +125,9 @@ For example, given the ID *123456789*, here's how Pyrogram can tell entities apa
So, every time you take a raw ID, make sure to translate it into the correct ID when you want to use it with an
high-level method.
-
-
-
-.. _methods: ../pyrogram/Client.html#messages
-.. _types: ../pyrogram/Types.html
-.. _plenty of them: ../pyrogram/Client.html#messages
-.. _raw functions: ../pyrogram/functions
-.. _raw types: ../pyrogram/types
+.. _methods: ../api/methods
+.. _types: ../api/types
+.. _plenty of them: ../api/methods
+.. _raw functions: ../telegram/functions
+.. _raw types: ../telegram/types
.. _Community: https://t.me/PyrogramChat
\ No newline at end of file
diff --git a/docs/source/topics/config-file.rst b/docs/source/topics/config-file.rst
index 2a50277f..14ae9fb6 100644
--- a/docs/source/topics/config-file.rst
+++ b/docs/source/topics/config-file.rst
@@ -54,7 +54,7 @@ The ``[pyrogram]`` section contains your Telegram API credentials: *api_id* and
api_id = 12345
api_hash = 0123456789abcdef0123456789abcdef
-`More info about API Key. <../start/Setup.html#configuration>`_
+`More info about API Key. <../intro/setup#api-keys>`_
Proxy
^^^^^
@@ -70,7 +70,7 @@ The ``[proxy]`` section contains settings about your SOCKS5 proxy.
username =
password =
-`More info about SOCKS5 Proxy. `_
+`More info about SOCKS5 Proxy. `_
Plugins
^^^^^^^
@@ -87,4 +87,4 @@ The ``[plugins]`` section contains settings about Smart Plugins.
exclude =
module fn2
-`More info about Smart Plugins. `_
+`More info about Smart Plugins. `_
diff --git a/docs/source/topics/faq.rst b/docs/source/topics/faq.rst
index 5a8a3929..0834389e 100644
--- a/docs/source/topics/faq.rst
+++ b/docs/source/topics/faq.rst
@@ -11,7 +11,7 @@ What is Pyrogram?
-----------------
**Pyrogram** is an elegant, easy-to-use Telegram_ client library and framework written from the ground up in Python and
-C. It enables you to easily create custom applications using both user and bot identities (bot API alternative) via the
+C. It enables you to easily create custom applications for both user and bot identities (bot API alternative) via the
`MTProto API`_ with the Python programming language.
.. _Telegram: https://telegram.org
@@ -30,7 +30,7 @@ How old is Pyrogram?
Pyrogram was first released on December 12, 2017. The actual work on the framework began roughly three months prior the
initial public release on `GitHub`_.
-.. _GitHub:
+.. _GitHub: https://github.com/pyrogram/pyrogram
Why do I need an API key for bots?
----------------------------------
diff --git a/docs/source/topics/more-on-updates.rst b/docs/source/topics/more-on-updates.rst
index 84086622..cb319ee1 100644
--- a/docs/source/topics/more-on-updates.rst
+++ b/docs/source/topics/more-on-updates.rst
@@ -218,5 +218,5 @@ The output of both (equivalent) examples will be:
1
2
-.. _`update handlers`: UpdateHandling.html
-.. _`filters`: UsingFilters.html
\ No newline at end of file
+.. _`update handlers`: ../start/updates
+.. _`filters`: filters
\ No newline at end of file
diff --git a/docs/source/topics/session-settings.rst b/docs/source/topics/session-settings.rst
index 47c6872e..89b7e62c 100644
--- a/docs/source/topics/session-settings.rst
+++ b/docs/source/topics/session-settings.rst
@@ -5,8 +5,8 @@ As you may probably know, Telegram allows users (and bots) having more than one
in the system at the same time.
Briefly explaining, sessions are simply new logins in your account. They can be reviewed in the settings of an official
-app (or by invoking `GetAuthorizations <../functions/account/GetAuthorizations.html>`_ with Pyrogram). They store some
-useful information such as the client who's using them and from which country and IP address.
+app (or by invoking `GetAuthorizations <../telegram/functions/account/GetAuthorizations.html>`_ with Pyrogram). They
+store some useful information such as the client who's using them and from which country and IP address.
.. figure:: https://i.imgur.com/lzGPCdZ.png
:width: 70%
diff --git a/docs/source/topics/smart-plugins.rst b/docs/source/topics/smart-plugins.rst
index 6f266590..fbe27388 100644
--- a/docs/source/topics/smart-plugins.rst
+++ b/docs/source/topics/smart-plugins.rst
@@ -65,7 +65,7 @@ after importing your modules, like this:
app.run()
This is already nice and doesn't add *too much* boilerplate code, but things can get boring still; you have to
-manually ``import``, manually :meth:`add_handler ` and manually instantiate each
+manually ``import``, manually :meth:`add_handler() ` and manually instantiate each
:obj:`MessageHandler ` object because **you can't use those cool decorators** for your
functions. So, what if you could? Smart Plugins solve this issue by taking care of handlers registration automatically.
@@ -156,7 +156,7 @@ found inside each module will be, instead, loaded in the order they are defined,
.. note::
Remember: there can be at most one handler, within a group, dealing with a specific update. Plugins with overlapping
- filters included a second time will not work. Learn more at `More on Updates `_.
+ filters included a second time will not work. Learn more at `More on Updates `_.
This default loading behaviour is usually enough, but sometimes you want to have more control on what to include (or
exclude) and in which exact order to load plugins. The way to do this is to make use of ``include`` and ``exclude``