]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Add docs for `babel.lists`
authorAarni Koskela <akx@iki.fi>
Fri, 8 Jan 2016 08:39:08 +0000 (10:39 +0200)
committerAarni Koskela <akx@iki.fi>
Fri, 8 Jan 2016 09:33:01 +0000 (11:33 +0200)
babel/lists.py
docs/api/index.rst
docs/api/lists.rst [new file with mode: 0644]

index 6e6fbd1921fd930795ca79ab3000879ebe615075..82e5590c1475ffb5a4d5223657e26990e7853c9a 100644 (file)
@@ -21,9 +21,9 @@ DEFAULT_LOCALE = default_locale()
 
 
 def format_list(lst, locale=DEFAULT_LOCALE):
-    """ Formats `lst` as a list
+    """
+    Format the items in `lst` as a list.
 
-    e.g.
     >>> format_list(['apples', 'oranges', 'pears'], 'en')
     u'apples, oranges, and pears'
     >>> format_list(['apples', 'oranges', 'pears'], 'zh')
index e21fa74ed52f16bb5f5d447ee97f370ca4f25c70..b882d300b3c976ab7780af32c6ae898a7b91b04f 100644 (file)
@@ -9,6 +9,7 @@ public API of Babel.
 
    core
    dates
+   lists
    messages/index
    numbers
    plural
diff --git a/docs/api/lists.rst b/docs/api/lists.rst
new file mode 100644 (file)
index 0000000..d526b6a
--- /dev/null
@@ -0,0 +1,8 @@
+List Formatting
+===============
+
+.. module:: babel.lists
+
+This module lets you format lists of items in a locale-dependent manner.
+
+.. autofunction:: format_list