|
From: <mi...@us...> - 2017-05-23 12:41:53
|
Revision: 8073
http://sourceforge.net/p/docutils/code/8073
Author: milde
Date: 2017-05-23 12:41:45 +0000 (Tue, 23 May 2017)
Log Message:
-----------
Minor documentation fixes.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/utils/__init__.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2017-05-22 23:24:06 UTC (rev 8072)
+++ trunk/docutils/HISTORY.txt 2017-05-23 12:41:45 UTC (rev 8073)
@@ -82,22 +82,22 @@
in a "DUclass" environment. This replaces the special handling for
"epigraph" and "topic" elements.
-* tools/rst2html4.py: New front-end.
-
-* tools/dev/generate_punctuation_chars.py: New skript
- to test and update utils.punctuation_chars.
-
* docutils/writers/odf_ odt/__init__.py:
- - Command line option -l/--language now sets the default language
+ - Command setting ``language`` now sets the default language
of the generated ODF document.
- The use of image directive options :width: (%), :scale:, etc now
set the width/height/size of images in the generated ODF
documents.
- The heading/title of admonitions now reflects the language
- specified by the -l/--language command line option.
+ specified by the ``language`` setting.
+* tools/rst2html4.py: New front-end.
+* tools/dev/generate_punctuation_chars.py: New skript
+ to test and update utils.punctuation_chars.
+
+
Release 0.13.1 (2016-12-09)
===========================
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2017-05-22 23:24:06 UTC (rev 8072)
+++ trunk/docutils/docutils/utils/__init__.py 2017-05-23 12:41:45 UTC (rev 8073)
@@ -606,8 +606,10 @@
def find_combining_chars(text):
"""Return indices of all combining chars in Unicode string `text`.
+ >>> from docutils.utils import find_combining_chars
>>> find_combining_chars(u'A t̆ab̆lĕ')
[3, 6, 9]
+
"""
if isinstance(text, str) and sys.version_info < (3,0):
return []
@@ -616,8 +618,10 @@
def column_indices(text):
"""Indices of Unicode string `text` when skipping combining characters.
+ >>> from docutils.utils import column_indices
>>> column_indices(u'A t̆ab̆lĕ')
[0, 1, 2, 4, 5, 7, 8]
+
"""
# TODO: account for asian wide chars here instead of using dummy
# replacements in the tableparser?
@@ -674,17 +678,21 @@
Example:
+ >>> from docutils.utils import normalize_language_tag
>>> normalize_language_tag('de_AT-1901')
['de-at-1901', 'de-at', 'de-1901', 'de']
+ >>> normalize_language_tag('de-CH-x_altquot')
+ ['de-ch-x-altquot', 'de-ch', 'de-x-altquot', 'de']
+
"""
# normalize:
- tag = tag.lower().replace('_','-')
+ tag = tag.lower().replace('-','_')
# split (except singletons, which mark the following tag as non-standard):
- tag = re.sub(r'-([a-zA-Z0-9])-', r'-\1_', tag)
- taglist = []
- subtags = [subtag.replace('_', '-') for subtag in tag.split('-')]
+ tag = re.sub(r'_([a-zA-Z0-9])_', r'_\1-', tag)
+ subtags = [subtag for subtag in tag.split('_')]
base_tag = [subtags.pop(0)]
# find all combinations of subtags
+ taglist = []
for n in range(len(subtags), 0, -1):
for tags in unique_combinations(subtags, n):
taglist.append('-'.join(base_tag+tags))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|