class_docstr: Render a layout.Doc object
class_docstr_tok: ["Render","a","layout.Doc","object"]
docstr: Return a name to use for the object
  
  Parameters
  ----------
  el:
      A griffe Alias or Object
  format:
      The format to use for the object's name.
docstr_tok: ["Return","a","name","to","use","for","the","object","Parameters","--","--","--","--","--","el",":","A","griffe","Alias","or","Object","format",":","The","format","to","use","for","the","object","'s","name","."]
code: def format_name(self, format="relative") -> str:
      """
      Return a name to use for the object
  
      Parameters
      ----------
      el:
          A griffe Alias or Object
      format:
          The format to use for the object's name.
      """
      if format in ("name", "short"):
          res = self.obj.name
      elif format == "relative":
          res = ".".join(self.obj.path.split(".")[1:])
      elif format == "full":
          res = self.obj.path
      elif format == "canonical":
          res = self.obj.canonical_path
      else:
          raise ValueError(
              f"Unknown format {format!r} for an object name."
          )
      return res
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from functools import cached_property, singledispatchmethod
  from typing import TYPE_CHECKING, cast
  import griffe.expressions
  from griffe import dataclasses
  from griffe.docstrings import dataclasses
  from quartodoc import ast
  from quartodoc import layout
  from quartodoc.pandoc.blocks import Block, BlockContent, Blocks, CodeBlock, Div, Header
  from quartodoc.pandoc.components import Attr
  from quartodoc.pandoc.inlines import Code, Inline, Inlines, Link, Span
  from ..format import markdown_escape, pretty_code, repr_obj
  from ..typing import DocObjectKind
  from ..utils import InterLink, is_protocol, is_typealias, is_typevar, no_init
  from .base import RenderBase
label_desc: Use image node_id 7 for calling the __RenderDoc obj's underlying member method code with example usage: obj.format_name(format) and returns: res