html_annotate(doclist,
markup=<function default_markup at 0x89879cc>)
| source code
|
doclist should be ordered from oldest to newest, like:
>>> version1 = 'Hello World'
>>> version2 = 'Goodbye World'
>>> html_annotate([(version1, 'version 1'),
... (version2, 'version 2')])
u'<span title="version 2">Goodbye</span> <span title="version 1">World</span>'
The documents must be fragments (str/UTF8 or unicode), not
complete documents
The markup argument is a function to markup the spans of words.
This function is called like markup('Hello', 'version 2'), and
returns HTML. The first argument is text and never includes any
markup. The default uses a span with a title:
>>> default_markup('Some Text', 'by Joe')
u'<span title="by Joe">Some Text</span>'
|