

def _sanity_check(self):
    'Check the current site for sanity.\n\n        This method checks that the site is propertly set up for building\n        things with sphinx, e.g. it has a config file, a master document,\n        the hyde sphinx extension is enabled, and so-on.\n        '
    try:
        sphinx_config = self.sphinx_config
    except EnvironmentError:
        logger.error('Could not read the sphinx config file.')
        conf_path = self.settings.conf_path
        conf_path = self.site.sitepath.child_folder(conf_path)
        conf_file = conf_path.child('conf.py')
        logger.error('Please ensure %s is a valid sphinx config', conf_file)
        logger.error('or set sphinx.conf_path to the directory')
        logger.error('containing your sphinx conf.py')
        raise
    extensions = sphinx_config.get('extensions', [])
    if ('hyde.ext.plugins.sphinx' not in extensions):
        logger.error('The hyde_json sphinx extension is not configured.')
        logger.error("Please add 'hyde.ext.plugins.sphinx' to the list")
        logger.error('of extensions in your sphinx conf.py file.')
        logger.info('(set sphinx.sanity_check=false to disable this check)')
        raise RuntimeError('sphinx is not configured correctly')
    master_doc = sphinx_config.get('master_doc', 'index')
    master_doc += sphinx_config.get('source_suffix', '.rst')
    master_doc = os.path.join(conf_path.site.content.path, master_doc)
    if (not os.path.exists(master_doc)):
        logger.error("The sphinx master document doesn't exist.")
        logger.error('Please create the file %s', master_doc)
        logger.error("or change the 'master_doc' setting in your")
        logger.error('sphinx conf.py file.')
        logger.info('(set sphinx.sanity_check=false to disable this check)')
        raise RuntimeError('sphinx is not configured correctly')
    for plugin in self.site.plugins:
        if (plugin is self):
            break
        if (not isinstance(plugin, _MetaPlugin)):
            logger.error('The sphinx plugin is installed after the')
            logger.error('plugin %r.', plugin.__class__.__name__)
            logger.error("It's quite likely that this will break things.")
            logger.error('Please move the sphinx plugin to the top')
            logger.error('of the plugins list.')
            logger.info('(sphinx.sanity_check=false to disable this check)')
            raise RuntimeError('sphinx is not configured correctly')

dataset/ETHPy150Open hyde/hyde/hyde/ext/plugins/sphinx.py SphinxPlugin._sanity_check/VarMisuse@178/484 `self`->`conf_path`