class_docstr: Render a layout.Doc object
class_docstr_tok: ["Render","a","layout.Doc","object"]
docstr: Create code snippet that declares a variable
  
  This applies to function parameters and module/class attributes
  
  Parameters
  ----------
  name :
      Name of the variable
  
  annotation :
      Type Annotation of the variable or parameter
  
  default :
      Default value of the variable/parameter.
docstr_tok: ["Create","code","snippet","that","declares","a","variable","This","applies","to","function","parameters","and","module\/class","attributes","Parameters","--","--","--","--","--","name",":","Name","of","the","variable","annotation",":","Type","Annotation","of","the","variable","or","parameter","default",":","Default","value","of","the","variable\/parameter","."]
code: def render_variable_definition(
      self,
      name: str,
      annotation: Optional[str],
      default: Optional[str | expr.Expr],
  ) -> Inline:
      """
      Create code snippet that declares a variable
  
      This applies to function parameters and module/class attributes
  
      Parameters
      ----------
      name :
          Name of the variable
  
      annotation :
          Type Annotation of the variable or parameter
  
      default :
          Default value of the variable/parameter.
      """
      lst = []
      if name:
          lst.append(Span(name, Attr(classes=["doc-parameter-name"])))
  
      if annotation:
          if name:
              lst.append(
                  Span(
                      ":",
                      Attr(classes=["doc-parameter-annotation-sep"]),
                  )
              )
          annotation = pretty_code(annotation)
          lst.append(
              Span(
                  annotation, Attr(classes=["doc-parameter-annotation"])
              )
          )
  
      # Equal sign depends on name and annotation
      if name:
          eq = " = " if annotation else "="
          equals = Span(eq, Attr(classes=["doc-parameter-default-sep"]))
      else:
          equals = None
  
      if default:
          default = pretty_code(repr_obj(default))
          lst.extend(
              [
                  equals,
                  Span(
                      default, Attr(classes=["doc-parameter-default"])
                  ),
              ]
          )
      return Inlines(lst)
  
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 10 for calling the __RenderDoc obj's underlying member method code with example usage: obj.render_variable_definition(name, annotation, default) and returns: Inlines