class_docstr: A custom callout for use on table of contents-style pages that link into
  other pages.
  
  The callout contains a header, a body, a clickable button that links to
  the provided link, and an optional image.
  
  Example usage::
  
      .. customcalloutitem::
          :header: Custom header
          :description: Custom body
          :button_text: Custom button
          :button_link: other/page.html
          :image: ../_static/images/custom-image.jpg
class_docstr_tok: ["A","custom","callout","for","use","on","table","of","contents-style","pages","that","link","into","other","pages",".","The","callout","contains","a","header",",","a","body",",","a","clickable","button","that","links","to","the","provided","link",",","and","an","optional","image",".","Example","usage",":",":","..","customcalloutitem",":",":",":","header",":","Custom","header",":","description",":","Custom","body",":","button_text",":","Custom","button",":","button_link",":","other\/page.html",":","image",":","..","\/_static\/images\/custom-image.jpg"]
code: def run(self):
      header = self.options.get("header", "")
      description = self.options.get("description", "")
      button_text = self.options.get("button_text", "")
      button_link = self.options.get("button_link", "")
      image = self.options.get("image", "")
  
      classes = "with-right-arrow" if button_link else ""
      attributes = (
          ""
          if button_link
          else 'onclick="return false;" style="pointer-events:none;cursor:default;"'
      )
  
      if image:
          callout_rst = _CUSTOM_CALLOUT_TEMPLATE.format(
              header=header,
              description=description,
              button_text=button_text,
              button_link=button_link,
              classes=classes,
              attributes=attributes,
              image='<img src="%s">' % image,
          )
  
      else:
          # No image
          template = _CUSTOM_CALLOUT_TEMPLATE.replace(
              "<div>{image}</div>", ""
          )
  
          callout_rst = template.format(
              header=header,
              description=description,
              button_text=button_text,
              button_link=button_link,
              classes=classes,
              attributes=attributes,
          )
  
      button_list = StringList(callout_rst.split("\n"))
      button = nodes.paragraph()
      self.state.nested_parse(button_list, self.content_offset, button)
      return [button]
  
file_path: fiftyone/docs/source/custom_directives.py
imports: from docutils.parsers.rst import Directive, directives
  from docutils.statemachine import StringList
  from docutils import nodes
label_desc: Use image node_id 1 for calling the CustomCalloutItemDirective obj's underlying member method code with example usage: obj.run() and returns: list