code: def _format_text(self, title, text, color, ellide=False):
          
          template = '''
              <div style=\'font-family: "{font_family}";
                          font-size: {title_size}pt;
                          color: {color}\'>
                  <b>{title}</b>
              </div>
          '''
          if text:
              template += '''
              <hr>
              <div style=\'font-family: "{font_family}";
                          font-size: {text_size}pt;
                          color: {color_text}\'>
                  {text}
              </div>
              '''
  
          # Prepare text
          if isinstance(text, list):
              text = "\n    ".join(text)
  
          text = text.replace('\n', '<br>')
  
          # Ellide the text if it is too long
          if ellide and len(text) > self.calltip_size:
              text = text[:self.calltip_size] + " ..."
  
          # Get current font properties
          font = self.font()
          font_family = font.family()
          title_size = font.pointSize()
          text_size = title_size - 1 if title_size > 9 else title_size
  
          tiptext = template.format(
              font_family=font_family,
              title_size=title_size,
              text_size=text_size,
              color=color,
              color_text=self._DEFAULT_TEXT_COLOR,
              title=title,
              text=text,
          )
  
          return tiptext
docs: Create HTML template for calltips and tooltips.
  
          This will display title and text as separate sections and add `...`
          if `ellide` is True and the text is too long.