class_docstr: Resolve documentation links using searchindex.js generated by Sphinx
  
  Parameters
  ----------
  doc_url : str
      The base URL of the project website.
  searchindex : str
      Filename of searchindex, relative to doc_url.
  extra_modules_test : list of str
      List of extra module names to test.
  relative : bool
      Return relative links (only useful for links to documentation of this
      package).
code: def __init__(
      self,
      doc_url,
      gallery_dir,
      searchindex="searchindex.js",
      extra_modules_test=None,
      relative=False,
  ):
      self.doc_url = doc_url
      self.gallery_dir = gallery_dir
      self.relative = relative
      self._link_cache = {}
  
      self.extra_modules_test = extra_modules_test
      self._page_cache = {}
      if doc_url.startswith(("http://", "https://")):
          if relative:
              raise ValueError(
                  "Relative links are only supported for local "
                  "URLs (doc_url cannot be absolute)"
              )
          searchindex_url = doc_url + "/" + searchindex
      else:
          searchindex_url = os.path.join(doc_url, searchindex)
  
      # detect if we are using relative links on a Windows system
      if os.name.lower() == "nt" and not doc_url.startswith(
          ("http://", "https://")
      ):
          if not relative:
              raise ValueError(
                  "You have to use relative=True for the local"
                  " package on a Windows system."
              )
          self._is_windows = True
      else:
          self._is_windows = False
  
      # download and initialize the search index
      sindex = get_data(searchindex_url, gallery_dir)
      filenames, objects = parse_sphinx_searchindex(sindex)
  
      self._searchindex = dict(filenames=filenames, objects=objects)
  
imports: from __future__ import print_function
  import codecs
  import gzip
  import os
  import posixpath
  import re
  import shelve
  import sys
  from io import StringIO
  from .None import sphinx_compatibility
label_desc: Use image node_id 1 to create a new SphinxDocLinkResolver object from inherited base classes: object with example: obj = SphinxDocLinkResolver(doc_url, gallery_dir, searchindex, extra_modules_test, relative)