Python sphinx_rtd_theme 模块,get_html_theme_path() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用sphinx_rtd_theme.get_html_theme_path()

项目:chalktalk_docs    作者:loremIpsum1771    | 项目源码 | 文件源码
def load_extra_theme(cls, name):
        if name in ('alabaster', 'sphinx_rtd_theme'):
            if name == 'alabaster':
                import alabaster
                themedir = alabaster.get_path()
                # alabaster theme also requires 'alabaster' extension, it will be loaded
                # at sphinx.application module.
            elif name == 'sphinx_rtd_theme':
                import sphinx_rtd_theme
                themedir = sphinx_rtd_theme.get_html_theme_path()
            else:
                raise NotImplementedError('Programming Error')

        else:
            for themedir in load_theme_plugins():
                if path.isfile(path.join(themedir, name, THEMECONF)):
                    break
            else:
                # specified theme is not found
                return

        cls.themepath.append(themedir)
        cls.themes[name] = (path.join(themedir, name), None)
        return