diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index ea5dd2b5ff..dbb043b8d4 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -1004,6 +1004,7 @@ def get_title_list(s: str) -> list: categories = dict( enums=""" Enumerations + ButtonStyle ChatAction ChatEventAction ChatMemberStatus diff --git a/compiler/errors/source/400_BAD_REQUEST.tsv b/compiler/errors/source/400_BAD_REQUEST.tsv index 15cd02f9d0..581d14233b 100644 --- a/compiler/errors/source/400_BAD_REQUEST.tsv +++ b/compiler/errors/source/400_BAD_REQUEST.tsv @@ -223,6 +223,7 @@ FRESH_CHANGE_ADMINS_FORBIDDEN You were just elected admin, you can't add or modi FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors. FROM_PEER_INVALID The specified from_id is invalid. FROZEN_PARTICIPANT_MISSING The current account is [frozen](https://core.telegram.org/api/auth#frozen-accounts), and cannot access the specified peer. +FUTURE_CREATOR_NONE The future creator after leave is only applicable to supergroups. GAME_BOT_INVALID Bots can't send another bot's game. GENERAL_MODIFY_ICON_FORBIDDEN You can't modify the icon of the 'General' topic. GEO_POINT_INVALID Invalid geoposition provided. diff --git a/docs/source/conf.py b/docs/source/conf.py index f5d9418eb8..87a8d2faf7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,6 +45,7 @@ # "sphinx.ext.viewcode", "sphinx_copybutton", # "sphinx.ext.coverage", + "sphinx_llms_txt", ] intersphinx_mapping = { @@ -129,9 +130,31 @@ # Set canonical URL from the Read the Docs Domain html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") +if not html_baseurl: + html_baseurl = "/pyrogram/" # Tell Jinja2 templates the build is running on Read the Docs if os.environ.get("READTHEDOCS", "") == "True": if "html_context" not in globals(): html_context = {} html_context["READTHEDOCS"] = True + +llms_txt_filename = "llms.txt" + +# Disable full documentation file +llms_txt_full_file = False + +# Provide a specific, agent-friendly summary of Pyrogram +llms_txt_summary = """Pyrogram is an elegant, modern, and asynchronous MTProto API framework for Telegram in Python for users and bots. +This documentation covers the Pyrogram Client High-Level API, the Smart Plugin system, and the raw Low-Level Telegram Functions Types. +We merge changes made to few of pyrogram forks plus changes made by us to this repository. All the features are just customized feature mostly for personal use; there is no guarantee in them being stable, USE AT YOUR OWN RISK. +""" + +llms_txt_title = "PyroTGFork" + +# Exclude pages that just consume tokens without providing value (like indexes or search pages) +llms_txt_exclude = [ + "search", + "genindex", + "modindex", +] diff --git a/pyproject.toml b/pyproject.toml index 48db175796..0a2329a1db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,8 @@ docs = [ "furo<=2023.9.10", "sphinx-autobuild<=2021.3.14", "sphinx-copybutton<=0.5.2", - "pygments<=2.17.2" + "pygments<=2.17.2", + "sphinx-llms-txt==0.7.1" ] fast = [