class_docstr: A custom card item for use on pages that contain a list of links with
  short descriptions and optional images.
  
  The card item provides a heading, a description, and an optional image to
  the right. The entire card is clickable and links to the provided link.
  
  Example usage::
  
      .. customcarditem::
          :header: Custom card
          :description: This is a custom card. Click to learn more.
          :link: other/page.html
          :image: ../_static/images/custom-image.jpg
          :tags: Custom-Tag
class_docstr_tok: ["A","custom","card","item","for","use","on","pages","that","contain","a","list","of","links","with","short","descriptions","and","optional","images",".","The","card","item","provides","a","heading",",","a","description",",","and","an","optional","image","to","the","right",".","The","entire","card","is","clickable","and","links","to","the","provided","link",".","Example","usage",":",":","..","customcarditem",":",":",":","header",":","Custom","card",":","description",":","This","is","a","custom","card",".","Click","to","learn","more",".",":","link",":","other\/page.html",":","image",":","..","\/_static\/images\/custom-image.jpg",":","tags",":","Custom-Tag"]
code: def run(self):
      header = self.options.get("header", "")
      description = self.options.get("description", "")
      link = self.options.get("link", "")
      image = self.options.get("image", "")
      tags = self.options.get("tags", "")
  
      if image:
          card_rst = _CUSTOM_CARD_TEMPLATE.format(
              header=header,
              description=description,
              link=link,
              image='<img src="%s">' % image,
              tags=tags,
          )
      else:
          # No image
          template = _CUSTOM_CARD_TEMPLATE.replace(
              '<div class="tutorials-image">{image}</div>', ""
          )
  
          card_rst = template.format(
              header=header,
              description=description,
              link=link,
              tags=tags,
          )
  
      card_list = StringList(card_rst.split("\n"))
      card = nodes.paragraph()
      self.state.nested_parse(card_list, self.content_offset, card)
      return [card]
  
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 CustomCardItemDirective obj's underlying member method code with example usage: obj.run() and returns: list