docs: def compute_toc_line_indentation_spaces(
          header_type_curr: int = 1,
          header_type_prev: int = 0,
          no_of_indentation_spaces_prev: int = 0,
          parser: str = 'github',
          ordered: bool = False,
          list_marker: str = '-',
          list_marker_log: list = build_list_marker_log('github', '.'),
          index: int = 1) -> int:
      r"""Compute the number of indentation spaces for the TOC list element.
  
      :parameter header_type_curr: the current type of header (h[1-Inf]).
           Defaults to ``1``.
      :parameter header_type_prev: the previous type of header (h[1-Inf]).
           Defaults to ``0``.
      :parameter no_of_indentation_spaces_prev: the number of previous indentation spaces.
           Defaults to ``0``.
      :parameter parser: decides rules on how compute indentations.
           Defaults to ``github``.
      :parameter ordered: if set to ``True``, numbers will be used
           as list ids or otherwise a dash character, otherwise.
           Defaults to ``False``.
      :parameter list_marker: a string that contains some of the first
           characters of the list element.
           Defaults to ``-``.
      :parameter list_marker_log: a data structure that holds list marker
           information for ordered lists.
           Defaults to ``build_list_marker_log('github', '.')``.
      :parameter index: a number that will be used as list id in case of an
           ordered table of contents. Defaults to ``1``.
      :type header_type_curr: int
      :type header_type_prev: int
      :type no_of_indentation_spaces_prev: int
      :type parser: str
      :type ordered: bool
      :type list_marker: str
      :type list_marker_log: list
      :type index: int
      :returns: no_of_indentation_spaces_curr, the number of indentation spaces
           for the list element.
      :rtype: int
      :raises: a built-in exception.
  
      .. note::
           Please note that this function
           assumes that no_of_indentation_spaces_prev contains the correct
           number of spaces.
      """
      assert header_type_curr >= 1
      assert header_type_prev >= 0
      assert no_of_indentation_spaces_prev >= 0
      if (parser == 'github' or parser == 'cmark' or parser == 'gitlab'
              or parser == 'commonmarker' or parser == 'redcarpet'):
          if ordered:
              assert list_marker in md_parser[parser]['list']['ordered'][
                  'closing_markers']
          else:
              assert list_marker in md_parser[parser]['list']['unordered'][
                  'bullet_markers']
      if (parser == 'github' or parser == 'cmark' or parser == 'gitlab'
              or parser == 'commonmarker'):
          if ordered:
              assert len(
                  list_marker_log) == md_parser['github']['header']['max_levels']
              for e in list_marker_log:
                  assert isinstance(e, str)
      assert index >= 1
  
      if (parser == 'github' or parser == 'cmark' or parser == 'gitlab'
              or parser == 'commonmarker'):
          if header_type_prev == 0:
              # Base case for the first toc line.
              no_of_indentation_spaces_curr = 0
          elif header_type_curr == header_type_prev:
              # Base case for same indentation.
              no_of_indentation_spaces_curr = no_of_indentation_spaces_prev
          else:
              if ordered:
                  list_marker_prev = str(list_marker_log[header_type_curr - 1])
              else:
                  # list_marker for unordered lists will always be 1 character.
                  list_marker_prev = list_marker
  
              # Generic cases.
              if header_type_curr > header_type_prev:
                  # More indentation.
                  no_of_indentation_spaces_curr = (
                      no_of_indentation_spaces_prev + len(list_marker_prev) +
                      len(' '))
              elif header_type_curr < header_type_prev:
                  # Less indentation.
                  no_of_indentation_spaces_curr = (
                      no_of_indentation_spaces_prev -
                      (len(list_marker_prev) + len(' ')))
  
              # Reset older nested list indices. If this is not performed then
              # future nested ordered lists will rely on incorrect data to
              # compute indentations.
              if ordered:
                  for i in range((header_type_curr - 1) + 1,
                                 md_parser['github']['header']['max_levels']):
                      list_marker_log[i] = str(
                          md_parser['github']['list']['ordered']
                          ['min_marker_number']) + list_marker
  
          # Update the data structure.
          if ordered:
              list_marker_log[header_type_curr - 1] = str(index) + list_marker
  
      elif parser == 'redcarpet':
          no_of_indentation_spaces_curr = 4 * (header_type_curr - 1)
  
      return no_of_indentation_spaces_curr