code: def _nicetitle(coord, value, maxchar, template):
      
      prettyvalue = format_item(value, quote_strings=False)
      title = template.format(coord=coord, value=prettyvalue)
  
      if len(title) > maxchar:
          title = title[:(maxchar - 3)] + '...'
  
      return title
docs: Put coord, value in template and truncate at maxchar