'Generate a truncated version of the supplied string.
Given a string and NCX destination, truncate string to length specified
in self.opts.
Args:
description (str): string to truncate
dest (str): NCX destination
description  NCX summary
title        NCX title
author       NCX author
Return:
(str): truncated description'

def generate_short_description(self, description, dest=None):

    def _short_description(description, limit):
        short_description = ''
        words = description.split()
        for word in words:
            short_description += (word + '    ')
            if (len(short_description) > limit):
                short_description += '...'
                return short_description
    if (not description):
        return None
    if (dest == 'title'):
        return description
    elif (dest == 'author'):
        if (self.opts.author_clip and (len(description) < self.opts.author_clip)):
            return description
        else:
            return _short_description(description, self.opts.author_clip)
    elif (dest == 'description'):
        if (self.opts.description_clip and (len(description) < self.opts.description_clip)):
            return description
        else:
            return _short_description(description, self.opts.description_clip)
    else:
        print ("    returning    description    with    unspecified    destination    '%s'" % description)
        raise RuntimeError
