From dea267e50d61532efb0bee87c5a22d11f28f986d Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 18 Feb 2026 13:45:04 +0200 Subject: [PATCH] Improve documentation (#1256) * Remove documentation link to TimezoneTransition (removed in #958) * Document more APIs * Upgrade Sphinx * Belatedly bump version in docs --- docs/api/dates.rst | 8 ++++++-- docs/api/numbers.rst | 36 ++++++++++++++++++++++++++++++++---- docs/api/plural.rst | 6 ++++++ docs/api/units.rst | 6 ++++++ docs/conf.py | 6 +++--- docs/requirements.txt | 2 +- 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/docs/api/dates.rst b/docs/api/dates.rst index cbdac593..9f0c80b5 100644 --- a/docs/api/dates.rst +++ b/docs/api/dates.rst @@ -40,8 +40,6 @@ Timezone Functionality A timezone object for the computer's local timezone. -.. autoclass:: TimezoneTransition - Data Access ----------- @@ -69,3 +67,9 @@ Basic Parsing .. autofunction:: parse_time .. autofunction:: parse_pattern + +Exceptions +---------- + +.. autoexception:: ParseError + :members: diff --git a/docs/api/numbers.rst b/docs/api/numbers.rst index d3ab8b11..c43bd56d 100644 --- a/docs/api/numbers.rst +++ b/docs/api/numbers.rst @@ -36,19 +36,47 @@ Exceptions .. autoexception:: NumberFormatError :members: +.. autoexception:: UnknownCurrencyError + :members: + +.. autoexception:: UnknownCurrencyFormatError + :members: + +.. autoexception:: UnsupportedNumberingSystemError + :members: + Data Access ----------- +.. autofunction:: get_decimal_symbol + +.. autofunction:: get_exponential_symbol + +.. autofunction:: get_group_symbol + +.. autofunction:: get_infinity_symbol + +.. autofunction:: get_minus_sign_symbol + +.. autofunction:: get_plus_sign_symbol + +Currency Utilities +------------------ + .. autofunction:: get_currency_name +.. autofunction:: get_currency_precision + .. autofunction:: get_currency_symbol .. autofunction:: get_currency_unit_pattern -.. autofunction:: get_decimal_symbol +.. autofunction:: get_territory_currencies -.. autofunction:: get_plus_sign_symbol +.. autofunction:: is_currency -.. autofunction:: get_minus_sign_symbol +.. autofunction:: list_currencies -.. autofunction:: get_territory_currencies +.. autofunction:: normalize_currency + +.. autofunction:: validate_currency diff --git a/docs/api/plural.rst b/docs/api/plural.rst index d6934b57..c40f29f0 100644 --- a/docs/api/plural.rst +++ b/docs/api/plural.rst @@ -21,3 +21,9 @@ Conversion Functionality .. autofunction:: to_python .. autofunction:: to_gettext + +Exceptions +---------- + +.. autoexception:: RuleError + :members: diff --git a/docs/api/units.rst b/docs/api/units.rst index 2b99be54..db94b705 100644 --- a/docs/api/units.rst +++ b/docs/api/units.rst @@ -11,3 +11,9 @@ locales. .. autofunction:: format_compound_unit .. autofunction:: get_unit_name + +Exceptions +---------- + +.. autoexception:: UnknownUnitError + :members: diff --git a/docs/conf.py b/docs/conf.py index b22b78c4..eb817579 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,16 +44,16 @@ master_doc = 'index' # General information about the project. project = 'Babel' -copyright = '2025, The Babel Team' +copyright = '2026, The Babel Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '2.17' +version = '2.18' # The full version, including alpha/beta/rc tags. -release = '2.17.0' +release = '2.18.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/requirements.txt b/docs/requirements.txt index c133306c..4864c69d 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1 @@ -Sphinx~=5.3.0 +Sphinx~=9.1.0 -- 2.47.3