def html_annotate(doclist, markup=default_markup):
 tokenlist = [tokenize_annotated(doc, version) for (doc, version) in doclist]
 cur_tokens = tokenlist[0]
 for tokens in tokenlist[1:]:
  html_annotate_merge_annotations(cur_tokens, tokens)
  cur_tokens = tokens
 cur_tokens = compress_tokens(cur_tokens)
 result = markup_serialize_tokens(cur_tokens, markup)
 return ''.join(result).strip()

def html_annotate ( doclist , markup = default_markup ) : tokenlist = [ tokenize_annotated ( doc , version ) for ( doc , version ) in doclist ] cur_tokens = tokenlist [ 0 ] for tokens in tokenlist [ 1 : ] : html_annotate_merge_annotations ( cur_tokens , tokens ) cur_tokens = tokens cur_tokens = compress_tokens ( cur_tokens ) result = markup_serialize_tokens ( cur_tokens , markup ) return '' . join ( result ) . strip ( )
doclist should be ordered from oldest to newest .