docs: def parse_toplevel_config(self, config):
          """Parse @config to setup @self state."""
          if not Formatter.initialized:
              html_theme = config.get('html_theme', 'default')
  
              if html_theme != 'default':
                  uri = urllib.parse.urlparse(html_theme)
                  if not uri.scheme:
                      html_theme = config.get_path('html_theme')
                      debug("Using theme located at %s" % html_theme)
                  elif uri.scheme.startswith('http'):
                      html_theme = self.__download_theme(uri)
  
              if html_theme == 'default':
                  default_theme = os.path.join(HERE, os.pardir,
                                               'hotdoc_bootstrap_theme', 'dist')
  
                  html_theme = os.path.abspath(default_theme)
                  debug("Using default theme")
  
              theme_meta_path = os.path.join(html_theme, 'theme.json')
  
              if os.path.exists(theme_meta_path):
                  with open(theme_meta_path, 'r') as _:
                      Formatter.theme_meta = json.loads(_.read())
  
              searchpath = []
              self.__load_theme_templates(searchpath, HERE)
  
              Formatter.theme_path = html_theme
              if html_theme:
                  self.__load_theme_templates(searchpath, html_theme)
  
              Formatter.extra_theme_path = config.get_path('html_extra_theme')
              if Formatter.extra_theme_path:
                  self.__load_theme_templates(searchpath,
                                              Formatter.extra_theme_path)
  
              Formatter.engine = Engine(
                  loader=FileLoader(searchpath, encoding='UTF-8'),
                  extensions=[CoreExtension(), CodeExtension()])
              Formatter.engine.global_vars.update({'e': html.escape})
  
              Formatter.initialized = True