class_docstr: Render Spans as SVGs.
class_docstr_tok: ["Render","Spans","as","SVGs","."]
docstr: Render span types in text.
  
  Spans are rendered per-token, this means that for each token, we check if it's part
  of a span slice (a member of a span type) or a span start (the starting token of a
  given span type).
  
  tokens (list): Individual tokens in the text
  spans (list): Individual entity spans and their start, end, label, kb_id and kb_url.
  title (str / None): Document title set in Doc.user_data['title'].
docstr_tok: ["Render","span","types","in","text",".","Spans","are","rendered","per-token",",","this","means","that","for","each","token",",","we","check","if","it","'s","part","of","a","span","slice","(","a","member","of","a","span","type",")","or","a","span","start","(","the","starting","token","of","a","given","span","type",")",".","tokens","(","list",")",":","Individual","tokens","in","the","text","spans","(","list",")",":","Individual","entity","spans","and","their","start",",","end",",","label",",","kb_id","and","kb_url",".","title","(","str","\/","None",")",":","Document","title","set","in","Doc.user_data","[","'title","'","]","."]
code: def render_spans(
      self,
      tokens: List[str],
      spans: List[Dict[str, Any]],
      title: Optional[str],
  ) -> str:
      """Render span types in text.
  
      Spans are rendered per-token, this means that for each token, we check if it's part
      of a span slice (a member of a span type) or a span start (the starting token of a
      given span type).
  
      tokens (list): Individual tokens in the text
      spans (list): Individual entity spans and their start, end, label, kb_id and kb_url.
      title (str / None): Document title set in Doc.user_data['title'].
      """
      per_token_info = self._assemble_per_token_info(tokens, spans)
      markup = self._render_markup(per_token_info)
      markup = TPL_SPANS.format(content=markup, dir=self.direction)
      if title:
          markup = TPL_TITLE.format(title=title) + markup
      return markup
  
imports: import uuid
  from typing import Any, Dict, List, Optional, Tuple, Union
  from ..errors import Errors
  from ..util import escape_html, minify_html, registry
  from .templates import TPL_DEP_ARCS, TPL_DEP_SVG, TPL_DEP_WORDS, TPL_DEP_WORDS_LEMMA, TPL_ENT, TPL_ENT_RTL, TPL_ENTS, TPL_FIGURE, TPL_KB_LINK, TPL_PAGE, TPL_SPAN, TPL_SPAN_RTL, TPL_SPAN_SLICE, TPL_SPAN_SLICE_RTL, TPL_SPAN_START, TPL_SPAN_START_RTL, TPL_SPANS, TPL_TITLE
label_desc: Use image node_id 3 for calling the SpanRenderer obj's underlying member method code with example usage: obj.render_spans(tokens, spans, title) and returns: markup